Skip to content

ilahyani/ft_transcendence

Repository files navigation

PONG CLUB

IT'S LEVELS IT'S LAYERS SO PRAY FOR THE PLAYERS 🎮

LandingPage

What and How

This project encompasses a web-based multiplayer pong game, complete with user profiles, achievements, direct messaging, and channels. It also allows for one-on-one pong matches with friends or randomly selected opponents. The frontend is crafted using Next.js and Tailwind CSS, while the backend utilizes Nest.js with Socket.IO. PostgreSQL, in conjunction with Prisma, serves as the database. The entire project is containerized within a Docker environment.

Shots

Check the whole project in Figma Designed By ilahyani

LoginPage Profile Chat Game GamePlay

How To Run The Application

first you need a .env file in /backend with the following variables:

42_UID
42_SECRET
42_CALLBACK_URI

POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD
DATABASE_URL

JWT_SECRET

Running Locally

To run the frontend and backend locally, follow these steps:

  1. Run the database:
docker-compose up database --build
  1. In a new terminal, navigate to the frontend directory and install the dependencies:
cd frontend
npm install -f

Make sure the backend_host env in in /fronetend/.env.local is set to the right value

  1. Start the frontend:
npm run dev
  1. In a new terminal, navigate to the backend directory and install the dependencies:
cd backend
npm install -f
  1. Start the backend:
npm run start:dev

Running with Docker

To run the application with Docker, set the backend_host env in /fronetend/.env.local to the right value then use this:

docker-compose up --build

You can also use the Makefile:

make

Here are the available commands:

  • make : Builds and starts the Docker containers.
  • make down: Stops and removes the Docker containers.
  • make clean: Stops the Docker containers and removes the Docker images and volumes.
  • make re: Runs make clean and then make up.
  • make fclean: Runs make clean and then removes all Docker objects and cache.

If you want to try the application without using Intra for login, run this command in /backend to create a test account

npm run db:populate

Then login with these credentials: username: Mugiwara | password: aBcd!123