¥99.90
One-time template price with installation and customization
One-click private deployment after purchase, details Live previewAuthCore — Deployment Guide
Goal: get the uploaded package running in five minutes, and know which variable does what and where to look first.
1. Five-minute Docker deploy
# 1) Unzip the upload package
unzip authcore-upload.zip -d authcore && cd authcore
# 2) Start (the image only runs artifacts; nothing is built inside)
docker compose up -d
# 3) Open
http://localhost:8080
On first start the app creates tables and seeds demo data (default tenant, built-in roles and permission points, admin account, three demo applications, org tree, user groups, dictionaries and anomaly samples).
Inject two secrets in production (otherwise development defaults are used, which means no real encryption):
JWT_SECRET=<random 32+ bytes> MASTER_KEY=<random 32+ bytes> docker compose up -d
On the platform, put these two into the deployment environment variables; no code changes needed.
2. Container
| Container | Image | Port | Responsibility |
|---|---|---|---|
| app | Dockerfile |
8080 | ElysiaJS API + static hosting of the built frontend |
- The image does not
bun installor build:apps/api/out/index.jsandapps/web/distare already in the package; - Data lives in
/app/data(sqlite + uploads), mounted as theapp-datavolume so it survives rebuilds; - Health check:
GET /api/health(returnsstatus: okand afeatureslist).
3. Frontend/backend contract (config.js at runtime)
One build serves both cases:
apps/web/index.htmlloads./config.jsfirst;- In deployment
apps/apiservesGET /config.jsfrom environment variables:window.__IMX_CONFIG__ = { apiMode: "http", apiBase: "/api" }; - The marketplace preview service injects
apiMode: "mock"and the frontend switches to demo data; - To force mock locally: set
PUBLIC_API_MODE=mockand restart.
API base defaults to /api; OAuth/OIDC endpoints are mounted at the site root
(/oauth/*, /.well-known/openid-configuration, /health, /ready).
4. Environment variables
| Variable | Default | Description |
|---|---|---|
PORT |
3000 dev / 8080 in image |
Listen port (fixed to 8080 in Dockerfile) |
BIND_HOST |
0.0.0.0 |
Bind address; never use HOST (public hostname) as bind address |
PUBLIC_DIR |
./public |
Frontend artifact directory (/app/public in image) |
DB_DRIVER |
sqlite |
sqlite / mysql / postgres |
DATABASE_URL |
./data/sqlite.db |
SQLite file path or connection string |
UPLOAD_DIR |
./data/uploads |
Upload directory |
MIGRATIONS_DIR |
package drizzle |
Migrations directory (/app/drizzle in image) |
JWT_SECRET |
dev-secret-change-me |
Token/session signing key; required in production |
MASTER_KEY |
falls back to JWT_SECRET |
Master key for encrypting client/app secrets and private keys; set separately in production |
ISSUER_URL |
empty → derived from request Host | OIDC issuer (id_token.iss and discovery URLs); set when a fixed domain exists |
CORS_ORIGIN |
* |
Allowed origins; tighten in production |
SUPER_ADMIN_EMAIL |
admin@example.com |
Seed admin email |
SUPER_ADMIN_NAME |
Super Admin |
Seed admin name |
SUPER_ADMIN_PASSWORD |
Admin@123456 |
Seed admin password; change before go-live |
PUBLIC_API_MODE |
http |
Mode served by /config.js; mock for local demo only |
PUBLIC_API_BASE |
/api |
API base served by /config.js |
LOG_LEVEL |
info |
debug / info / warn / error |
RATE_LIMIT_LOGIN_PER_MINUTE |
30 |
Login/register rate limit per IP per minute (≤0 disables) |
WS_TICKET_TTL_SEC |
60 |
WebSocket one-time ticket TTL (seconds) |
STORAGE_DRIVER |
local |
local; s3 / oss are adapter placeholders |
MAIL_PROVIDER |
console |
console logs; smtp / ses are placeholders |
MAIL_FROM |
no-reply@example.com |
Sender |
SMS_PROVIDER |
console |
console; aliyun / twilio are placeholders |
Global parameters (token TTLs, session timeouts, lock policy, password policy, rate limits, audit retention…) live under Global settings in the admin UI; saving applies immediately without restart.
5. Local development
bun install
bun run dev # web 5173 + api 3000
- Dev ports: api 3000, web 5173 (Vite proxies
/apito 3000); - Container port is fixed at 8080 by the Dockerfile, independent of
.env; bun run build— production build (dist/.build-meta.jsonwithapiMode=http);bun run build:mock— local demo only; do not upload this artifact.
6. Data and backup
- Default SQLite single file
/app/data/sqlite.db; one replica only (do not share the file across instances); - Backup: Tools → Backup creates a sqlite snapshot, or copy
/app/data; - Restore: stop the container, replace
sqlite.db, start again; - For scale, switch
DB_DRIVER=mysql|postgres+DATABASE_URL; migrations live inapps/api/drizzle/<dialect>/; - Audit retention defaults to 365 days; backups and recycle bin default to 30 days.
7. Reverse proxy and HTTPS
- TLS terminates at the platform proxy/Nginx;
- The proxy must forward
X-Forwarded-Host/X-Forwarded-Proto(OIDC issuer and callbacks rely on them); - With a fixed domain, set
ISSUER_URL=https://sso.example.com; redirect_urimatching is exact: add production callbacks to each application before go-live.
8. Upgrade
- Back up
/app/data; - Replace dist/out and drizzle from the new package, restart (migrations are applied and idempotent);
- Check
/api/healththatfeaturescontains the new capabilities; - Walk through applications, keys, roles and audit once.
9. Troubleshooting
| Symptom | Look at | Fix |
|---|---|---|
| Blank page / endless spinner | Browser console; curl -s http://<host>:8080/config.js |
apiMode should be http; mock means PUBLIC_API_MODE=mock |
| Login shows HTTP 502 | /api/health |
Backend not up: check logs (port, migrations, DB) |
| Every API 401 | localStorage auth-storage |
Token expired or session revoked; sign in again |
| Admin area bounces to login | Is the account super_admin? |
Members have no admin access; grant a role |
/api/health misses a capability |
Running an old backend | Redeploy; don't change code first |
| Blank page without errors | Was dist rebuilt? | Elysia's static plugin snapshots files at startup; restart after rebuilding dist |
| Chinese doc names garbled in marketplace | Are docs/ filenames ASCII? |
This package uses ASCII filenames; keep them |
| Container stays unhealthy | docker compose ps / healthcheck |
Ensure PORT=8080 in all three places and /api/health reachable |
10. Packing and upload (after customisation)
bun run check # type check
bun test # unit tests
bun run build # production build (web dist + api out)
bun run check:dist # must print "dist 模式:http"
bun run pack # → ../authcore-platform-upload.zip
bun run verify:upload # upload self-check, all green before uploading
Order matters: build, then check:dist. If interrupted, restart from bun run build.
11. Domain conventions
- The platform assigns the deployment domain; never hard-code it;
- Use relative paths (
/api,/config.js,/upload/...), neverhttp://localhost:8080; - Register callbacks per real domain; wildcards are not supported.
12. Health self-verification
curl -s http://localhost:8080/api/health
# {"status":"ok","service":"api","version":"1.0.0","features":[...],"startedAt":"..."}
curl -s http://localhost:8080/config.js
# window.__IMX_CONFIG__ = {"apiMode":"http","apiBase":"/api"};
curl -s http://localhost:8080/ready
# {"status":"ready","driver":"sqlite",...}
features lists roughly 40 capabilities: on a 404, check whether the target is listed — if not, the environment runs an old backend.
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.
