- Frontend: Next.js 14 (App Router)
- Backend: Express.js
- Database: PostgreSQL + Prisma
- WebSocket: Socket.io
- Authentication: NextAuth.js
- Code Execution: Isolated Docker containers
- Validation: Zod
- Real-time Editor: Monaco Editor with Vim support
- JWT-based auth flow
- Social auth integration
- Session management
- Room creation/joining logic
- Challenge configuration
- Participant management
- Ready-state handling
- Integration with Gemini API
- Test case generation
- Previous challenge tracking
- Difficulty management
- Docker container management
- Test case validation
- Real-time execution
- Security sandbox
- Token purchase system
- Redemption system
- Wallet management
- User status updates
- Game state management
- Global chat
- Editor synchronization
- Rate limiting
- XSS prevention
- CSRF protection
- Input sanitization
- Secure websocket connections
- Anti-cheat measures:
- Tab focus detection
- Clipboard restrictions
- Editor sandboxing
- Frontend: Vercel
- Backend: Dedicated server
- Code Execution: Kubernetes cluster
- Database: Managed PostgreSQL
- WebSocket: Dedicated server
- Redis for caching
POST /api/auth/register
POST /api/auth/login
GET /api/auth/me
POST /api/rooms
GET /api/rooms
POST /api/rooms/:id/join
POST /api/rooms/:id/ready
POST /api/rooms/:id/start
POST /api/challenges/:id/submit
GET /api/challenges/:id/status
GET /api/challenges
POST /api/tokens/purchase
POST /api/tokens/redeem
GET /api/tokens/balance
GET /api/users/leaderboard
PUT /api/users/preferences
GET /api/users/history