Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 2.52 KB

README_dev.md

File metadata and controls

60 lines (45 loc) · 2.52 KB

ft_transcendence

Setup

Prerequisites

Installation

  • Clone the repository
  • Copy the envs/.tokens.env.example file to envs/.tokens.env:
    • Copy the UID and SECRET to the envs/.tokens.env file and fill the BACKEND_42_CLIENT_ID and BACKEND_42_CLIENT_SECRET variables, respectively.
  • Run make env to create the appropriate .env file in all the required directories
    • The command requires an mode argument, which will correspond to the .env.<mode>, by default it is development.
  • Run make setup to download and setup:
    • PNPM
    • NestJS CLI
    • Download client dependencies
    • Download server dependencies
    • Setup prisma types & database schema

Running

most of these commands need to be in seperate terminals

  • make client_dev to run the client in development mode
  • make server_dev to run the server in development mode
  • make db_studio to see the database in the browser

Development

Environment Variables

  • Update the envs/.env.<mode> file to add/update/remove environment variables
  • Run make env to update the .env files in all the required directories
  • Edit the typings/env.d.ts file to add/update/remove environment variables types
  • Restart the server/client to apply the changes

Database

  • Edit the server/prisma/schema.prisma file to update the database schema
  • Run make db_generate to generate the database schema
  • Run make db_migrate to apply the changes to the database
  • Run make db_studio to see the database in the browser

Generate Clothing

  • Browse through dev/clothing-showcase or search directly in this archive
  • After having the clothId, confirm if it is a _back asset or not
  • Run the command make client_gen_clothing id=<clothId> [back=true] to generate the clothing
  • To test, add to the bought list in this file
    • If you're unsure about the category, try to check it here