Self-hosting
Run the whole stack on your computer with Docker, then put the same pieces on Railway. Every variable is listed, with where it goes.
What runs where
| Service | Port | What it does | How it runs |
|---|---|---|---|
| Web app | 8080 | The site you open in the browser | Locally: npm run dev. Railway: the Dockerfile. |
| PocketBase | 8090 | Database, sign-in and the server-side hooks | Docker |
| n8n | 5678 | Scans, ticket and chat webhooks | Docker |
| WhatsApp API | 3102 | Links one WhatsApp number for the Inbox (optional) | Docker |
| Agent runner | none | Runs your coding agent. Outbound only. | Your own machine |
Run it locally
1. Start the backend
PocketBase and n8n in Docker. It reuses the existing pocketbase_smartaudit volume, so your data is kept.
docker compose up -ddocker compose ps
2. Start the web app
In its own terminal, from the repository root. Opens at http://localhost:8080.
npm run dev3. Follow the backend logs
Useful when a webhook or scan does nothing.
docker compose logs -f pocketbase n8nThe first time, or after a schema change, apply the collections and rules. This needs a PocketBase superuser:
$env:PB_URL = "http://127.0.0.1:8090" $env:PB_EMAIL = "you@example.com" $env:PB_PASSWORD = "..." node pocketbase/import.mjs
Check the rules, run the tests, build
npm run pb:checknpm testnpm run build
Environment files
The site works with no environment file: it talks to PocketBase on this computer. Use a file only to point it elsewhere.
| File | Used by | In git? |
|---|---|---|
| .env.example | A template to copy from. Holds no real values. | Yes |
| .env.local | npm run dev. Your overrides, such as webhook addresses. | No |
| .env.live | npm run dev:live. Runs the site here against the live database. | Yes (a public address, not a secret) |
| pocketbase/.env | docker compose. Webhook secrets and service addresses. | No |
| whatsapp-api/.env | The WhatsApp API. Its webhook, secret and key. | Keep it out of git: it holds secrets |
Start your own overrides
Copy the template, then uncomment and fill in only what you need.
cp .env.example .env.localRun against the live database
Reads .env.live. Nothing else changes.
npm run dev:liveDeploy on Railway
Railway runs several services. Each has its own variables, so set them on the right one.
| Service | Built from | Variables are |
|---|---|---|
| Website | The Dockerfile in this repository | Build variables (VITE_*), baked into the page |
| PocketBase | ghcr.io/muchobien/pocketbase | Runtime variables (LYNX_*) |
| n8n | docker.n8n.io/n8nio/n8n | Its own credentials, set inside n8n |
| WhatsApp API | The whatsapp-api folder | Runtime variables |
Build the website image yourself
The same build Railway runs. VITE_* values are read at build time, so they are build arguments.
docker build -t dantai-web \ --build-arg VITE_POCKETBASE_URL=https://your-pocketbase.example.com .docker run -p 3000:3000 dantai-web
Website variables
Set these as variables on the website service. They must be public https:// addresses, because the browser calls them directly.
| Variable | Value | Used for |
|---|---|---|
| VITE_POCKETBASE_URL | https://<your-pocketbase>.up.railway.app | Where the browser finds the database. Required. |
| VITE_N8N_WEBHOOK | https://<your-n8n>/webhook/smartaudit | Chat, scans and repository files. |
| VITE_N8N_IMPORT | https://<your-n8n>/webhook/import-tasks | Import tasks from a spreadsheet. |
| VITE_N8N_TICKET_CREATE | https://<your-n8n>/webhook/ticket-create | New ticket, Slack. |
| VITE_N8N_TICKET_CREATE_JIRA | https://<your-n8n>/webhook/ticket-create-jira | New ticket, Jira. |
| VITE_N8N_TICKET_CREATE_CLICKUP | https://<your-n8n>/webhook/ticket-create-clickup | New ticket, ClickUp. |
| VITE_N8N_TICKET_CLOSE | https://<your-n8n>/webhook/ticket-close | Close a ticket from a finished task. |
| VITE_N8N_SLACK_SYNC | https://<your-n8n>/webhook/slack-sync | Tickets Refresh, Slack. |
| VITE_N8N_JIRA_SYNC | https://<your-n8n>/webhook/jira-sync | Tickets Refresh, Jira. |
| VITE_N8N_CLICKUP_SYNC | https://<your-n8n>/webhook/clickup-sync | Tickets Refresh, ClickUp. |
| VITE_APP_BUILD | any label | Optional. A version label shown with bug reports. |
PocketBase variables
Runtime variables on the PocketBase service, grouped by what they switch on.
| Variable | What it is | When you need it |
|---|---|---|
| LYNX_SCAN_URL | The n8n smartaudit webhook that runs the standard scan | Always |
| LYNX_APP_URL | The public address of the website. GitHub statuses and Slack messages link back to it. | Recommended |
| LYNX_SECRETS_KEY | A long random key that encrypts saved integration tokens. If unset, one is generated and kept in pb_data, so set it to keep tokens readable on a new volume. | Recommended on Railway |
| LYNX_PLATFORM_ADMINS | Comma-separated emails of platform admins. Nobody is an admin without it. | To use the admin area |
| LYNX_GITHUB_WEBHOOK_SECRET | A long random string. Without it the GitHub webhook answers 503. | Push scans |
| LYNX_CODEMAGIC_WEBHOOK_SECRET | A long random string | Codemagic runs |
| LYNX_COMMS_SECRET | Shared with the n8n WhatsApp workflows | Inbox |
| LYNX_WHATSAPP_SEND_URL | The n8n whatsapp-comms-send webhook | Inbox replies |
| LYNX_WHATSAPP_API_URL | Where the WhatsApp API is | Search WhatsApp |
| LYNX_WHATSAPP_API_KEY | The WhatsApp API's API_KEY. They must match. | Search WhatsApp |
| LYNX_SLACK_API_URL, LYNX_TEAMS_SEND_URL | Slack and Teams send addresses | Those notifications |
| LYNX_EMAIL_SEND_URL, LYNX_EMAIL_REPLY_URL, LYNX_EMAIL_REPLY_API_KEY | Email send and reply | |
| LYNX_REMINDER_HOUR_UTC | Hour (UTC) from which due-today notices go out. Default 6. | Optional |
| LYNX_QA_SLA_HOURS, LYNX_QA_ESCALATE_HOURS, LYNX_BLOCKED_HOURS | How long before QA or a blocked task is flagged | Optional |
| LYNX_BOUNCE_ALERT, LYNX_ANTHROPIC_API | Bounce alerts and the model API address | Optional |
WhatsApp variables
| Variable | Value |
|---|---|
| WEBHOOK_URL | The n8n whatsapp-comms webhook |
| WEBHOOK_SECRET | A long random string. n8n refuses calls without it. |
| API_KEY | A long random string. Must equal LYNX_WHATSAPP_API_KEY on PocketBase. |
| CORS_ORIGIN | Optional. Only if a browser page calls the API directly. |
Public or private addresses?
| Who calls it | Use | Example |
|---|---|---|
| The browser (the VITE_* values) | The public address | https://your-n8n.up.railway.app/webhook/smartaudit |
| One service calling another (PocketBase to n8n) | Railway's private address | http://n8n.railway.internal:5678/webhook/smartaudit |
