Coder Social home page Coder Social logo

ilahyani / ft_transcendence Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 21.04 MB

Multiplayer online pong game webapp

JavaScript 0.24% TypeScript 99.50% CSS 0.10% Makefile 0.06% Dockerfile 0.11%
1337school 42 42cursus nestjs nextjs postgresql prisma transcendence

ft_transcendence's Introduction

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

ft_transcendence's People

Contributors

aeddaqqa avatar ayagoumi avatar ilahyani avatar melbehchach avatar yamzil avatar

Stargazers

 avatar

Watchers

 avatar

ft_transcendence's Issues

Need to refresh after login

Enable TFA -> logout -> login -> enter TFA code -> it gives you a blank page and you need to refresh to see your profile

Can't leave game

on random match (maybe on friend match too! didn't test) Leave Game not working for one player

Game score not accurate

Game Score not accurate, game finished 5 - 4 and database records 6 - 5 (it adds one to each)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.