Giter Site home page Giter Site logo

bima42 / ft_transcendence Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 5.27 MB

Single Page Application Website. Last project of 42 School common core.

JavaScript 0.29% HTML 0.09% Vue 40.08% Dockerfile 0.68% TypeScript 55.91% SCSS 2.07% Shell 0.35% Makefile 0.33% PLpgSQL 0.20%
nestjs typescript vue3 web

ft_transcendence's Introduction

ft_transcendence

Single Page Application Website. This is the last project of 42 School common core. This project is a website that includes a multiplayer pong game.

Launch the project locally

Clone the repository

git clone [email protected]:Bima42/ft_transcendence.git

cd ft_transcendence

Setting up environment variables

  • Rename .env.example to .env
  • Change the values of the variables FORTYTWO_API_UID and FORTYTWO_API_SECRET in .env to match your environment
  • You should also configure JWT_KEY

Run containers

  • Use --build to rebuild images
  • Use --force-recreate to force recreate image and containers
  • Use -d to run containers in background
docker compose up -d

Reach the website

  • Go to https://localhost:4443

Documentation

Website overview

Login

Home

Profile

Chat

Chat with a friend

Game

In game

Leaderboard

ft_transcendence's People

Contributors

yvanoffp avatar bima42 avatar tyrossel avatar lbelet avatar mattdirty avatar malahusk avatar

Stargazers

 avatar  avatar Widium avatar Loïc / lulutalu avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

yvanoffp

ft_transcendence's Issues

Road map

Frontend

  • Make left menu reactive to current location
  • #20
  • #21
    • Overflow on different pages
  • Create chat vue
    • Figma and create several components
  • Create modalStore

Backend

  • #18
  • Create some User functions (add, delete, modify ...)
  • #34
  • #32
  • #46
  • #48
  • #42
  • Protect from SQL Injection

Game

  • Create a new component for the Pong game. (it will contain the HTML, CSS, and JavaScript necessary to run the game.)
    • In the template section :
      • add a canvas element that will be used to draw the game elements (such as the ball and paddles).
      • add controls for the game (such as buttons for starting and resetting the game).
    • In the script section :
      • import the JavaScript file containing the code of the Pong game
  • Write the JavaScript code for the Pong game :
    • Analyze the original pong and set the game rules :
      • The main features of the original Pong game were:
        • Two paddles that could be moved up and down by the players
        • A ball that bounced back and forth between the paddles
        • A score that was incremented every time a player missed the ball with their paddle
        • A simple "AI" that controlled the movement of the computer's paddle
    • Create a canvas element and use JavaScript to :
      • draw shapes and images on the canvas
      • handle user input and game logic.
      • Game logic :
        • handle player input and update the positions of the ball and paddles.
        • handle collisions/bounce between the ball and the paddles and the edges of the canvas.
        • keep track of the score and end the game when one player reaches a certain number of points.
        • A simple "AI" that controlled the movement of the computer's paddle
  • Our customize pong :
    • Adding features to the game :
      • ... ?
      • ... ?

Docs

  • Nest Authentication (+ guard, + Passport, + JWT strategy, + encryption)
  • Typescript : await/async
  • Nest : Dependency Injection

[security]: protect againt SQL injection

Edit: We are already protected SQL injection thanks to Prisma. However, the following points would be nice to implement.


We have to validate each user input at least on the server side, and best would be on the client side too. And both side, we can use the JOI package to help use

Client side:

  • Simple input: Add pattern attribute to all input field
  • Alternative: add listeners to input field, that validate the input and/or warn the client

Server side:

  • Use DTOs for all things received from clients
  • Decorate them with decorators from the JOI package

[Front] frontend/chatview / Style the tooltip

In chatUserDetails.vue

Style the tooltip to display the informations we need inside of it.
Try to make it as a component.

Be careful beacause you want to emit the setInactive so try to find a way to make it clever between the components.

If you don't find any solutions to make it as components make it raw in the file and we will find a way later.

image

The avatar component already exists.
Keep things simple, use placeholder names for userName and userHighscore.

The Add friend button will be changed to a remove friend button.
The send a priv message button will be displayed only if the user is already a friend, but you can display it rn as backend will provide us this info later on.

As always, these are my ideas, you are free to do whatever you guys want and feel to, I am just trying to guide you

Cheers

bug(chat): user avatar not updated

When a user send a message in a chat, then change his avatar, his avatar is not updated on the chat, We have to refresh the page to update the avatar

fix(login): remove the redirect system of login

At the moment, there is a redirectHandler which is used to delay the login system in order to not crash. This is not the good way to do it
Remove it and use something like suspens instead

back(2FA): Implement 2FA for log in

Some things to add :

  • : Add firstname and lastname field for 42 user
  • : Display avatar when logged in

2fa :

  • : Add a button to switch 2fa true
  • : Implement new field such as phone number to validate 2fa (?)
  • : Test 2fa

[Frontend] Game: custom mode

Here is a list of some ideas to implement in the custom mode of the game:

  • Obstacles
  • Faster ball
  • Accelerating ball after some time
  • Falling bonuses/maluses from the middle to each players. Some effects could be:
    • Bigger/smaller paddle (limited time ?)
    • Faster/slower paddle (limited time ?)
    • Faster/slower ball (limited time ?)
    • Button inversion for the opponent
    • multiballs ?
    • Laser to shoot the opponent down (paddle solidity ?)
    • Kittens
    • Invicibility: ball bounces on the wall behind the player for a limited time
    • Invisible/less visible ball

feat(front): add buttons in front for friend interaction

What ?

  • Atm, only endpoints for user interaction are set. We need to implement button to add, remove or block/unblock a user in front to use those endpoints. And accept/decline a friend request
  • Also, we need to set up the friendlist in front, and may be the blocked users list

feat(user): improve user profile

  • Add win and games played to display in user profile
  • We can also add a winrate score in the profile, this field could be calculated in front

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.