¥129.90
One-time template price with installation and customization
One-click private deployment after purchase, details Live previewProcureQC — Deployment Guide
Applies to version 1.1.0 · Deployment shape: single container, published on port 8080 Audience: the buyer's own ops team and implementation partners. Follow section 1 and you will be looking at the sign-in page within about five minutes.
1. Five-minute deployment
1.1 With Docker Compose (recommended — laptop or single server)
# 1) Unpack the upload package
unzip procureqc-upload.zip -d procureqc
cd procureqc
# 2) Start the service (foreground logs)
docker compose up -d
# 3) Open
# http://localhost:8080
The first start creates the tables (apps/api/drizzle/sqlite/000*.sql), creates the owner account, and optionally seeds demo data. Wait until docker compose ps reports healthy before opening the browser; the health check probes http://localhost:8080/api/health.
Production safety: the default passwords exist for the very first boot only. Change the owner password at first sign-in (the system forces it), set
JWT_SECRETin.env(or in the compose environment), then rundocker compose up -dagain to restart.
1.2 Without Compose (plain docker run)
docker build -t procureqc:1.1.0 .
docker run -d --name procureqc -p 8080:8080 \
-v "$PWD/data:/app/data" \
-e JWT_SECRET="replace-with-a-random-string" \
procureqc:1.1.0
# open http://localhost:8080
1.3 Platform deployment (marketplace / managed cloud)
intematrix.deploy.json at the package root and intematrix.meta.deploy in package.json already declare:
mode: single,dockerfile: Dockerfile,port: 8080;- the
appcontainer is public (public: true), with its health check on/api/health; - all environment variables are injected by the platform, the platform probes liveness against 8080, and no image carries a baked-in domain assumption.
2. What the container does
There is exactly one container, and it carries the whole application:
| Role | Implementation | Notes |
|---|---|---|
| API | bun server/index.js (that is, apps/api/out/index.js) |
ElysiaJS, mounts /api/*, Swagger at /docs |
| Static front end | @elysiajs/static pointed at /app/public |
SPA (HashRouter); / returns index.html with no-store |
| Runtime configuration | GET /config.js (intercepted early in onRequest) |
Emits window.__IMX_CONFIG__ according to PUBLIC_API_MODE |
| Data | /app/data/sqlite.db |
A volume is mandatory — otherwise a rebuilt container loses everything |
The image does not run bun install or vite build: artifacts ship inside the package (apps/web/dist, apps/api/out), so starting up is just unpack and run. Dockerfile.source exists only for self-hosted customisation; the upload package does not depend on it (and does not contain it).
3. How the front end reaches the API (runtime config.js)
This is the key v6 change: the front-end mode is no longer fixed at build time.
apps/web/index.htmlloads./config.jsbeforemain.tsx;In a production container,
GET /config.jsis rendered by the API from environment variables:window.__IMX_CONFIG__ = { apiMode: "http", apiBase: "/api" };apps/web/src/lib/http/client.tsreadswindow.__IMX_CONFIG__and decides between the real API and demo data;The marketplace's online preview injects
apiMode: "mock", so no separate mock build artifact is required.
To force demo mode yourself (for example a static showcase for a prospect): PUBLIC_API_MODE=mock docker compose up -d. The sign-in page then offers demo identities, and all business data lives in browser memory — a refresh resets it.
4. Environment variables (full list)
| Variable | Default | When it applies | Notes |
|---|---|---|---|
PORT |
8080 in the container |
startup | Listen port; the Dockerfile pins 8080, so http://localhost:8080 is always the entry point |
BIND_HOST |
0.0.0.0 |
startup | Bind address. Do not use the platform-injected HOST (that is the public domain) |
NODE_ENV |
development (production in the container) | startup | Static artifacts are only served when this is production |
PUBLIC_DIR |
./public (/app/public in the container) |
startup | Front-end artifact directory |
MIGRATIONS_DIR |
auto-detected | startup | /app/drizzle in the container |
DB_DRIVER |
sqlite |
startup | sqlite / mysql / postgres |
DATABASE_URL |
data/sqlite.db (/app/data/sqlite.db in the container) |
startup | Database connection string |
JWT_SECRET |
dev-secret-change-me |
startup | Must be replaced in production; changing it invalidates existing sessions |
SUPER_ADMIN_EMAIL |
admin@example.com |
first start | Owner account; an existing account is not overwritten |
SUPER_ADMIN_NAME |
Super Admin |
first start | Owner display name |
SUPER_ADMIN_PASSWORD |
Admin@123456 |
first start | Owner initial password (must_change_password, forced change at first sign-in) |
DEMO_PASSWORD |
Demo@123456 |
first start / alignment outside production | Password for the business demo accounts |
SEED_DEMO_DATA |
off | startup, empty database only | 1 / true writes the demo business data |
PUBLIC_API_MODE |
http |
every request for /config.js |
mock makes the front end run on demo data |
PUBLIC_API_BASE |
/api |
every request for /config.js |
For reverse proxies that change the API prefix |
CORS_ORIGIN |
* |
startup | Nothing to do when UI and API share a domain |
AI_PROVIDER / AI_API_KEY / AI_MODEL |
empty | every request | Only affect the /api/ai demo assistant; the business logic does not depend on them |
5. Local development
bun install
cp apps/api/.env.example apps/api/.env # edit as needed
bun run dev # web: http://localhost:5173 api: http://localhost:3000
- The 5173 / 3000 ports printed by
bun run devare development-only and have nothing to do with the deployment port 8080; - Build artifacts:
bun run build→apps/web/dist(apiMode: http) plusapps/api/out/index.js; - To preview mock locally:
bun run build:mock→apps/web/dist(apiMode: mock). Never upload that artifact —bun run check:distrejects it, because it expects http.
6. Data and backup
| Content | Location (inside the container) | How to back it up |
|---|---|---|
| Business database | /app/data/sqlite.db |
Stop the container and copy the file, or use SQLite's online backup (sqlite3 file ".backup copy.db") |
| Migration scripts | /app/drizzle/ |
Shipped with the package; no separate backup needed |
- The data directory must be on a volume (Compose already maps
./data:/app/data); otherwisedocker compose downtakes the data with it; - Moving machines: copy the whole
data/directory across and start the container — that is the restore (for large version jumps, run migrations first, see §8); - The System settings → Backup and export page gives you the conventions and data locations, not a one-click full-database download, deliberately, to avoid accidents.
7. Reverse proxy / HTTPS
An Nginx snippet (forward /config.js and /api unchanged — no path rewriting needed):
server {
listen 80;
server_name procureqc.example.com;
client_max_body_size 100m;
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;
}
}
- The front end uses a HashRouter, so deep pages live behind
#/...— you do not need an SPA fallback rule; - Terminate TLS at the proxy (certbot and friends); the container speaks plain HTTP only;
- If you mount the API under a sub-path (for example
/procureqc/api), also setPUBLIC_API_BASE=/procureqc/apiand have the proxy strip the prefix.
8. Upgrades
# 1) Back up data/
tar czf procureqc-data-$(date +%F).tgz data/
# 2) Rebuild from the new package (keeping data/)
docker compose down
unzip -o new-version-upload.zip -d procureqc-new && cd procureqc-new
cp -r ../procureqc/data ./data
docker compose up -d --build
- New migrations under
apps/api/drizzle/<dialect>/run automatically at startup (idempotent; already-applied ones are skipped); - Read the release notes at the top of the bundled
docs/en/DEPLOYMENT.mdxbefore a major upgrade; - Rollback: put the old package's
data/back and start the old image. Migrations are not reversed — use the pre-upgrade backup if you need to go back further.
9. Troubleshooting
| Symptom | Cause | What to do |
|---|---|---|
| 502 or a blank page on 8080 | The container is still starting (migrations plus account creation) | Wait for healthy in docker compose ps; check docker logs for migration errors |
| Page loads but sign-in returns 401 | Fresh database with no account (the SUPER_ADMIN_* values changed) |
Sign in with the account that matches the current environment variables, or drop the database and start over (demo environments only) |
| Stuck on the password-change page after signing in | Forced change at first sign-in (seeded owner and the IQC demo account) | Change the password as prompted; the flag is cleared afterwards |
| The UI keeps showing "demo data" | PUBLIC_API_MODE=mock, or the preview link carries ?mode=preview |
Set it back to http and restart; confirm /config.js serves http |
| Body text stays Chinese after switching language | Business data is not translated (supplier names, item names and so on) — this is expected | UI copy should be English; if a whole page is Chinese, check whether a ?lang= parameter is taking priority |
| The health check never turns healthy | The port is not 8080, or migrations failed | Read docker logs; confirm PORT=8080 |
| White screen and chunk-load errors after a redeploy | A stale index.html is cached |
/ is already served with no-store; confirm the proxy is not overriding Cache-Control |
| Scheduled jobs and exports are slow | SQLite writes to a single file | Switch to MySQL or PostgreSQL for larger volumes (change DB_DRIVER and DATABASE_URL) |
Proving which build you are on: curl http://localhost:8080/api/health returns status: ok, version: 1.1.0, features (78 capability names) and startedAt. If startedAt does not match your release record, the container is still running the old back end — do not start changing code.
10. Packaging and upload (for implementation and customisation)
bun run check # i18n gate + permission gate + web/api type check
bun run test # 187 unit tests
bun run build # production build: dist/.build-meta.json = http
bun run check:dist # must print "dist mode: http"
bun run pack # → procureqc-upload.zip (UTF-8 filenames with the flag bit set)
bun run verify:upload # all 33 upload gates green
Run the whole chain in one command with bun run pack:upload (check → test → build → check:dist → pack → verify).
The upload package excludes: node_modules, data/, logs, local databases and real secrets.
11. Redeploying after customisation
- Once the code is changed, run
bun run pack:upload— the gates block hard-coded Chinese strings, write endpoints without a declared permission code, and mock artifacts; - Upload the new zip over the old package, or run
docker compose up -d --buildlocally; - If migrations changed (new
.sqlfiles underapps/api/drizzle/), back updata/before upgrading.
Development conventions live in the bundled AGENTS.md (build contract, route partitioning, i18n and gates).
12. Domain conventions
- This template hard-codes no domain: the same package can be deployed many times, and the platform assigns the domain per deployment id;
- The platform injects
HOST(public domain),BIND_HOST(bind address) andPUBLIC_HOST/PUBLIC_URL; - The container only listens on
BIND_HOST:8080. Never useHOSTas the bind address — it is a domain name and will not bind; - When emails or callbacks need an absolute URL, read
PUBLIC_URL; never concatenatelocalhost.
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.
