Appearance
Environments & URLs
A reference for ports, the routes worth knowing, and the environment variables the platform reads.
Local ports
| App | Path | Port |
|---|---|---|
| Player site | apps/web | 3000 |
| Admin | apps/admin | 3001 |
| Support | apps/support | 3002 |
| API (Hono) | apps/api | 8787 |
Workers — realtime (default dev / start) | apps/workers | 8792 |
| Workers — analytics | apps/workers (dev:analytics) | 8789 |
| Workers — notifier | apps/workers (dev:notifier) | 8790 |
| Workers — customerio | apps/workers (dev:customerio) | 8791 |
| Docs | apps/docs | 3003 |
Transactional email is sent by apps/api in-process via EMAIL_PROVIDER (Resend, MailerSend, or UniOne). The workers package default process is the realtime worker (private_state_outbox + realtime_event_outbox → Redis fan-out for wallet, support, withdrawal, and notification pushes).
Environment variables
The full list lives in .env.example. The ones that matter most for a working local stack:
DATABASE_URL— PostgreSQL connection string.REDIS_URL— Redis for WebSocket tickets and pub/sub fan-out (required for live realtime pushes).AUTH_SECRET— stable Auth.js session encryption secret; keep it unchanged across restarts, replicas, and normal deployments.AUTH_SECRET_PREVIOUS— optional old Auth.js secret used for a 30-day zero-downtime rotation window; new sessions always useAUTH_SECRET.NEXTAUTH_URL— usuallyhttp://localhost:3000.NEXT_PUBLIC_API_URL— usuallyhttp://localhost:8787.WALLET_ENCRYPTION_KEY— encryption for wallet data.REALTIME_*— optional realtime worker tuning (REALTIME_PORTdefaults to 8792).
Payment and email integrations add their own keys (CRYPTOCLOUD_* during migration, PAYOU_*, EMAIL_PROVIDER, RESEND_API_KEY, MAILERSEND_API_KEY, UNIONE_API_KEY). Hosted RUB providers and CryptoCloud prefer encrypted rows in payment_provider_configs; set PAYMENT_PROVIDER_CREDENTIAL_ENCRYPTION_KEY on both API and admin. Import existing CryptoCloud env credentials with apps/api/src/scripts/migrate-cryptocloud-env-to-db.ts --apply (env remains a temporary fallback until then). Customer.io Classic Track credentials (CUSTOMERIO_SITE_ID, CUSTOMERIO_TRACK_API_KEY) enable the CRM event worker. Transactional email is sent in-process by the API via EMAIL_PROVIDER (Resend, MailerSend, or UniOne). Keep real secrets in .env and out of the repo.
API surface
The Hono API groups its routes by domain. These are the prefixes you will see most often:
| Prefix | Area |
|---|---|
/user/* | Profile, sessions, password, 2FA |
/wallet/* | Balances, deposits, withdrawals, addresses, tips, bonuses |
/realtime/* | Private WebSocket ticket + connect (live balance) |
/game/* | Catalog, sessions, favorites, recently played |
/platform/* | Provider callbacks for bets, wins, and free rounds |
/payments/* | Payou fiat payments |
/webhook/* | CryptoCloud deposit postbacks |
/vip/* | VIP status, bonuses, rakeback |
/support/* | Player support conversations (HTTP; realtime via WebSocket) |
/notifications/* | In-app notification inbox |
Admin actions are served by the admin app itself under /api/admin/*, each guarded by a permission. The access model explains how that guard works.