🏛️ Platform Architecture#
Tech Stack#
|| Layer | Technology | Purpose | |:——|:———–|:——–| | Frontend | SvelteKit 2 + Tailwind 4 + DaisyUI 5 | Web UI, game lobby, matchmaking | | Backend | Nakama 3.32.0 (Go modules) | Auth, matchmaking, leaderboards, game state | | Orchestration | K3s + Agones | Container orchestration, game server scaling | | Proxy | Nginx → Traefik | TLS termination, routing, WebSocket upgrade | | Database | PostgreSQL 15.6+ | Primary game data storage | | Cache | Redis 7.2+ | Session caching, game state | | Monitoring | Grafana + Prometheus | Metrics, alerts, dashboards | | Docs | Hugo (Book theme) | This documentation site | | AI Agents | Hermes (OpenRouter) + Antigravity | Development assistance, automation |
Nakama Configuration#
Deployment Details#
- Replicas: 1 (production), 3 (development)
- Resource Allocation: 2Gi CPU limit, 1Gi minimum
- Health Checks:
/healthcheckendpoint at port 7350 - Metrics: Prometheus on port 9100
- Runtime Path:
/nakama/data/modules - Game Modules: Host-mounted from
/home/usr/funday/games
Critical Configuration#
🔒 Secret values are intentionally NOT documented here. This page is reachable at the publicly-routed
funday.gg/dev/docs/. Encryption keys, console credentials, server/runtime keys, DB passwords and API keys live only in the Nakama K8s Secret/ConfigMap (gitops/apps/nakama-config.yaml, namespacefunday-platform) and the frontend server-side.env. Never paste secret values into docs — reference the setting name and its location instead.
| Setting | Where it lives | Frontend env var |
|---|---|---|
| Database connection | Nakama database.address (K8s Secret) → postgres.postgresql.svc.cluster.local:5432/nakama | — |
| Session / refresh encryption keys | Nakama session.encryption_key, session.refresh_encryption_key | — |
| Console access | Nakama console.username / password / signing_key | NAKAMA_CONSOLE_USER / NAKAMA_CONSOLE_PASS |
| Socket server key | Nakama socket.server_key | — |
| Runtime HTTP key | Nakama runtime.http_key | NAKAMA_HTTP_KEY |
| OpenRouter API key | Frontend .env | OPENROUTER_API_KEY |
Token lifetimes: access token 24h (token_expiry_sec: 86400), refresh token 7d (refresh_token_expiry_sec: 604800).
Network Topology#
Internet → Nginx (:443)
├── / → SvelteKit (:3000)
├── /dev/docs → Hugo (:1313)
├── /ws, /v2 → Traefik (:32443) → Nakama
├── /console → Traefik → Nakama Console
├── /grafana → Traefik → Grafana
└── /agar, etc → Traefik → Game podsServer#
- Host:
funday.gg(213.136.90.143) - OS: Debian 13 (Trixie)
- Hardware: Beefy CPU, lots of RAM, no GPU