npm init -y
npx tsc --init
npm install fastify fastify-zod zod zod-to-json-schema @fastify/swagger @fastify/swagger-ui @fastify/jwt @prisma/client bcrypt
npm install pino pino-pretty
npm install @faker-js/faker tap ts-mock-imports
npm install -D ts-node ts-node-dev typescript @types/node dotenv nodemon @types/bcrypt
npm install -D eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
npm install -D @types/tap sinon
npx prisma init --datasource-provider postgresql
npx prisma migrate dev --name init
npx prisma studio
To run database directly inside container, please follow below steps:
-
Download docker
-
To change environment variables, please use .env file
-
Run db docker container and app
npm run start
- Run database docker container
npm run start:db
- To stop docker container
ctrl c
OR
docker-compose down
# To stop with data/volumne cleanup
docker-compose down -v --rmi all
- To see containers logs
docker-compose logs postgres
- To connect to Postgres database manually
docker exec -it postgres bash
psql -U admin -d postgresdb
- To see all tables in database
\dt;