¥69.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 General

Gatherly — Deployment Guide

Applies to version 1.2.0 (production build apiMode=http; runtime configuration comes from /config.js). Written for buyers: follow the sections in order and the system runs.


1. Five-minute deployment

1.1 With Docker (recommended)

# Unzip, then enter the project root (the folder with Dockerfile and docker-compose.yml)
docker compose up -d

Open http://localhost:8080 → top-right "Sign in" → log in as the admin (admin@example.com / Admin@123456 by default).

docker compose ps          # the app service should be healthy
docker compose logs -f app # startup log: migrations → seed → listening at http://0.0.0.0:8080

There is exactly one port: 8080. Dockerfile PORT=8080 + EXPOSE 8080, package.json intematrix.meta.deploy.port: 8080, intematrix.deploy.json port: 8080, and all three places inside docker-compose.yml (ports / environment.PORT / healthcheck). Change all five together, otherwise the platform health probe stays unhealthy.

1.2 Without Docker (run locally)

bun install
bun run build                 # production build: apps/web/dist + apps/api/out/index.js
cd apps/api
PORT=8080 BIND_HOST=0.0.0.0 \
PUBLIC_DIR=../web/dist DATABASE_URL=../../data/sqlite.db \
bun out/index.js

Open http://localhost:8080. The database is created at DATABASE_URL on boot (auto-migrate + seed).


2. Container responsibilities

Container Port Role
app 8080 (public) API + serves the front-end build (/app/public) + SPA GET /
  • Single-container template (mode: single): no worker, no redis, no separate static server;
  • The image does not run bun install or vite build: the upload package already ships production artifacts (apps/api/out, apps/web/dist);
  • Process inside: bun server/index.js;
  • One persistent volume: /app/data (SQLite file + uploads).

3. How front end and back end are wired (runtime config.js)

The front end does not bake the API address at build time. It loads a synchronous script before the bundle:

<!-- apps/web/index.html -->
<script src="./config.js"></script>

config.js is emitted by the backend from environment variables (apps/api/src/app.ts, an onRequest early intercept that wins over static files):

// GET /config.js
window.__IMX_CONFIG__ = { apiMode: "http", apiBase: "/api" };
Variable Meaning Default
PUBLIC_API_MODE http uses the real API; mock uses front-end demo data (preview / screenshots only) http
PUBLIC_API_BASE API prefix; use an absolute URL when the API lives on another domain /api
  • apps/web/dist/config.js in the package is a static fallback (also http); inside the container the API output wins;
  • Both /config.js and GET / send cache-control: no-store, so a redeploy never serves a stale HTML shell;
  • To see the mock behaviour: PUBLIC_API_MODE=mock docker compose up -d (that is exactly what the shop preview injects).

4. Environment variables

Variable Default Required Notes
NODE_ENV development ✅ Use production (controls static hosting)
PORT 8080 (fixed in the image) — Container port; keep the five layers consistent
BIND_HOST 0.0.0.0 — Listen address; injected by the platform. Do not use the public domain here
PUBLIC_DIR /app/public — Front-end build directory
PUBLIC_API_MODE http — See §3
PUBLIC_API_BASE /api — See §3
DB_DRIVER sqlite — sqlite / mysql / postgres
DATABASE_URL /app/data/sqlite.db ✅ File path for SQLite, connection string for MySQL/PG
MIGRATIONS_DIR /app/drizzle — Migrations applied automatically on boot
UPLOAD_DIR /app/data/uploads — Upload target; public URLs are /upload/...
JWT_SECRET dev-secret-change-me ✅ change in production JWT signing secret, 32 random bytes recommended
CORS_ORIGIN * — Restrict to your domain in production
LOG_LEVEL info — debug / info / warn / error
STORAGE_DRIVER local — local is implemented; s3 / oss are placeholders
MAIL_PROVIDER console — console logs emails only; smtp / ses are placeholders
MAIL_FROM no-reply@example.com — Sender address
SMS_PROVIDER console — Same as above (aliyun / twilio are placeholders)
RATE_LIMIT_LOGIN_PER_MINUTE 30 — Per-IP per-minute limit for login and public submissions (≤0 disables)
WS_TICKET_TTL_SEC 60 — WebSocket one-time ticket lifetime
SUPER_ADMIN_EMAIL admin@example.com — Super admin email created on first boot
SUPER_ADMIN_NAME Super Admin — Display name
SUPER_ADMIN_PASSWORD Admin@123456 ✅ change in production Only used when no super admin exists yet

Seeded accounts must change their password on first sign-in (§8②): signing in with the default password lands on /#/change-password before the workspace opens. That is by design (see Product Spec §7).

Changing SUPER_ADMIN_PASSWORD affects first creation only. Once a super admin exists, use Admin → Users to reset the password.


5. Local development

bun install
bun run dev          # web(5173) + api(3000); the front end uses demo data by default
bun run dev:http     # front end against a local backend (3000); start bun run dev:api separately
bun run dev:api      # backend only
Address Notes
http://localhost:5173 Vite dev server (development port, not the deployment port)
http://localhost:3000 Backend dev port (apps/api/src/env.ts default)
http://localhost:3000/docs Swagger

3000 / 5173 exist in development only. Deployment is 8080; the docs and compose files all use 8080.

Handy commands:

bun run check         # type checks (web + api)
bun test              # full suite (115 cases)
bun run build         # production build (web=http + api out)
bun run build:mock    # mock build for local demos (**never upload this**)
bun run check:dist    # reads dist/.build-meta.json, must be http

6. Data and backup

Item Location
SQLite database /app/data/sqlite.db (DATABASE_URL)
Uploads /app/data/uploads (UPLOAD_DIR)
Migrations /app/drizzle/{sqlite,mysql,postgres}

Backup (safe even while running, for SQLite):

docker compose exec app sh -c 'tar czf - /app/data' > gatherly-backup-$(date +%F).tar.gz

Restore: stop the container → extract over /app/data → start it again (pending migrations run on boot).

Switching to MySQL / PostgreSQL:

environment:
  DB_DRIVER: postgres
  DATABASE_URL: postgres://user:pass@db:5432/gatherly

Migrations (0000–0004; 0004 adds the first-login password flag) run automatically on boot. Test on an empty database first; this template does not ship a cross-dialect data migration tool.


7. Reverse proxy and HTTPS

Nginx example (WebSocket must be forwarded too — /#/console/realtime uses it):

server {
  listen 443 ssl;
  server_name events.example.com;

  location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }

  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 front end uses HashRouter (all pages live under #/...), so no try_files deep-link fallback is needed;
  • Never cache / or /config.js in the proxy (the backend already sends no-store);
  • Upload size: 10MB per file by default (upload.maxSizeMb); keep client_max_body_size at or above it.

8. Upgrades

# ① Back up (see §6)
# ② Unpack the new version over the code, keeping /app/data
docker compose build --no-cache
docker compose up -d
# ③ Pending migrations run on boot; confirm healthy
curl -s http://localhost:8080/api/health

The running version is version in GET /api/health (currently 1.2.0).


9. Troubleshooting

Symptom Cause Fix
Blank page after redeploy Browser cached the old HTML that referenced removed chunks Hard reload; confirm / sends cache-control: no-store
Page loads, every API is 404 The proxy forwards / but not /api Add location /api
"Account does not exist" on sign-in Using a documented demo email against an empty or swapped database Check DATABASE_URL; first boot seeds accounts
401 "wrong email or password" after setting SUPER_ADMIN_PASSWORD That variable only applies to first creation Reset the password under Admin → Users
Container stays unhealthy Compose healthcheck or port is not 8080 Verify ports / environment.PORT / healthcheck
Submission returns 429 IP rate limit hit (30/min default) Raise RATE_LIMIT_LOGIN_PER_MINUTE or check for scripted traffic
Check-in says "not started" / "already ended" Outside checkinWindowMinutes Widen the window in event settings, or check session times and time zone
Event detail 403 / empty list Signed-in account belongs to another tenant Sign in with an account of the same tenant
Upload returns 413 Proxy limit below upload.maxSizeMb Raise client_max_body_size
English UI still shows Chinese on a custom page Missing dictionary entry in your own additions cd apps/web && bun scripts/check-i18n.ts and add the missing entry to src/lib/i18n/views.ts

10. Health self-check (do this after every deployment)

curl -s http://localhost:8080/api/health

Expected (32 feature entries):

{
  "status": "ok",
  "service": "api",
  "version": "1.2.0",
  "timestamp": "2026-11-26T…",
  "startedAt": "2026-11-26T…",
  "features": ["gatherly:public-events", "gatherly:public-registration", "…", "docs:rag-v2"]
}

Then confirm three more things:

curl -s http://localhost:8080/config.js            # window.__IMX_CONFIG__ = {"apiMode":"http","apiBase":"/api"}
curl -s -o /dev/null -w '%{http_code}\n' -X POST \
  -H 'content-type: application/json' -d '{}' \
  http://localhost:8080/api/auth/register          # 404 (no self-service registration)
curl -s http://localhost:8080/api/public/events | head -c 200   # public events are seeded

11. Packaging after secondary development

bun install
bun run check          # type checks
bun test               # 143 cases
bun run build          # production build: dist/.build-meta.json = apiMode:http
bun run check:dist     # must print "dist 模式:http"
bun run pack           # → ../gatherly-upload.zip (Python zipfile, UTF-8 filename flag)
bun run verify:upload  # 33/33 green (single-container profile)

Or in one shot:

bun run pack:upload    # check → test → build → check:dist → pack → verify

Package checklist

  • No node_modules / data / logs / local databases / real secrets inside;
  • Must contain apps/web/dist/.build-meta.json (apiMode: "http"), apps/web/dist/config.js, apps/api/out/index.js, apps/api/drizzle/**;
  • Never upload build:mock output: verify item 4 fails immediately (apiMode=mock);
  • Chinese file names must carry the UTF-8 flag: pack runs scripts/zip-pack.py verify and refuses to emit a broken package.

12. Domain and access conventions

Item Convention
Public port 8080 (the platform health probe uses it too)
Health path /api/health (healthcheck.path in intematrix.deploy.json)
Front-end routing HashRouter (https://your-domain/#/console); no deep-link fallback needed
API prefix /api (override with PUBLIC_API_BASE for an absolute URL)
Uploaded file URL /upload/... (site root, not under /api)
Static assets /assets/... (content-hashed, long cache is fine)
Home page and config.js no-store, never cached

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 写进前端代码或提交到仓库。