- Table of Contents
- Overview
- Team Members
- Project Management
- Features
- Technologies Used
- Database Schema
- Implemented Modules
- Project Structure
- Getting Started
- Contributing
- License
- Acknowledgments
ft_transcendence a comprehensive, real-time web application that brings the classic Pong experience into the modern era. Designed with a focus on concurrency, scalability, and user experience, this platform is more than just a game; it's a full-featured social ecosystem.
The project integrates real-time WebSockets for instantaneous gameplay and chat, secure authentication with 2FA, and a comprehensive monitoring stack to ensure 99.9% uptime and performance reliability.
| Name | GitHub | Role | Responsibilities |
|---|---|---|---|
| Mustapha Elfersioui | @BL4KCY | Project Manager / DevOps | Infrastructure, Monitoring (ELK/Grafana), Docker, Project Coordination |
| Aziz Elkhetabi | @Aziz018 | Product Owner / Backend | Database Design, API Architecture, Social Hub Logic |
| Hamza Mouhib | @itsLhaj | Backend Team Lead | Security (JWT/2FA), Core Backend Logic, API Documentation |
| Hamza Barda | @N308-ui | Backend / Game | Real-time Game Engine, WebSocket Synchronization, Matchmaking |
| Ibnoukhalkane Zakaria | @Ibnoukhalkanezakaria | Frontend Developer | UI/UX Design, React Architecture, State Management, Styling |
Our team adopted an Agile-inspired approach to manage the development of Pong Rush.
- Tools:
- Notion: Centralized task board for tracking features, bugs, and documentation.
- Discord: Daily sync-ups and real-time troubleshooting.
- Workflow:
- Branching Strategy: Strict
feature/branch model. No direct commits todevormaster. - Code Reviews: Every Pull Request required a peer review to maintain code quality.
- Automation: Dockerized environments ensured seamless integration between front-end and back-end modules.
- Branching Strategy: Strict
๐ฎ The Arena (Core Gameplay) - Implemented by @N308-ui
- Real-time Multiplayer: Low-latency Pong matches powered by WebSockets.
- Dual Mode Support:
- Local Play: Battle friends on the same machine.
- Remote Play: Matchmaking system for global challenges.
- AI Contender: An intelligent bot system for solo practice and skill-building.
- Live Game Synchronization: Seamless state management across all connected clients.
๐ฌ Social Hub (Chat & Community) - Implemented by @Aziz018
- Dynamic Chat Rooms: Create, join, and manage public or password-protected channels.
- Direct Messaging (DMs): Private, secure communication between users.
- Moderation Tools: Admin capabilities including kicking, banning, and promoting members.
- Live Status Tracking: Real-time "Online/Offline/In-Game" status indicators.
- Friend System: Manage relationships, block intruders, and invite friends to matches.
๐ Security & Identity - Implemented by @itsLhaj
-
Multi-Strategy Auth: Support for traditional credentials and OAuth2 (42 & Google).
-
Advanced Protection:
- Two-Factor Authentication (2FA): Google Authenticator integration for account security.
- JWT Security: Secure token-based sessions with refresh rotation.
-
Profile Customization: Personalize your presence with avatars and unique handles.
-
Database Reliability: Type-safe interactions using Prisma ORM.
-
Scalar Interactive Docs: Sleek, modern API documentation accessible at /docs.
๐ Engine & Orchestration - Implemented by @BL4KCY
- Observation Stack:
- ELK Stack: Centralized logging for debugging and audit trails.
- Prometheus & Grafana: Real-time performance metrics and visual dashboards.
- Dockerized Environment: Fully containerized services for consistent "one-command" deployment.
| Technology | Justification |
|---|---|
| Fastify | Chosen for its high performance and low overhead, essential for handling high-concurrency WebSocket connections. |
| TypeScript | Ensures type safety across the stack, reducing runtime errors and improving developer productivity. |
| React | Provides a robust component-based architecture for building a dynamic and responsive game UI. |
| Prisma ORM | Offers type-safe database queries and automated migrations, ensuring data consistency with SQLite. |
| WebSockets | Critical for the real-time bidirectional communication required for real-time multiplayer gameplay. |
| Docker | Simplifies deployment and ensures environment parity between development and production. |
| ELK Stack | Provides centralized logging for observability and efficient debugging of system events. |
Our data model is designed to handle complex social interactions and real-time game state tracking.
- User: Manages authentication, profile data, and XP/stats.
- Room & Message: Handles both direct messages and multi-user group chats.
- Friendships & Requests: Manages the social graph and blocked users.
- Match: Records match history, scores, and winners for the leaderboard.
erDiagram
USER ||--o{ MATCH : plays
USER ||--o{ FRIENDSHIP : has
USER ||--o{ ROOM_MEMBER : joins
ROOM ||--o{ ROOM_MEMBER : contains
ROOM ||--o{ MESSAGE : contains
USER ||--o{ MESSAGE : sends
This project satisfies the requirement of 42 Transcendence by implementing several major and minor modules, totaling 27.0 points.
| Module | Type | Value | Justification |
|---|---|---|---|
| Frameworks | Major | 2.0 | Used Fastify for the backend and React for the frontend to build a high-performance SPA. |
| Real-time features | Major | 2.0 | Integrated WebSockets for live game state updates and instant chat messaging. |
| User Interactions | Major | 2.0 | Implemented a social graph with Chat, Profiles, and a Friend system. |
| Use an ORM | Minor | 1.0 | Utilized Prisma ORM for type-safe database interactions and schema management. |
| Module | Type | Value | Justification |
|---|---|---|---|
| Standard Management | Major | 2.0 | Full user lifecycle management: registration, profile editing, and friend status. |
| Remote Auth | Minor | 1.0 | Support for OAuth 2.0 (Google and 42) for secure, third-party authentication. |
| 2FA System | Minor | 1.0 | Enhanced security with Two-Factor Authentication via Google Authenticator. |
| Game Stats | Minor | 1.0 | Real-time tracking of Wins/Losses, XP, and global Leaderboard rankings. |
| Module | Type | Value | Justification |
|---|---|---|---|
| Web-based Game | Major | 2.0 | A custom real-time Pong game implemented with modern canvas API and logic. |
| Remote Players | Major | 2.0 | Matchmaking system allowing two players to compete from different machines. |
| AI Opponent | Major | 2.0 | Developed a challenging AI bot that simulates human movements for solo play. |
| Module | Type | Value | Justification |
|---|---|---|---|
| ELK Stack | Major | 2.0 | Centralized logging using Elasticsearch, Logstash, and Kibana for system auditing. |
| Prometheus/Grafana | Major | 2.0 | Real-time monitoring of service health and resource usage with custom dashboards. |
| Public API | Major | 2.0 | Secured API with documentation (Scalar) and rate-limiting for third-party access. |
| Notification System | Minor | 1.0 | Real-time in-app notifications for friend requests and game invites. |
| Custom Design | Minor | 1.0 | Built a cohesive, custom-made design system with reusable components and consistent styling. |
| Health Check | Minor | 1.0 | Implemented status pages and health endpoints for all microservices. |
โฏ 48 directories, 35 files
.
โโโ assets
โ โโโ cover.png
โโโ backend
โ โโโ Dockerfile
โ โโโ ecosystem.config.cjs
โ โโโ ecosystem.config.js
โ โโโ filebeat.yml
โ โโโ nodemon.json
โ โโโ package-lock.json
โ โโโ package.json
โ โโโ postcss.config.js
โ โโโ prisma
โ โ โโโ schema.prisma
โ โโโ public
โ โ โโโ images
โ โโโ src
โ โ โโโ app.ts
โ โ โโโ auth
โ โ โโโ controllers
โ โ โโโ generated
โ โ โโโ hooks
โ โ โโโ middleware
โ โ โโโ models
โ โ โโโ plugins
โ โ โโโ routes
โ โ โโโ schemas
โ โ โโโ server.ts
โ โ โโโ services
โ โ โโโ tests
โ โ โโโ types
โ โ โโโ utils
โ โโโ tsconfig.json
โโโ CONTRIBUTING.md
โโโ docker-compose.yml
โโโ frontend
โ โโโ dist
โ โ โโโ assets
โ โ โโโ index.html
โ โโโ Dockerfile
โ โโโ index.html
โ โโโ nginx.conf
โ โโโ package-lock.json
โ โโโ package.json
โ โโโ postcss.config.js
โ โโโ src
โ โ โโโ app.tsx
โ โ โโโ assets
โ โ โโโ components
โ โ โโโ config
โ โ โโโ context
โ โ โโโ global
โ โ โโโ lib
โ โ โโโ main.tsx
โ โ โโโ router.tsx
โ โ โโโ screens
โ โ โโโ services
โ โ โโโ styles
โ โ โโโ svg.d.ts
โ โ โโโ types
โ โโโ tailwind.config.js
โ โโโ tsconfig.json
โ โโโ vite.config.ts
โโโ LICENSE
โโโ monitoring
โ โโโ ELK-Stack
โ โ โโโ docker-compose.yml
โ โ โโโ filebeat
โ โ โโโ logstash
โ โ โโโ nginx
โ โ โโโ setupDashboards
โ โ โโโ setupDataCycleLife
โ โ โโโ setupPassowrds
โ โ โโโ setupSSL
โ โโโ PrometheusGrafana
โ โโโ alertmanager
โ โโโ docker-compose.yaml
โ โโโ grafana
โ โโโ LICENSE
โ โโโ Makefile
โ โโโ prometheus
โ โโโ service-x
โโโ README.mdThis project requires the following dependencies:
- Programming Language: JavaScript
- Package Manager: Npm, Yarn
- Container Runtime: Docker
Build from the source and intsall dependencies:
-
Clone the repository:
git clone ../
-
Navigate to the project directory:
cd -
Install the dependencies:
Using docker:
docker build -t my-app .Using npm:
npm install
Using yarn:
yarn install
Using bun:
bun install
Run the project with:
Using docker:
docker run -it {image_name}Using npm:
npm startUsing yarn:
yarn start- ๐ฌ Join the Discussions: Share your insights, provide feedback, or ask questions.
- ๐ Report Issues: Submit bugs found or log feature requests for the `` project.
- ๐ก Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your LOCAL account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone . - Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.' - Push to LOCAL: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
is protected under the LICENSE License. For more details, refer to the LICENSE file.
- Credit
contributors
