¥129.90
One-time template price with installation and customization
One-click private deployment after purchase, details Live previewDeployment Guide — VenueBook
Version 1.1.0 · single container · public port 8080 · data in
/app/dataAudience: whoever deploys and operates the system. Section 1 gets you running in five minutes; jump to section 9 when something breaks.
1. Five-minute deploy
# 1) unzip
unzip venuebook-upload.zip -d venuebook && cd venuebook
# 2) start (first start creates the DB, runs migrations, seeds demo data)
docker compose up -d
# 3) open it
http://localhost:8080
You land on the venue site (/). Staff login: http://localhost:8080/#/venue/login.
| Staff code | Role | Initial password |
|---|---|---|
admin |
Venue manager | admin123 |
F001 |
Front desk | 123456 |
S001 |
Court steward | 123456 |
C001 |
Coach | 123456 |
FN01 |
Finance | 123456 |
Every seeded account must change its password on first login — you are redirected to the change-password page. Rebuild accounts for real staff before going live.
2. What the container does
| Item | Value |
|---|---|
| Image | root Dockerfile (oven/bun runtime, copies artefacts only — no install/build inside the image) |
| Public port | 8080 (EXPOSE 8080, meta.deploy.port = 8080) |
| Volume | app-data → /app/data (SQLite database, uploads, backups) |
| Health check | GET /api/health → { status: "ok" } |
| Command | bun server/index.js (that is apps/api/out/index.js) |
| Static files | apps/web/dist → /app/public, served by the same process (GET / is no-store) |
One container, one process: static files and /api are served by the same Elysia process. No extra nginx is required.
3. Web/API wiring (config.js, v6 behaviour)
The web app no longer decides between real APIs and demo data by build-time constants or by probing /api/health.
It reads runtime configuration only:
<!-- loaded first in apps/web/index.html -->
<script src="./config.js"></script>
- Static fallback:
apps/web/dist/config.jssetswindow.__IMX_CONFIG__ = { apiMode: "http", apiBase: "/api" }; - Overridden at runtime:
/config.jsis answered by the API'sonRequesthook from environment variables:PUBLIC_API_MODE=http(default) → real APIs;PUBLIC_API_MODE=mock→ demo mode (preview / troubleshooting only, never in production);PUBLIC_API_BASEdefaults to/api; only change it when the API lives on another host;
- The response is
cache-control: no-store, so changing the variable and restarting the container is enough — no rebuild.
Why the early hook:
distalso contains a staticconfig.js, and the static plugin would answer first, making the environment variable ineffective (this bug is fixed in the base template).
4. Environment variables
| Variable | Default | Meaning |
|---|---|---|
PORT |
8080 (Dockerfile; env.ts dev default 3000) |
Listen port |
BIND_HOST |
0.0.0.0 |
Bind address; use what the platform injects, never use HOST (the public domain) as a bind address |
NODE_ENV |
production (image) |
production serves the web build |
PUBLIC_API_MODE |
http |
Runtime API mode of the web app: http / mock |
PUBLIC_API_BASE |
/api |
Web request prefix |
PUBLIC_DIR |
/app/public |
Web build directory |
DB_DRIVER |
sqlite |
Only sqlite is supported (business migrations are SQLite only) |
DATABASE_URL |
/app/data/sqlite.db |
SQLite file path; backups live in the sibling backups/ directory |
MIGRATIONS_DIR |
/app/drizzle |
Migrations (apps/api/drizzle) |
UPLOAD_DIR |
/app/data/uploads |
Uploads (public links /upload/...) |
JWT_SECRET |
dev-secret-change-me |
Must be replaced in production (session signing; changing it logs everyone out) |
CORS_ORIGIN |
* |
Allowed origin (same-origin deployments keep the default) |
VENUE_ADMIN_PASSWORD |
admin123 |
Initial password for the seeded manager (first DB creation only) |
SUPER_ADMIN_EMAIL / SUPER_ADMIN_NAME / SUPER_ADMIN_PASSWORD |
admin@example.com / Super Admin / Admin@123456 |
Platform account seed (kept for base compatibility; /admin is removed) |
LOG_LEVEL |
info |
debug / info / warn / error |
STORAGE_DRIVER |
local |
Only local (s3/oss are placeholders) |
MAIL_PROVIDER / SMS_PROVIDER |
console |
Log only (smtp/ses/aliyun are placeholders) |
RATE_LIMIT_LOGIN_PER_MINUTE |
30 |
Login rate limit per IP |
WS_TICKET_TTL_SEC |
60 |
WebSocket one-time ticket TTL |
5. Local development
bun install
bun run dev # web 5173 (mock by default) + api 3000
bun run dev:http # web talks to the real API (vite proxy /api → 127.0.0.1:3000)
bun run dev:api # API only
- Ports 3000 / 5173 are development only; the deployment port is always 8080;
.env.developmentdefaults toVITE_API_MODE=mock; runtime configuration still wins;- The local database is
apps/api/data/sqlite.db(override withDATABASE_URL);bun run venue:dbruns migrations and seeds once.
6. Data and backups
| Item | Location | Notes |
|---|---|---|
| SQLite database | /app/data/sqlite.db |
WAL mode; survives container rebuilds (volume app-data) |
| Uploads | /app/data/uploads |
Public links /upload/YYYY/MM/DD/... |
| Backups | /app/data/backups |
Created from Settings → Receipt / import-export / backup; retention from backup_keep_days (default 30 days) |
Cold backup (recommended daily):
docker compose exec app sh -c 'cp /app/data/sqlite.db /app/data/backups/manual-$(date +%F).db'
# or back up the whole volume
docker run --rm -v venuebook_app-data:/data -v "$PWD":/backup alpine tar czf /backup/venuebook-data.tgz -C /data .
Restore: stop the container → replace /app/data/sqlite.db (remove -wal / -shm first) → start. Keep a copy of the
current database before restoring.
7. Reverse proxy and HTTPS
The container listens on 8080; put nginx / Caddy / the platform reverse proxy in front:
server {
listen 443 ssl;
server_name venue.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# WebSocket (realtime demo); remove if unused
location /api/ws {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
The web app uses HashRouter (#/...), so no history fallback is needed; GET / is no-store, so a redeploy never
leaves an old HTML pointing at deleted chunks.
8. Upgrading
# 1) backup
docker compose exec app sh -c 'cp /app/data/sqlite.db /app/data/backups/pre-upgrade.db'
# 2) swap the package (keep the volume)
docker compose down
# unzip the new version over the code directory (do not overwrite data/)
docker compose up -d --build
Migrations run automatically on start (idempotent); seeds only fill gaps and never overwrite existing rows.
9. Troubleshooting
| Symptom | Check first | Fix |
|---|---|---|
| 8080 not reachable | docker compose ps healthy? docker compose logs -f |
Port in use (PORT=8081 docker compose up -d); read the first error in the log |
| Page loads but API returns 404 / 502 | curl localhost:8080/api/health |
API not running: check out/index.js and PUBLIC_DIR |
| Page shows demo data (unexpectedly) | curl localhost:8080/config.js |
PUBLIC_API_MODE=mock is still set; remove it and restart |
| Tab title / brand still old | curl localhost:8080/api/app/identity |
Save again on the App identity page; hard-refresh the browser |
| Login bounces back to login page | Did JWT_SECRET change or the container restart? |
Changing the secret invalidates sessions; log in again |
Login lands on /login / register |
Old bookmark | /login redirects to /venue/login; use the staff code |
| "Slot already booked" while the grid looks empty | Was the grid refreshed? | Refresh; first successful submit wins |
| Uploaded images 404 | Is UPLOAD_DIR on the volume? Is /upload blocked by the proxy? |
Proxy everything under /, do not block /upload |
| Backup list empty | Writable /app/data/backups? |
mkdir -p /app/data/backups inside the container |
Self-diagnosis: GET /api/health returns a features list. When an endpoint 404s, check the list first:
missing → the environment runs an older package; present → it is a code problem.
10. Packaging and uploading (for template maintainers)
v6 order — upload packages must be production builds:
bun run check # type checks (web + api)
bun run check:i18n # bilingual gate (bare Chinese / missing keys / placeholders)
bun run test # unit + API e2e
bun run build # web production build (dist/.build-meta.json apiMode=http) + api out/index.js
bun run check:dist # must print "dist 模式:http"
bun run pack # → venue-booking-system-upload.zip (Python zipfile, UTF-8 flags on CJK names)
bun run verify:upload # gate: docs / rag / port / config
One-shot: bun run pack:upload (check → check:i18n → test → build → check:dist → pack → verify).
Do not upload a build:mock artifact: the marketplace preview injects the mock runtime config, and the gate
rejects a dist whose apiMode is not http.
11. Redeploy after custom development
- Change code (entry points in the Product Spec, section 11);
bun run check && bun run test;bun run build(the Dockerfile only runs artefacts);- Repack and upload, or run
docker compose up -d --buildlocally; - Verify:
/api/healthfeatures, log in as all five roles, walk one booking → check-in → payment.
12. Domain conventions
The template never hard-codes a domain: the same package is deployed many times. The platform assigns a domain per
deployment and injects HOST (public host), BIND_HOST (bind address), PUBLIC_HOST / PUBLIC_URL, DEPLOYMENT_ID.
Do not put network.subnet or a container ip in the manifest (the platform allocates the subnet; hard-coding fails
pre-flight). Use container-name DNS between containers.
13. Health self-check
curl -s localhost:8080/api/health
{
"status": "ok",
"service": "api",
"version": "1.1.0",
"features": ["venue.public.venue", "venue.public.courts", "venue.public.slots", "venue.public.book",
"venue.auth.login", "venue.auth.me", "venue.auth.change-password", "venue.auth.logout",
"venue.settings", "venue.identity", "venue.court", "venue.pricing", "venue.customer",
"venue.card", "venue.booking", "venue.checkin", "venue.payment", "venue.package",
"venue.recurring", "venue.service", "venue.todo", "venue.report", "venue.system.backup",
"venue.logs", "app.identity", "system.config", "users", "permissions", "ws"],
"startedAt": "2026-11-26T02:10:00.000Z",
"timestamp": "2026-11-26T02:12:31.000Z"
}
startedAt is the process start time: if it does not change, the container did not really restart.
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.
