Server deployment
hosting the optional backend.
One Node process and one SQLite file. Small and cheap to host.
01Docker
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 textguard-server .
docker run -p 8787:8787 -v textguard-data:/app/data --env-file .env textguard-server
The volume holds the databases. The image has a health check on /healthz. Build and run it once on your own machine before you rely on it.
02Any Node host (VPS, PM2, systemd)
- On the server:
npm ci && npm run build. - Run
node dist/src/index.jswith the variables from Configuration, under PM2 or a systemd unit so it restarts. - Put it behind HTTPS (Caddy or nginx) and set
TRUST_PROXY_HOPS=1. - Build the app with
--dart-define=API_BASE_URL=https://your-domain.
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) 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 is public on purpose and holds no secret, but the server around it still needs care.
- Use HTTPS only. Android 9 and newer and iOS refuse plain http by default, and this app ships no exception, so a config address that is not https never loads on a phone. HTTPS also stops anyone changing the paywall or the verdict rules 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
/v1to 60 requests a minute per address, but it counts in memory, so put a limit in front of it and cache the config answer for a few minutes. The server already sendsCache-Control: public, max-age=300and an ETag. - Set
TRUST_PROXY_HOPS=1behind one proxy, so limits and sign-in attempts see the real address. - Back up
data/andADMIN_SECRET_KEY.
Example nginx server block (replace the names and certificate paths with yours):
limit_req_zone $binary_remote_addr zone=textguard:10m rate=30r/m;
proxy_cache_path /var/cache/nginx/textguard keys_zone=textguard_cfg:1m max_size=10m inactive=10m;
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=textguard 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 }. Add a rate-limit module if you need a limit at the proxy.
05Stores
The app itself is published through App Store Connect and Google Play, see Release. There is no web version.