A comprehensive web application featuring a multiplayer Pong game with real-time chat, user management, and social features. Built with a microservices architecture using Django, WebSockets, and deployed on Kubernetes (K3s).
This application follows a microservices architecture orchestrated by K3s:
- Frontend: Modern SPA using Vanilla JavaScript, Vite, and Three.js for 3D rendering.
- Login Service: JWT-based authentication with OAuth2 support.
- Chat Service: Real-time messaging with WebSocket connections.
- User Service: User profiles, friends, and social features.
- Pong Service: Multiplayer Pong game engine.
- Notification Service: Real-time notifications across the platform.
- Documentation Service: Centralized API documentation.
- Infrastructure: Helm Charts for deployment, Traefik as Ingress Controller.
- Monitoring: Grafana and Prometheus for observability.
- Real-time Multiplayer: Low-latency matches via WebSockets.
- 3D Graphics: Immersive experience powered by Three.js.
- Game Modes:
- Local: Practice against AI or another player locally.
- Online: Matchmaking against other users.
- Tournament: Organized brackets and competitions.
- Customization: Paddle skins, ball colors, and game speed settings.
- JWT Token Authentication: Secure session management.
- OAuth2 Integration: Login with 42 Intra.
- Two-Factor Authentication (2FA): Enhanced account security.
- Session Management: Automatic token refresh and validation.
- Global Chat: Community discussions.
- Private Messages: Direct messaging between friends.
- Group Chats: Create channels and invite users.
- Features: User blocking, online status indicators, and game invites.
- Statistics: Win/Loss ratio, match history, and performance graphs.
- Social: Friend requests, block lists, and online status.
- Avatars: Upload custom profile pictures.
- Real-time Alerts: Instant updates for game invites, messages, and friend requests.
- History: Review past notifications.
- Linux Environment (Ubuntu 20.04+ recommended)
- Docker (for container building)
- Utilities:
git,curl
The project includes a comprehensive script (start-k3s.sh) that sets up the entire K3s cluster, installs Helm dependencies, and deploys the application.
-
Clone the repository
git clone https://github.com/your-repo/Transcendence.git cd Transcendence -
Run the Setup Script
chmod +x start-k3s.sh ./start-k3s.sh
This script will:
- Install K3s, Kubectl, and Helm (if missing).
- Deploy the monitoring stack (Grafana/Prometheus).
- Build and deploy the microservices.
- Configure local DNS in
/etc/hosts.
-
Access the Application
- Frontend: https://localhost/#login
- Grafana: https://grafana.trascendence.local (Default:
admin/admin123) - API Docs:
http://localhost:8005(Swagger/ReDoc)
Transcendence/
├── Back-End/ # Django Microservices
│ ├── login/ # Authentication Service
│ ├── chat/ # Chat Service
│ ├── task_user/ # User & Social Service (Friends, Profiles)
│ ├── Notifications/ # Notification Service
│ ├── pongProject/ # Game Service
│ └── api-docs/ # API Documentation Service
├── Front-End/ # Vite + Three.js Application
├── helm-charts/ # Kubernetes Helm Charts
├── Manifests/ # K8s Manifests (CRDs, etc.)
├── scripts/ # Utility scripts
└── start-k3s.sh # Main Deployment Script
POST /api/auth/login/- User loginPOST /api/auth/register/- User registrationGET /api/auth/user/- Get user info
GET /api/chat/rooms/- List chat roomsPOST /api/chat/messages/- Send message
GET /api/users/profile/- Get user profilePOST /api/friends/add/- Send friend request
POST /api/pong/games/- Create gameGET /api/pong/games/{id}/- Get game state
- AI Difficulty Levels: varied machine learning models for opponents.
- Mobile Support: Touch controls and responsive layout.
- Voice Chat: Integrated WebRTC voice communication.
- Advanced Analytics: Heatmaps and detailed gameplay stats.
Developed by 42 Firenze Students