A full-stack real-time multiplayer Pong game with AI opponents, tournaments, live chat, and user management system.
ft_transcendence is the final project of the 42 School Common Core curriculum. This project requires building a comprehensive web application using unfamiliar technologies, focusing on adaptability and problem-solving.
This implementation features:
- Server-side Pong game with authoritative game logic
- Microservices architecture (user-service, pingpong-service, livechat-service)
- Real-time multiplayer via WebSockets
- AI opponent with prediction algorithms
- Tournament system with bracket management
- Live chat with game invitations
- OAuth 2.0 authentication (Google)
- Two-Factor Authentication (2FA)
- ELK Stack for logging (Elasticsearch, Logstash, Kibana)
Frontend: TypeScript, Tailwind CSS, Vite
Backend: Node.js, Fastify, Prisma, SQLite
Infrastructure: Docker, Nginx, WebSocket, JWT
- Docker (20.10+)
- Docker Compose (v2.0+)
- Make
-
Clone the repository
git clone https://github.com/your-username/fttranscendence.git cd fttranscendence -
Create
.envfileA
.envfile is required in the project root. This file contains environment variables including:- Application ports
- JWT secrets
- Google OAuth credentials (required for OAuth login)
- Database paths
- ELK Stack passwords
Note: The
.envfile is not included in the repository for security reasons. You must create it manually. -
Start the application
make up
This will:
- Generate SSL certificates
- Build Docker containers
- Start all microservices
- Initialize databases
-
Access the application
- Frontend: https://localhost:3000
- Kibana (Logs): http://localhost:5601
make up # Start all services
make down # Stop all services
make re # Restart all services
make clean # Remove all Docker resourcesNginx (Reverse Proxy)
│
├── Frontend (SPA)
│
└── API Gateway
├── User Service (Authentication, Profiles, Friends)
├── PingPong Service (Game Engine, Tournaments, AI)
└── LiveChat Service (Messaging, Invitations)
Each service has its own SQLite database. All services communicate via HTTPS and are monitored by the ELK Stack.
- User registration and login
- Google OAuth 2.0 authentication
- Two-Factor Authentication (2FA) with TOTP
- User profiles with avatars
- Friend system with online status
- Match history and statistics
- Real-time multiplayer Pong via WebSocket
- Server-side game logic (anti-cheat)
- AI opponent with adjustable difficulty
- Local multiplayer (same keyboard)
- Create tournaments with 4, 8, or 16 players
- Automatic bracket generation
- Real-time match notifications
- Tournament statistics
- Direct messaging between users
- Game invitations via chat
- Block/unblock users
- Online status indicators
This project implements 11 major module equivalents (7 required for completion):
Major Modules (10):
- Backend Framework (Fastify + Node.js)
- Standard User Management
- Remote Authentication (OAuth 2.0)
- Remote Players (WebSocket)
- Live Chat
- Two-Factor Authentication + JWT
- ELK Stack Integration
- Microservices Architecture
- Server-Side Pong with API
- AI Opponent
Minor Modules (2 = 1 Major):
- Frontend Framework (Tailwind CSS)
- Database (SQLite + Prisma)
ft_transcendence/
├── frontend/ # TypeScript SPA with Tailwind CSS
├── user-service/ # User management microservice
├── pingpong-service/ # Game engine microservice
├── livechat-service/ # Chat microservice
├── gateway/ # API Gateway
├── reverse-proxy/ # Nginx configuration
├── elk/ # ELK Stack setup
│ ├── elasticsearch/
│ ├── kibana/
│ └── logstash/
├── docker-compose.yml
├── Makefile
└── .env # Required (not in repository)
- HTTPS with TLS encryption
- Password hashing with bcrypt
- JWT authentication (RS256)
- Two-Factor Authentication (2FA)
- SQL injection prevention
- XSS protection
- Rate limiting
- CORS configuration
This project is part of the 42 School curriculum.