Features - Payment reminders via Resend (candidates, send, history, test email) - Bulk import of the customer list from Excel/CSV in the dashboard - Dashboard i18n (en/nl) with language selector Security - Enforce venue isolation on all /venues/:venueId routes - Require admin for planned-tab changes and pairing codes - Rate-limit login and device registration; opt-in TRUST_PROXY - Require JWT_SECRET in production; stop leaking internal errors - Escape customer names in reminder emails Sync and commands - Remove tabs the terminal no longer reports; validate nested sync payload - Return all pending commands on every sync (fixes missed-command race) - First command ack wins; atomic registration code claim - Reject commands for revoked devices, stale versions or duplicates - Remind only unpaid balances, with a 7-day cooldown Dashboard - Share a single token refresh across concurrent 401s (random logouts) - Keep the session alive for the refresh token lifetime Deployment - Replace `db push --accept-data-loss` with migrations (baselines legacy DBs) - Set NODE_ENV=production; pass Resend and TRUST_PROXY env in prod compose
68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: kooltab
|
|
POSTGRES_USER: kooltab
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U kooltab"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- kooltab-net
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: api
|
|
ports:
|
|
- "${API_PORT:-3001}:3001"
|
|
environment:
|
|
DATABASE_URL: "postgresql://kooltab:${DB_PASSWORD:-changeme}@postgres:5432/kooltab"
|
|
JWT_SECRET: "${JWT_SECRET}"
|
|
JWT_REFRESH_SECRET: "${JWT_REFRESH_SECRET}"
|
|
PORT: 3001
|
|
CORS_ORIGIN: "${DASHBOARD_URL:-http://localhost:3000}"
|
|
RESEND_API_KEY: "${RESEND_API_KEY:-}"
|
|
RESEND_FROM_EMAIL: "${RESEND_FROM_EMAIL:-KoolTab <onboarding@resend.dev>}"
|
|
# The API sits behind a reverse proxy: trust one hop of X-Forwarded-For for per-client rate limiting
|
|
TRUST_PROXY: "${TRUST_PROXY:-1}"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
networks:
|
|
- kooltab-net
|
|
- scoobydoo
|
|
|
|
dashboard:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: dashboard
|
|
args:
|
|
NEXT_PUBLIC_API_URL: "${API_URL:-http://localhost:3001}/api/v1"
|
|
ports:
|
|
- "${DASHBOARD_PORT:-3000}:3000"
|
|
depends_on:
|
|
- api
|
|
restart: unless-stopped
|
|
networks:
|
|
- kooltab-net
|
|
- scoobydoo
|
|
|
|
volumes:
|
|
pgdata:
|
|
|
|
networks:
|
|
kooltab-net:
|
|
driver: bridge
|
|
scoobydoo:
|
|
external: true |