Brierly docs
v1.0.0
Get help
● Ship

Server deployment
hosting the backend.

One Node process and one SQLite file. Small and cheap to host.

DockersystemdHTTPS

01Docker

Windows users

Flutter runs natively on Windows: use PowerShell for the flutter commands and Android builds (iOS builds need a Mac). For the server, either install Node.js 22.12+ for Windows and use PowerShell (replace cp .env.example .env with Copy-Item .env.example .env; there is no openssl by default, so use WSL or any random 64-character hex string), or run the commands in WSL 2 (Ubuntu) or Docker. macOS and Linux users can ignore this note.

cd server
cp .env.example .env     # set ADMIN_SECRET_KEY
docker build -t brierly-server .
docker run -p 8787:8787 -v brierly-data:/app/data --env-file .env brierly-server

The volume holds the databases. The image has a health check on /healthz. The Dockerfile uses Node 26 and was not run while writing this guide (no Docker used): unverified, so test it once.

02Any Node host (VPS, PM2, systemd)

  1. On the server: npm ci && npm run build.
  2. Run node dist/src/index.js with the variables from Configuration, under PM2 or a systemd unit so it restarts.
  3. Put it behind HTTPS (Caddy or nginx) and set TRUST_PROXY_HOPS=1.
  4. Check outbound access to the question source from that host (Test the source from your host).
  5. Build the app with --dart-define=API_BASE_URL=https://your-domain.
One process only

SQLite is one file on one disk. Do not run several copies of the server against the same data, and avoid hosts with no persistent disk.

03Backups

Back up the data/ folder (the SQLite files, which hold your custom questions, resolutions and audit log) and your ADMIN_SECRET_KEY. Without the key the saved store credentials cannot be decrypted; you can enter them again.

04Production security

GET /v1/config and the question list are public on purpose and hold no secret, but the server around them still needs care.

  • Use HTTPS only. The app ships no plain-http exception, and HTTPS also stops anyone changing the paywall or the question list on the way.
  • Keep the console behind HTTPS too. It carries the sign-in cookie. Turn on two-factor sign-in for every team member.
  • Rate limit at the proxy as well. The server limits /v1 to 60 requests a minute per address, but it counts in memory, so put a limit in front of it. The config answer is already sent with Cache-Control: public, max-age=300 and an ETag, the question list with max-age=60.
  • Set TRUST_PROXY_HOPS=1 behind one proxy, so limits and sign-in attempts see the real address.
  • Never leave ADMIN_DEMO_PASSWORD set on a real install.
  • Back up data/ and ADMIN_SECRET_KEY.

Example nginx server block (replace the names and certificate paths with yours):

limit_req_zone $binary_remote_addr zone=brierly:10m rate=30r/m;

server {
  listen 443 ssl http2;
  server_name api.example.com;
  ssl_certificate     /path/to/fullchain.pem;
  ssl_certificate_key /path/to/privkey.pem;

  location /v1/ {
    limit_req zone=brierly burst=20 nodelay;
    proxy_pass http://127.0.0.1:8787;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
  }
  location / {
    proxy_pass http://127.0.0.1:8787;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
  }
}

With Caddy the same setup is two lines, and certificates are automatic: api.example.com { reverse_proxy 127.0.0.1:8787 }. The nginx and Caddy examples were not run for this guide: unverified.

05Stores

The app itself is published through App Store Connect and Google Play, see Release. There is no web version.