# Architecture Overview

## Philosophy
- No Docker/Kubernetes — direct VPS deployment with PM2
- No AWS S3 — local filesystem + CDN (BunnyCDN/R2)
- No external KYC — custom internal form with admin review
- No Cloudflare — direct DNS + Let's Encrypt + Nginx
- Web-only — responsive design, no mobile app

## Layers

### Client
- Next.js 14 App Router
- React + Tailwind CSS
- Redux Toolkit state management
- Socket.io client for real-time metrics

### Edge
- Nginx reverse proxy
- Let's Encrypt SSL
- Static asset serving

### API
- NestJS (Node.js)
- REST API + WebSocket gateway
- JWT authentication + 2FA
- Role-based access control

### Data
- PostgreSQL 16 (primary data)
- Redis 7 (sessions, pub/sub, queues)
- Local filesystem (uploads, synced to CDN)

### External
- YouTube Live API (streaming)
- Stripe, PayPal, Google Pay (payments)
- SendGrid (email), Twilio (SMS/2FA)