Dantai/ DocsOpen app
10 min read

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

ServicePortWhat it doesHow it runs
Web app8080The site you open in the browserLocally: npm run dev. Railway: the Dockerfile.
PocketBase8090Database, sign-in and the server-side hooksDocker
n8n5678Scans, ticket and chat webhooksDocker
WhatsApp API3102Links one WhatsApp number for the Inbox (optional)Docker
Agent runnernoneRuns 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.

1. Start the backend
docker compose up -ddocker compose ps

2. Start the web app

In its own terminal, from the repository root. Opens at http://localhost:8080.

2. Start the web app
npm run dev

3. Follow the backend logs

Useful when a webhook or scan does nothing.

3. Follow the backend logs
docker compose logs -f pocketbase n8n

The first time, or after a schema change, apply the collections and rules. This needs a PocketBase superuser:

PowerShell
$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

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.

FileUsed byIn git?
.env.exampleA template to copy from. Holds no real values.Yes
.env.localnpm run dev. Your overrides, such as webhook addresses.No
.env.livenpm run dev:live. Runs the site here against the live database.Yes (a public address, not a secret)
pocketbase/.envdocker compose. Webhook secrets and service addresses.No
whatsapp-api/.envThe 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.

Start your own overrides
cp .env.example .env.local

Run against the live database

Reads .env.live. Nothing else changes.

Run against the live database
npm run dev:live

Deploy on Railway

Railway runs several services. Each has its own variables, so set them on the right one.

ServiceBuilt fromVariables are
WebsiteThe Dockerfile in this repositoryBuild variables (VITE_*), baked into the page
PocketBaseghcr.io/muchobien/pocketbaseRuntime variables (LYNX_*)
n8ndocker.n8n.io/n8nio/n8nIts own credentials, set inside n8n
WhatsApp APIThe whatsapp-api folderRuntime variables

Build the website image yourself

The same build Railway runs. VITE_* values are read at build time, so they are build arguments.

Build the website image yourself
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.

VariableValueUsed for
VITE_POCKETBASE_URLhttps://<your-pocketbase>.up.railway.appWhere the browser finds the database. Required.
VITE_N8N_WEBHOOKhttps://<your-n8n>/webhook/smartauditChat, scans and repository files.
VITE_N8N_IMPORThttps://<your-n8n>/webhook/import-tasksImport tasks from a spreadsheet.
VITE_N8N_TICKET_CREATEhttps://<your-n8n>/webhook/ticket-createNew ticket, Slack.
VITE_N8N_TICKET_CREATE_JIRAhttps://<your-n8n>/webhook/ticket-create-jiraNew ticket, Jira.
VITE_N8N_TICKET_CREATE_CLICKUPhttps://<your-n8n>/webhook/ticket-create-clickupNew ticket, ClickUp.
VITE_N8N_TICKET_CLOSEhttps://<your-n8n>/webhook/ticket-closeClose a ticket from a finished task.
VITE_N8N_SLACK_SYNChttps://<your-n8n>/webhook/slack-syncTickets Refresh, Slack.
VITE_N8N_JIRA_SYNChttps://<your-n8n>/webhook/jira-syncTickets Refresh, Jira.
VITE_N8N_CLICKUP_SYNChttps://<your-n8n>/webhook/clickup-syncTickets Refresh, ClickUp.
VITE_APP_BUILDany labelOptional. A version label shown with bug reports.

PocketBase variables

Runtime variables on the PocketBase service, grouped by what they switch on.

VariableWhat it isWhen you need it
LYNX_SCAN_URLThe n8n smartaudit webhook that runs the standard scanAlways
LYNX_APP_URLThe public address of the website. GitHub statuses and Slack messages link back to it.Recommended
LYNX_SECRETS_KEYA 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_ADMINSComma-separated emails of platform admins. Nobody is an admin without it.To use the admin area
LYNX_GITHUB_WEBHOOK_SECRETA long random string. Without it the GitHub webhook answers 503.Push scans
LYNX_CODEMAGIC_WEBHOOK_SECRETA long random stringCodemagic runs
LYNX_COMMS_SECRETShared with the n8n WhatsApp workflowsInbox
LYNX_WHATSAPP_SEND_URLThe n8n whatsapp-comms-send webhookInbox replies
LYNX_WHATSAPP_API_URLWhere the WhatsApp API isSearch WhatsApp
LYNX_WHATSAPP_API_KEYThe WhatsApp API's API_KEY. They must match.Search WhatsApp
LYNX_SLACK_API_URL, LYNX_TEAMS_SEND_URLSlack and Teams send addressesThose notifications
LYNX_EMAIL_SEND_URL, LYNX_EMAIL_REPLY_URL, LYNX_EMAIL_REPLY_API_KEYEmail send and replyEmail
LYNX_REMINDER_HOUR_UTCHour (UTC) from which due-today notices go out. Default 6.Optional
LYNX_QA_SLA_HOURS, LYNX_QA_ESCALATE_HOURS, LYNX_BLOCKED_HOURSHow long before QA or a blocked task is flaggedOptional
LYNX_BOUNCE_ALERT, LYNX_ANTHROPIC_APIBounce alerts and the model API addressOptional

WhatsApp variables

VariableValue
WEBHOOK_URLThe n8n whatsapp-comms webhook
WEBHOOK_SECRETA long random string. n8n refuses calls without it.
API_KEYA long random string. Must equal LYNX_WHATSAPP_API_KEY on PocketBase.
CORS_ORIGINOptional. Only if a browser page calls the API directly.

Public or private addresses?

Who calls itUseExample
The browser (the VITE_* values)The public addresshttps://your-n8n.up.railway.app/webhook/smartaudit
One service calling another (PocketBase to n8n)Railway's private addresshttp://n8n.railway.internal:5678/webhook/smartaudit

Where next