GithubHelp home page GithubHelp logo

znichola / ft_transcendence Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 2.97 MB

The final project of the 42 common core: a website to play pong and chat with friends

Makefile 0.27% Dockerfile 0.29% JavaScript 0.32% TypeScript 98.27% HTML 0.08% CSS 0.18% Shell 0.05% PLpgSQL 0.53%
42lausanne ecole42

ft_transcendence's Introduction

TRANSCENDENCE

Test playground for the final project of the 42 common core.

Docker Compose and project overview

There is a docker-compose-prod.yml and a docker-compose-dev.yml By default, the dev version is used. To use the prod version: export TRANSCENDANCE_MODE=prod

Everything works with HTTPS. HTTP requests are redirected to HTTPS. You can configure HTTP_PORT and HTTPS_PORT in kickstart.env

How to dev

  • clone the repo
  • launch vscode for the repo
  • install the docker extension
  • launch the docker compose with make up

Because the node files are present locally, vscode can use them for intelisense so it all works great!

make react # to exec into the container, from here you can npm install etc..
make nest  # for the nest container
make postgress # self explanitory

make ip    # to show the ips of each container
make re    # to completly remove all container/images/networks/drives from your system

npm create vite@latest my-react-app -- --template react-ts # to install the basic setup for a react app
npm ... to add for the nest app

npm install # if there are already project files, but no node_modules

npm run dev # in the react container, to run the vite dev server with hot reloading
nest start --watch # to start the nest.js server in watchmode

When using the react+nestjs branch to launch the development env for the first time:

git clone [email protected]:znichola/ft_transcendence_test.git
cd ft_transcendence_test
make up

# in a new window navagte back to the same repo
make react
> cd react-app
> npm install
> npm run dev

# in a new window navagte back to the same repo
make nest
> cd nestjs
> npm install
> nest start --watch


# installation of prisma in the container
make nest
> cd nestjs
> npm install prisma
> npm install @prisma/client

# initialize the database after a make re or for first use
make nest
> cd nestjs
> npx prisma migrate dev
> npx prisma db seed

# to inspect the database data, run from a containerized VS Code
# by default, allows you to access localhost:5555 from your browser
make nest
> cd nestjs
> npx prisma studio

# to
make nest
> npx prisma db seed

# to

It's actaully not needed to do the steps below, but it's how you would launch vscode attached to a container.

  • in the bottom right of vscode you have the blue connect button, click this
  • and attach to running container, pick the react or nest container
  • this is important for vscode to have acess to the node module files for code linting, completion etc..
  • if you can't, open the settings UI with ctrl+shift+p then type Preferences: Open Settins (UI)
  • search for docker path and add the result of $which docker there

Bootstrapping the frontend app

API the front end needs

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.