👻 Brikl Assignment
⚙️ Setup Serivce
- This serivce use database, so it need to setup database first by using sciprt below (Please instal Docker and Docker Compose first link)
sudo docker compose -p brikl-task-dev -f deployment/docker-compose.yaml up -d database
- After setup database, need to install dependency by using command below
npm install
- Next, it need to setupp database ORM lib by using sciprt below
source .env
npx prisma generate --schema src/providers/database/prisma/schema.prisma
npx prisma db push --force-reset --accept-data-loss --schema src/providers/database/prisma/schema.prisma
🔧 Unit test
npm run test
🚀 Start Service with NodeJs
- This serice can run start with NodeJs by using script below
For dev
npm run start:dev
For dev without hot-reload (You can run this for checking my code)
npm run start
- Go to path http://localhost:3000/graphql
🐳 Start Service with Docker (Recommed)
Can not build in Mac-silicon-cpu
- Build Image
sudo docker compose -f deployment/docker-compose.build.yaml build
- Start Service
sudo docker compose -p brikl-task-dev -f deployment/docker-compose.yaml up -d
- Migrate Database
sudo docker exec -it task_service.brikl-task-dev.com bash
npx prisma db push --force-reset --accept-data-loss --schema=src/providers/database/prisma/schema.prisma
exit
- Go to path http://localhost:3000/graphql