SAMAHAN-Systems-Development / samahan-all-for-more-backend

Backend repository for the SAMAHAN All For More 2024-2025 Website
5 stars 0 forks source link

Samahan Backend

Link for Documentation

Tools that needs to be installed:

Tech Stack

  1. Clone the Repository:
git clone https://github.com/SAMAHAN-Systems-Development/samahan-all-for-more-backend.git
  1. Fetch the updates:
git fetch
  1. Switch to the branch of your ticket, for example:
git checkout 3-add-category
  1. Install the libraries with this command:
npm i
  1. Install and create the docker containers with this command (make sure that you already started your docker application):
npx supabase start
  1. Generation of Jwt secret:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
  1. Duplicate the .env.example file and rename it to .env.

You can accomplish this manually or run this command:

For Windows:
copy .env.example .env

For Linux:
cp .env.example .env
  1. Update the database by the Prisma migrations with these commands:
npm run prisma:migrate:reset
npx prisma generate

Running your application

If you just turned your pc on and you want to start the application, run the following commands:

  1. Pull from the main
git pull origin main
  1. Install the libraries
npm i
  1. Run the docker containers (make sure that you already started your docker application)
npx supabase start

Note the service role key and set the value of supabase_key in your .env file to the value of the service role key.

  1. Run the NestJS backend
npm run start

API Documentation