Deployment
MikroLens deploys as a static browser app, a Node API, SQLite data, and an optional webhook worker.
Release downloads are split the same way:
mikrolens_app_<version>.zipcontains the static browser app.mikrolens_api_<version>.zipcontains the API server, webhook worker, and backend config example.
npm run buildOutputs:
dist/appcontains static frontend assets.dist/server/server.mjscontains the API server.dist/server/webhook-worker.mjscontains the outbound webhook delivery worker.
Same-Origin Deployment
Section titled “Same-Origin Deployment”The simplest team deployment serves the API and static app from one origin:
node dist/server/server.mjs --static-root ./dist/app --host 0.0.0.0 --port 3000From release archives, the API entry file is at the archive root:
node /opt/mikrolens/api/mikrolens_api_1.0.0/server.mjs \ --static-root /opt/mikrolens/app/mikrolens_app_1.0.0 \ --host 0.0.0.0 \ --port 3000Set MIKROLENS_APP_URL to the public browser URL. The browser config can use the same origin as its API base URL.
Split-Origin Deployment
Section titled “Split-Origin Deployment”If the static app and API use different origins:
- Set
app/config.jsonwith the public API base URL before building or deployment. - Set
MIKROLENS_APP_URLto the public app URL. - Set
MIKROLENS_ALLOWED_ORIGINSto the public app origin.
Webhook Worker
Section titled “Webhook Worker”Run the worker as a separate long-running process when outbound webhooks are enabled:
node dist/server/webhook-worker.mjsFrom a release archive:
node /opt/mikrolens/api/mikrolens_api_1.0.0/webhook-worker.mjsUse a stable MIKROLENS_WEBHOOK_WORKER_ID per worker process. Multiple workers can run against the same database when their IDs differ.
Persistent Data
Section titled “Persistent Data”SQLite data should live outside dist so upgrades can replace application code without replacing team data.
MIKROLENS_DB_PATH=/srv/mikrolens/data/mikrolens.sqliteHealth Check
Section titled “Health Check”Use /health or /api/health to check the API, database, and static files without exposing deployment details.