Live: starcendence.dev
ft_transcendence is a full-stack, real-time multiplayer gaming platform developed as part of the 42 curriculum. The project focuses on low-latency gameplay, microservices architecture, and modern web technologies.
The platform includes:
- A 3D Pong game built with Babylon.js
- A Star Wars Pod Racingโinspired racing game
- Real-time multiplayer using WebSockets
- Live chat, tournaments, AI opponents, and user profiles
- Secure authentication with OAuth and 2FA
- A containerized microservices backend
The system is designed to be scalable, modular, and fault-tolerant, mirroring real-world production architectures.
- โก Fastify Backend - High-performance server framework
- ๐๏ธ Backend as Microservices - Distributed architecture
- ๐ค Standard User Management - Auth + profiles + friends
- ๐ Google Sign-in - OAuth integration
- ๐ Remote Players - WebSocket multiplayer
- ๐๏ธ Star Wars Racer + Matchmaking - Second game with pairing
- ๐ฌ Live Chat - Real-time messaging
- ๐ค AI Opponent - Intelligent computer players
- ๐ 2FA + JWT - Advanced security
- ๐ Advanced 3D Babylon.js - 3D graphics engine
- ๐จ Tailwind CSS - Styling framework
- ๐พ SQLite Database - Data persistence
- โ๏ธ Game Customization - Power-ups and variations
- ๐ Stats Dashboards - User analytics
- ๐ฑ All Devices Support - Responsive design
- ๐ Browser Compatibility - Firefox + Chrome
- ๐ Prometheus/Grafana - System monitoring
Frontend (TypeScript + Tailwind + Babylon.js)
โ
API Gateway (Nginx)
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Microservices โ
โโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโค
โ Auth โ Game โ Chat โ User โWebSocketโ
โ :3001 โ :3002 โ :3003 โ :3004 โ :3005 โ
โโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Infrastructure Services โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Redis โ SQLite โ
โ (Cache+PubSub) โ (Persistent) โ
โ :6379 โ File โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
frontend/ UI and games
services/ Backend microservices
shared/ Shared types and utils
infrastructure/ Redis, database, monitoring
- TypeScript: Type-safe development
- Vite: Fast build tool and dev server
- Tailwind CSS: Utility-first styling framework
- Babylon.js: 3D graphics engine for games
- Fastify: High-performance Node.js web framework
- SQLite: Lightweight, reliable database
- Redis: In-memory cache and message broker
- JWT: Secure authentication tokens
- Docker: Containerized development and deployment
- Nginx: Reverse proxy and SSL termination
- Prometheus + Grafana: Monitoring and observability
nginx:80/443 โ API Gateway + SSL termination
frontend:3000 โ Vite dev server / Static files
auth-service:3001 โ JWT, 2FA, Google OAuth, Sessions
game-service:3002 โ Game engines, AI, Physics, Tournaments
chat-service:3003 โ Real-time messaging, Chat rooms
user-service:3004 โ Profiles, Friends, Stats, Avatars
websocket-service:3005 โ Real-time events, Broadcasting
redis:6379 โ Cache + PubSub messaging
sqlite:file โ Persistent data storage
prometheus:9090 โ Metrics collection
grafana:3010 โ Monitoring dashboards
/auth/* โ auth-service:3001
/games/* โ game-service:3002
/chat/* โ chat-service:3003
/users/* โ user-service:3004
/ws โ websocket-service:3005
/metrics โ prometheus:9090
/grafana/* โ grafana:3010
Redis Pub/Sub is used only between Game Service and WebSocket Service.
Lobby Events:
- lobby:create
- lobby:invite
- lobby:join
- lobby:leave
- lobby:kick
- lobby:ready
- lobby:start
- lobby:chat
- lobby:player:update
- lobby:quick-play
Game Events:
- game:move
- game:action
- game:pause
- game:resume
- game:end
- game:input
- game:ready
- game:start
- game:leave
- game:state
- game:event
HIGH LATENCY (Login/Setup - 80-200ms):
Frontend โ game-service โ auth-service (validate token)
โ user-service (get profile)
โ chat-service (join channel)
LOW LATENCY (Gameplay - 6-20ms):
Frontend โ websocket โ game-service (cached validation)
โ broadcast (local state)
- Server-authoritative physics (paddle movement, ball collision)
- Real-time multiplayer with lag compensation
- AI opponents with adaptive difficulty
- Tournament system with bracket management
- Ultra-low latency validation (< 1ms per input)
- Complex physics simulation (vehicle dynamics)
- Track boundary enforcement
- Advanced collision detection
- WebSocket connections for 60fps gameplay
- Redis PubSub for event broadcasting
- Cached player data for instant validation
- Cross-service communication optimized for gaming
- Auth: JWT + 2FA + Google OAuth + Session management
- Live Chat: Real-time messaging, Game invitations, User presence
- Monitoring: Prometheus metrics + Grafana dashboards + Performance tracking
โ
Independent Scaling:
- Game service: CPU-intensive (3D physics)
- Chat service: I/O-intensive (messaging)
- Auth service: Security-focused (encryption)
โ
Fault Isolation:
- If chat crashes โ games continue
- If auth is slow โ games use cached tokens
- Database separation prevents cascade failures
โ
Development Efficiency:
- Teams work independently on services
- Deploy services without downtime
- Technology flexibility per service
โ
Gaming-Specific Optimizations:
- Game service: Optimized for low-latency
- Chat service: Optimized for high-throughput
- User service: Optimized for complex queries
![]() hluiz-ma |
![]() jpedro-c |
![]() rafaelfe |
![]() jmeirele |



