Skip to content

3lsy/transcendence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Transcendence

Static Badge Docker Vagrant Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge Static Badge

πŸ“‘ Table of Contents

  1. Infrastructure Architecture
  2. Project Structure
  3. Build & Deployment
  4. Modules

Infrastructure Architecture

Architecture-Diagram

πŸš€ Build & Deployment

./setup_certs.sh
./setup_volumes.sh
docker compose up -d
# Add these domains to your /etc/hosts file for local testing
echo '42.fr rproxy.42.fr transcendence.42.fr pong.42.fr grafana.42.fr prometheus.42.fr vault.42.fr elastic.42.fr kibana.42.fr cadvisor.42.fr api-gateway.42.fr' | sudo tee -a /etc/hosts

🧩 Modules

This project is structured into several modules, each focusing on different aspects:

βš™οΈ DevOps

Prometheus & Grafana – Monitoring system for infrastructure and services

Prometheus gathers metrics from services and infrastructure using various exporters and can trigger alerts based on defined rules, while Grafana is used for visualizing these metrics through dashboards.

Data exporters :

  • cAdvisor β†’ container-level CPU, memory, disk, and network usage.
  • blackbox-exporter β†’ health probes on all services.
  • apache-exporter β†’ Apache reverse proxy metrics.
  • Fastify built-in metrics β†’ Each backend microservice (game-service, scoreboard-service, tournament-service) exposes Prometheus metrics (/metrics endpoint).

Grafana dashboards :

  • Infrastructure Dashboard : container resource usage, uptime, node metrics.
  • Service Metrics Dashboard : latency, error rates, throughput for microservices (via Fastify metrics), HTTP success/failure ratios, and exporter data.

πŸ“ˆ Infrastructure Dashboard :

Grafana-Infrastructure-Dashboard-Complete

πŸ“Š Service Metrics Dashboard :

Grafana-Service-Metrics-Dashboard-Complete

ELK Stack – Log Management Infrastructure

Log collection is handled by Filebeat from multiple services such as :

  • Apache reverse proxy (access/error logs).
  • WAF (ModSecurity logs).
  • Vault audit logs.

This are the logs collected with filebeat, processed through Logstash, indexed in Elasticsearch and visualized in Kibana :

ELK-Logs-in-Kibana

This is a dashboard in Kibana from the collected logs :

ELK-Kibana-Dashboards

Backend as Microservices (Architecture)

Microservices implemented :

  • game-service (port 3601).
  • scoreboard-service (port 3602, with persistent volume for data).
  • tournament-service (port 3603).

Design :

  • Each runs as its own container, isolated and restart-managed.
  • RESTful APIs (example: /health and /metrics endpoints.)
  • Communication via shared transcendence-network.
  • Independent deployment and scaling, monitored individually.

This image is from Prometheus showing the microservices and exporters being monitored :

Prometheus-Microservices-Exporters

πŸ›‘οΈ Cybersecurity

vault-ui

WAF – ModSecurity with Hardened Configuration in the Apache Reverse Proxy

HashiCorp Vault – Secrets Management

Automatic retrieval and storage of sensitive data (e.g., API Keys, Tokens, credentials, ...) for services using Vault CLI and API, using Public/Private Certificates and policies for access control.

πŸ“ Game Logic

Server-side Pong & API – Replace basic Pong with server-side Pong and implement an API

πŸ’» Web Development

The website is composed by these technologies :


Website

Pong-Homepage

Back - Front Communication Diagram

Back-Front Communication

Base of the Website

Component Requirements
Back-end The website may or may not include a back-end. If used, it must be implemented in PHP unless the Framework module is selected. If a database is used, it must comply with the Database module rules.
Front-end The base language must be TypeScript, with possible modifications using the Front-end module.
Navigation The website must function as a single-page application (SPA). Users should be able to navigate using the browser’s back and forward buttons.
Browser Compatibility Full compatibility with the latest stable version of Firefox is required.
Error Handling The website must be free of errors and warnings during usage.
Deployment The entire website must be containerized with Docker and launchable via a single command.

Base of the Pong Game

Pong-Game

Feature Requirements
Gameplay Players must be able to compete in real-time on the same keyboard. Remote multiplayer functionality can be expanded with the Remote Players module.
Tournament System The game must support a tournament mode where multiple players take turns competing. The system should display matchups and the order of play.
Player Registration Players must enter an alias before the tournament begins. Aliases reset when a new tournament starts. This can be enhanced with the Standard User Management module.
Matchmaking The tournament system must handle participant matchmaking and announce upcoming matches.
Fair Play All players must follow the same rules, including identical paddle speeds. If an AI opponent is used, it must have no unfair advantages. The game’s aesthetic should align with the original Pong while allowing customization.

Security of the Website

Security Aspect Requirements
Password Security User passwords must be securely hashed using a strong cryptographic algorithm.
Protection Against Attacks The website must be safeguarded against SQL Injection and XSS vulnerabilities.
Secure Communication If a back-end is implemented, HTTPS must be enforced across all communications, including WebSockets (wss).
Input Validation All user inputs must undergo validation, either client-side (if no back-end) or server-side when applicable.
API Security If an API is implemented, all routes must be secured. Even without JWT authentication, adequate security measures must be in place.
Environment Configuration Sensitive credentials must be stored in a .env file and excluded from version control.

Project Structure

Project Structure