Skip to content

๐ŸŒ ft_transcendence โ€“ Full-stack multiplayer Pong web app from 42 school, styled like Windows 98. Real-time gameplay with matchmaking, chat, OAuth2 login, spectator mode, and user profiles using WebSockets.

License

Notifications You must be signed in to change notification settings

Inzagini/ft_transcendence

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

42 Ft_Transcendence

๐Ÿ–ผ๏ธ Screenshots

Below are example screenshots of the main pages. Replace the image paths with your own:

Login Page: Login Page

Registration Page: Registration Page

Home Page: Home Page

ft_transcendence

A modern, full-stack, microservices-based Pong platform.


๐ŸŽฎ Features

  • Real-time multiplayer Pong (1v1, AI, tournaments)
  • User authentication, profiles, stats, and 2FA
  • Matchmaking and friend system
  • Tournament mode with blockchain-backed score recording (Avalanche)
  • Modern frontend (Vite + TypeScript)
  • Scalable, containerized backend (Node.js, Fastify, SQLite/Postgres)
  • Traefik reverse proxy with HTTPS

๐Ÿ—๏ธ Architecture

ft_transcendence/
โ”œโ”€โ”€ frontend/         # Vite app (UI, game logic)
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ gateway-service/   # API Gateway (Fastify)
โ”‚   โ”œโ”€โ”€ user-service/      # Users, auth, stats, 2FA
โ”‚   โ”œโ”€โ”€ game-service/      # Game engine, WebSocket
โ”‚   โ””โ”€โ”€ blockchain-service # Blockchain integration
โ”œโ”€โ”€ shared/           # Shared types, DTOs
โ”œโ”€โ”€ scripts/          # DevOps, setup, testing
โ”œโ”€โ”€ docs/             # Architecture, setup, API docs
โ””โ”€โ”€ traefik/          # Traefik config (TLS, routing)

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 20+
  • Docker & Docker Compose
  • npm or yarn

Quickstart

  1. Generate .env file
    make setup
  2. Install dependencies and build
    make
  3. Start all services
    make up

Accessing the Frontend

  • Open https://localhost:8443 in your browser.
  • Other PCs on your network can connect using your host's IP address and port 8443 (e.g., https://<host-ip>:8443).

๐Ÿงฉ Service Overview

  • Frontend: Modern UI, game client (port 8443 via Traefik)
  • Gateway Service: API gateway, routing, security (port 3000)
  • User Service: User CRUD, profiles, stats, 2FA (port 3002)
  • Game Service: Real-time Pong, WebSocket (ports 5001, 5002)
  • Blockchain Service: Tournament score recording (optional)

๐Ÿ› ๏ธ Development

  • Each service is independent (develop/run separately)
  • Hot reload supported in Docker dev setup
  • Shared types/interfaces in shared/

Useful Commands

  • Build all: make build
  • Start all: make up
  • Stop all: make down
  • Rebuild: make red
  • Open DB shell: make db

๐Ÿณ Docker

  • Build a service:
    cd services/user-service && docker build -t ft_transcendence-user-service .
  • Run all:
    docker-compose up -d
  • Dev mode (hot reload):
    docker-compose -f docker-compose.dev.yml up -d

โš™๏ธ Configuration

  • Each service uses its own .env file (see generate_env.sh)
  • Traefik config in traefik/
  • Database: SQLite (dev), Postgres (prod possible)

๐Ÿ‘ฅ Team

๐Ÿ“„ License

MIT


42 Ft_Transcendence ยฉ 2025

About

๐ŸŒ ft_transcendence โ€“ Full-stack multiplayer Pong web app from 42 school, styled like Windows 98. Real-time gameplay with matchmaking, chat, OAuth2 login, spectator mode, and user profiles using WebSockets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 89.8%
  • Shell 4.9%
  • Java 2.5%
  • CSS 1.5%
  • Solidity 0.5%
  • Dockerfile 0.4%
  • Other 0.4%