Skip to content

Jarnomer/transcendence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1,082 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

transcendence

Fullstack multiplayer Pong game with 3D graphics and social features ๐Ÿ“

score tech stack graphics engine

type architecture

๐Ÿ“– Overview

ft_transcendence is the final project of the 42 common core curriculum. The goal is to create a web application Pong game with modern web technologies.

This implementation features a microservices architecture with separate services for game logic, matchmaking, user management, and real-time communication. The game is rendered in 3D using BabylonJS and supports multiple game modes including 1v1 matches, AI opponents, and tournament brackets as well as social features.

โœจ Features

๐ŸŽฎ Game Features

  • Real-time Multiplayer - Play against other players with WebSocket-based networking
  • 3D Graphics - 3D rendered gameplay using BabylonJS engine
  • Power-ups System - Dynamic power-ups that affect gameplay
  • AI Opponent - Play against computer-controlled opponent
  • Tournament Mode - Compete in bracket-style tournaments
  • Matchmaking - Automated queue based matchmaking

๐Ÿ‘ฅ Social Features

  • User Authentication - Secure login and registration system
  • Friend System - Add friends and track their status
  • Real-time Chat - Chat with other players using livechat
  • User Profiles - Customizable profiles with avatars and statistics
  • Match History - Track your wins, losses, and game statistics

๐ŸŽจ UI/UX Features

  • Responsive Design - Works seamlessly on desktop and mobile
  • Audio System - Immersive sound effects and background music
  • Graphics Settings - Adjust visual quality and colors
  • Retro Style - Classic original and aesthetic 2D feel

๐Ÿ—๏ธ Architecture

The project follows a microservices architecture pattern with the following services:

Architecture Diagram

Services Breakdown

โš›๏ธ Frontend (/frontend)

  • React + TypeScript with Vite
  • BabylonJS for 3D game rendering
  • Context API for state management
  • WebSocket integration for real-time features

๐Ÿ‘ค User Service (/backend/services/user_service)

  • Authentication (JWT-based)
  • User profile management
  • Friend system
  • Session management

๐ŸŽฎ Game Service (/backend/services/game_service)

  • Core Pong game logic
  • Physics simulation
  • Power-up management
  • AI controller

๐ŸŽฏ Matchmaking Service (/backend/services/matchmaking_service)

  • Player queue management
  • Game session creation
  • Chat functionality
  • Match history tracking

๐Ÿ”Œ Remote Service (/backend/services/remote_service)

  • WebSocket event handling
  • Real-time game state synchronization
  • Chat message distribution

๐Ÿ–ฅ๏ธ Main Server (/backend/services/main_server)

  • API gateway
  • Admin functionality
  • Request routing
  • Error handling

๐Ÿ› ๏ธ Build

The project uses Docker for deployment. Make sure you have docker and docker-compose installed.

# Clone the repository
git clone https://github.com/Jarnomer/transcendence.git
cd ft_transcendence
make all

The application will be available at:

  • Frontend: http://localhost:3000
  • Backend API: http://localhost:4000

Development Build

For development with hot-reload:

# Install dependencies
pnpm install

# Start backend services
cd backend && pnpm dev

# Start frontend (in another terminal)
cd frontend && pnpm dev

โšก Usage

Creating an Account

  1. Navigate to http://localhost:3000.
  2. Click "Sign Up" and create an account.
  3. Customize your profile and upload an avatar.
  4. Begin to Pong!

Playing Games

Quick Match โšก

Home โ†’ Play โ†’ Quick Match

Join the matchmaking queue and get paired with an opponent.

Play vs AI ๐Ÿค–

Home โ†’ Play โ†’ vs AI

Practice against computer-controlled opponents.

Challenge Friend ๐ŸŽฏ

Home โ†’ Friends โ†’ Select Friend โ†’ Challenge

Send a direct challenge to online friends.

Tournament ๐Ÿ†

Home โ†’ Tournament โ†’ Create/Join Tournament

Compete in bracket-style tournaments with multiple players.

Game Controls

  • Move Paddle: Arrow Keys (โ†‘/โ†“) or W/S

๐ŸŽฎ Gameplay

Pong Rules

  • First player to reach full points wins
  • Ball speed increases after each paddle hit
  • Ball spin is influenced by paddle movement
  • Power-ups spawn randomly during gameplay

Power-ups

Icon Name Effect Duration
๐Ÿ“+ Bigger Paddle Increases paddle size 10 seconds
๐Ÿ“- Smaller Paddle Decreases opponent's paddle 10 seconds
โšก+ Faster Paddle Increases paddle speed 10 seconds
โšก- Slower Paddle Decreases opponent's speed 10 seconds
๐ŸŒ€ More Spin Enhanced ball control 10 seconds

Tournament Format

  • Single elimination bracket
  • 4, 8, or 16 player tournaments
  • Best of 1 matches
  • Champion crowned at the end

โ™ป๏ธ Tech Stack

Frontend ๐ŸŽจ

  • React 18 - UI framework
  • TypeScript - Type safety
  • Vite - Build tool and dev server
  • BabylonJS - 3D game engine
  • TailwindCSS - Utility-first CSS

Backend ๐Ÿ”ง

  • Node.js - JavaScript runtime
  • TypeScript - Type safety
  • Fastify - Fast web framework
  • WebSocket - Real-time communication
  • SQLite - Embedded database
  • JWT - Authentication tokens

Infrastructure ๐Ÿ—๏ธ

  • Docker - Containerization
  • Docker Compose - Multi-container orchestration
  • Nginx - Reverse proxy
  • pnpm - Fast package manager

DevOps & Testing ๐Ÿงช

  • Playwright - End-to-end testing
  • ESLint - Code linting
  • Prettier - Code formatting

๐ŸŽฏ Project Modules

This project implements the following 42 modules:

Major Modules

  • โœ… Backend Framework - Node.js with Fastify
  • โœ… Standard User Management - Authentication, profiles
  • โœ… Server-Side Pong - Game logic on backend
  • โœ… Remote Players - WebSocket multiplayer
  • โœ… AI Opponent - Computer-controlled player
  • โœ… Live Chat - Real-time messaging system
  • โœ… Advanced 3D Graphics - Custom shaders and effects

Minor Modules

  • โœ… Front-end framework - React
  • โœ… Backend database - SQLite
  • โœ… Game Customization Options - Settings and preferences
  • โœ… Browser Compatibility - Pong with statistics
  • โœ… Device Support - Statistics tracking

๐Ÿ‘จโ€๐Ÿ’ป Team

This project was developed by: Janrau โ€ข Lassi โ€ข Olli โ€ข Jarno

๐Ÿ“ License

This project is part of the 42 school curriculum.

4๏ธโƒฃ2๏ธโƒฃ Footer

Wanna join Hive ๐Ÿ and start coding? Visit their homepage.

Good luck and have fun! ๐ŸŽ‰

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages