/ft_transcendence

A project that aims to develop an online and real-time Ping-Pong game.

Primary LanguageTypeScript

Introduction

ft_transcendence is the final cursus project that demonstrates the ability to transition to unfamiliar programming languages and frameworks based on current knowledge.

This is a 1337 coding school project that aims to develop an online and real-time Ping-Pong game. It utilizes Nest.js as the backend framework, Next.js with React.js for the frontend, and brings them together using Docker Compose.

⚠️ This educational project is not intended for production use.

Features

  • Real-time Ping-Pong games
  • Different game map themes


  • User friendly Interface
  • Ability to add others as friends


  • OAuth login via google and 42 intranet


  • 2FA account protection


  • Direct messaging between users
  • Ability to create public, private or password-protected chat groups


  • A Leaderboard to track player rankings


Technologies Used

The website was built using the following technologies:

Usage

Prerequisites

Setup

  1. clone the repo and go into the folder:
git clone git@github.com:recursive-beast/ft_transcendence.git
cd ft_transcendence
  1. create .env files for the backend/frontend from templates:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
  1. fill backend/.env and frontend/.env with the necessary secrets.

Running the application

Once you have set up the environment variables, you can proceed to run the application using Docker Compose:

docker compose up --build -d

This will launch both the frontend and backend services, including the database, in separate Docker containers.

Wait for the containers to be up and running, then you can access the application through your web browser. The address is http://localhost:3000.

Makefile

To simplify the management of the application, the following Makefile commands have been provided:

Command     Description
make up Starts the application in detached mode, building the Docker containers.
make down Stops and removes all Docker containers related to the application.
make logs Displays the logs for a specific service. Specify the SERVICE parameter to view logs for a particular service. (e.g., make logs SERVICE=frontend)
make clean This command will remove all containers, images, volumes, and networks related to Docker.
⚠️ Exercise caution, as this action cannot be undone.
make db (dev) Starts only the PostgreSQL database in detached mode.
make setup (dev) Sets up the application by starting the PostgreSQL database, installing frontend and backend dependencies, and applying database migrations.

Acknowledgments

Special thanks to 1337 coding school for providing the opportunity to work on this project and explore various technologies.