Skip to content

A modern, real-time multiplayer Pong platform built with Django and Bootstrap. Features include alias-based tournaments, AI opponents, 2FA, JWT security, and Docker deployment — all in a single-page application.

Notifications You must be signed in to change notification settings

amine-za/ft_transcendence

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_transcendence

A web-based multiplayer Pong game. Frontend uses HTML, CSS, and JavaScript. Backend uses Django REST API. The app runs in Docker containers with PostgreSQL database.

Screenshots

Deployment Diagram Main Page Login Page

Multiplayer Game AI Mode Terminal Interface

Features

  • Real-time multiplayer Pong game
  • Play against AI or other players
  • Tournament system with automated matchmaking
  • Single-page application with smooth navigation
  • Two-Factor Authentication (2FA)
  • JWT authentication
  • Multi-language support
  • PostgreSQL database
  • Docker deployment
  • Dockerized
  • Runs with docker-compose up --build in rootless mode on Linux

Chosen Modules

Major Modules

  • Framework Backend (Django): Scalable server-side solution.
  • Remote Authentication (OAuth 2.0 with 42): Secure login via 42’s OAuth 2.0.
  • Two-Factor Authentication (2FA) & JWT: Enhanced security via 2FA (SMS/app/email) and JWT.
  • Multiple Players: >2 players in a single game (e.g., 4-player squared board).
  • AI Opponent: Simulates human play, uses power-ups (no A* algorithm).

Minor Modules

  • Database (PostgreSQL): Reliable data storage.
  • Front-End Framework (Bootstrap): Responsive UI.
  • Browser Compatibility: Supports an additional browser.
  • Game Customization: Power-ups, attacks, maps with user-friendly settings.
  • Multiple Language Support: 3+ languages with a language switcher.

Installation

Requirements

  • Docker
  • Docker Compose
  • Make (optional, for easier commands)

Quick Start (Basic Mode)

This runs the app without email features. Good for testing.

  1. Clone the repository:
git clone https://github.com/amine-za/ft_transcendence.git
cd ft_transcendence
  1. Run with Make:
make up

Or without Make:

cp .env.example .env
docker-compose up --build
  1. Open your browser and go to: https://localhost:443

Note: You will see a security warning because of the self-signed certificate. Click "Advanced" and "Proceed to localhost" to continue.

Full Setup (With Email 2FA)

If you want Two-Factor Authentication via email to work:

  1. After running make up, edit the .env file:
EMAIL_HOST_USER=your_gmail@gmail.com
EMAIL_HOST_PASSWORD=your_gmail_app_password
  1. Get a Gmail App Password:

    • Go to your Google Account settings
    • Enable 2-Step Verification
    • Generate an App Password for "Mail"
    • Use that password in .env
  2. Restart the containers:

make re

Project Structure

ft_transcendence/
├── docker-compose.yml     # Docker setup
├── backend/               # Django API
├── frontend/              # HTML/CSS/JS files
└── images/                # Screenshots

Technology Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Django, Django REST Framework
  • Database: PostgreSQL
  • Deployment: Docker, Nginx
  • Authentication: JWT, OAuth 2.0

Security Features

  • Password hashing
  • Two-Factor Authentication
  • JWT tokens
  • Protection against SQL injection and XSS
  • HTTPS support

Enjoy ft_transcendence

About

A modern, real-time multiplayer Pong platform built with Django and Bootstrap. Features include alias-based tournaments, AI opponents, 2FA, JWT security, and Docker deployment — all in a single-page application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 52.2%
  • Python 33.8%
  • CSS 8.7%
  • Makefile 3.5%
  • HTML 1.1%
  • Dockerfile 0.6%
  • Shell 0.1%