Portfolio project
betplatform
A backend-focused sports betting API demonstrating production patterns: JWT auth, WebSockets, Redis caching, PostgreSQL, and responsible gambling compliance.
Backend features
JWT auth with refresh token rotation
Access tokens (15 min) + revocable server-side refresh tokens (7 days)
Cloudflare Worker geoblocking
Edge-level country filtering before traffic reaches the API
WebSocket real-time odds feed
Authenticated WS connection with 3-second push updates and flash UI
Responsible gambling enforcement
4-hour session timeout, self-exclusion, deposit limits with cooling-off
Immutable audit log
Every auth and gambling event written to PostgreSQL with IP and metadata
Redis session cache
Fast session reads with PostgreSQL fallback for durability
Architecture
apps/api — Fastify · PostgreSQL · Redis · Railway
apps/web — Next.js 15 · Tailwind · Vercel
cloudflare/geo-worker — Cloudflare Workers edge geoblocking
packages/types — shared TypeScript interfaces