¥129.90

One-time template price with installation and customization

One-click private deployment after purchase, details

Choose a payment method

Live preview
Version 1.0.0 Updated 11/26/2026 0 downloads · 0 deployments Retail

Deployment Guide · CosRentLite Costume Rental

Single container: one image serves the built frontend and /api on port 8080. SQLite by default (files under /app/data); MySQL and PostgreSQL are supported.

5-minute deploy

The upload package already contains build artifacts (apps/web/dist, apps/api/out, apps/api/drizzle); the image never installs dependencies or builds at startup.

docker compose up -d
# then open:
http://localhost:8080

Health check: curl http://localhost:8080/api/health should return status: ok with a features list. On first start the app migrates the database and seeds the default tenant, roles, menus, config and demo data.

For production, change JWT_SECRET and SUPER_ADMIN_PASSWORD, and set DEMO_SEED=false (see below).

Container responsibilities

Container Port Purpose
app (only, public) 8080 Serves dist, /api (ElysiaJS) and /upload/* files
  • The frontend uses HashRouter, so no server-side deep-link fallback is needed;
  • GET / returns index.html with no-store (old HTML will not reference deleted chunks after a redeploy);
  • /config.js is produced by the API and served before static files;
  • The SQLite file and uploads live in /app/data (the compose file mounts the app-data volume).

Frontend/backend wiring: runtime config.js

The API mode is not compiled into the bundle; the frontend reads window.__IMX_CONFIG__ at startup:

Variable Default Meaning
PUBLIC_API_MODE http http = real backend; mock = built-in demo data (debugging only)
PUBLIC_API_BASE /api API prefix; change it when reverse-proxying elsewhere

The uploaded dist is a production build (apiMode: http); marketplace previews inject a mock config.js, so a separate mock package is unnecessary. bun run check:dist reads dist/.build-meta.json.

Environment variables

Variable Default Required Purpose
NODE_ENV production in image — Production mode serves the built frontend
PORT 8080 — In-container port (matches Dockerfile and manifest)
BIND_HOST 0.0.0.0 — Bind address (keep platform value when injected)
PUBLIC_DIR /app/public — Frontend artifact directory
DB_DRIVER sqlite maybe sqlite / mysql / postgres
DATABASE_URL /app/data/sqlite.db or DSN maybe SQLite file path or database DSN
MIGRATIONS_DIR /app/drizzle — Migration scripts directory
UPLOAD_DIR /app/data/uploads — Upload storage directory
JWT_SECRET dev-secret-change-me yes Token signing key; rotating it signs everyone out
SUPER_ADMIN_EMAIL admin@example.com yes Owner account (created on first start)
SUPER_ADMIN_NAME 苏禾(店主) recommended Owner display name
SUPER_ADMIN_PASSWORD Admin@123456 yes Owner initial password
PUBLIC_API_MODE / PUBLIC_API_BASE http / /api — See "runtime config.js"
DEMO_SEED true before go-live Seed demo accounts, sample orders and logs; false starts with an empty dataset
AI_CONFIG_SECRET empty optional Encrypts model keys stored from the back office
LOG_LEVEL info (warn in test) optional Log verbosity
CORS_ORIGIN * optional CORS origin; same-domain deploys need no change
RATE_LIMIT_LOGIN_PER_MINUTE 30 optional Login/register rate limit per IP

PORT=3000 in .env.example is the local dev port, as the comment states; the container port is 8080.

Local development

bun install
bun run dev          # api: 3000, web: 5173 (Vite proxies /api and /upload)
  • Development uses mock data by default; click a role on the login page to enter;
  • To hit the real backend: bun run dev:http, or change VITE_API_PROXY;
  • Verify: bun run check (design/i18n/permission gates + typecheck) and bun test.

Data and backup

  • SQLite: /app/data/sqlite.db; uploads: /app/data/uploads/ (volume app-data);
  • Backup: docker compose stop app → archive the volume → restore by extracting it back and docker compose up -d;
  • The back office "Backup & export" can export orders, customers and deposits to CSV (BOM included for Excel);
  • To switch database: set DB_DRIVER and DATABASE_URL; migrations for that dialect run at startup.

Reverse proxy and HTTPS

  • Proxy to http://127.0.0.1:8080; forward Host, X-Forwarded-For, X-Forwarded-Proto;
  • WebSocket upgrades go to /api/ws; enable Upgrade in the proxy;
  • Never hard-code a domain in the template: the platform injects HOST / PUBLIC_HOST; bind with BIND_HOST.

Upgrade

  1. Back up /app/data (especially the SQLite file);
  2. Rebuild the image from the new package and start it; pending migrations under apps/api/drizzle run automatically;
  3. Verify /api/health version, /config.js = http, and login/order flows;
  4. Roll back by restoring the previous image tag and the data volume.

Troubleshooting

Symptom Check first Fix
Port 8080 unreachable docker compose ps health Read docker compose logs app; confirm PORT and port mapping
Page loads but API 404s /api/health A static host is serving /api as a page; run the real image
Still sees demo data after login apiMode in /config.js Must be http; mock means the env var or preview injection is still on
White screen / chunk load failure after redeploy GET / cache header Must be no-store; hard-refresh once
Uploaded photos 404 GET /upload/... Check UPLOAD_DIR is a persistent volume and the proxy allows /upload
Migration error SQL in the logs DB_DRIVER and DATABASE_URL must match; don't mix dialect directories
Times off by hours Server time zone This template uses server local time; set container TZ

Packaging and re-upload (after customization)

bun run check          # design / i18n / permission gates + web/api typecheck
bun test
bun run build          # web production (dist/.build-meta.json = http) + api (out/index.js)
bun run check:dist     # must print "dist mode: http"
bun run pack           # -> cosrentlite-upload.zip (UTF-8 filename flags)
bun run verify:upload  # 35 upload checks

Before uploading, make sure the package contains no node_modules, data, logs or real secrets.

Domain conventions

  • The platform assigns domains per deployment; the template hard-codes none;
  • Self-hosted: point rent.example.com to the proxy and keep /api and /upload on the same domain.

Health self-check

{
  "status": "ok",
  "service": "api",
  "version": "1.1.1",
  "features": ["auth.login", "shop.orders", "biz.acceptance", "..."],
  "startedAt": "2026-11-25T08:00:00.000Z"
}

features is a hand-maintained capability list: if an endpoint 404s, check this first — a missing capability means the container runs an old backend; redeploy instead of changing code.

Frequently asked questions

What do I get after purchase?
The full source code (web frontend + API backend), deployment documentation and an online preview. After purchase you can download it from "My Projects" and use it for your own product.
Can it be deployed to my own server?
The Web + API edition supports one-click private deployment, so data stays on your own infrastructure. Mini-program and App add-on packages are not one-click deployable.
Can I get a refund?
Orders whose code package has not been downloaded can request a refund through a support ticket. Once the code package has been downloaded, refunds are not supported.
How do I reach support?
Open "My Projects" and click "Support" to submit a ticket. Staff reply inside the ticket, and status changes are pushed as WeChat notifications.

部署 API Key

用于「一键部署」与部署 Skill/脚本;明文经服务端 RSA 加密后由本页解密,不会明文出网。

你的 API Key(前缀 )
配置环境变量 INTEMATRIX_DEPLOY_APIKEY
export INTEMATRIX_DEPLOY_APIKEY=imd_xxx

macOS/Linux 追加到 ~/.zshrc 或 ~/.bashrc 可持久化;Windows 的 setx 需重开终端生效。

重置后旧 Key 立即失效;请勿把 Key 写进前端代码或提交到仓库。