This is ProjectRun API built with Node.js (Nest.js).
- Node.js v18.* or higher
- npm v9.* or higher
- Docker v20.* or higher
- Docker Compose v2.* or higher
- Install the project and dependencies:
git clone git@gitlab.com:projectrun/projectrun-api.git
cd projectrun-api/ && npm install-
Create
.envfile and fill the environment variables. -
Custom command to:
- remove db_service container:
docker-compose rm -f -s -v db_service - run the db_service container:
docker-compose up -d db_service - apply migrations:
npx prisma migrate deploy - run the seeders:
ts-node prisma/seed.ts(custom command)
- remove db_service container:
npm run db:restart- Run the server:
# development
npm run start:dev
# production
npm run start- "forever" commands:
# start
forever start -c "npm run start" ./
# list
forever list
# stop
forever stop <pid>- [Optional] Sometimes the port is not released after stopping the server. To fix this:
# find and kill the process that uses the port
kill -9 $(lsof -t -i:3010)- Browse db via browser's default host on development mode:
npx prisma studio- [Development] Reset the database:
npx prisma migrate dev (-y)
npx prisma db push
npm run db:restart