Skip to content

Chandara-Sin/trading-api

Repository files navigation

TRADING-API

Development

Code Style: Prettier

Create .env for API

NODE_ENV=
PORT=
DATABASE_URL=
PRISMA_GENERATE_OUTPUT=../src/generated/client
API_KEY_PUBLIC=

This is project use Prisma

Prisma

More Info - prisma set up relational database from scratch

Generate Prisma Client for yarn berry

yarn generate

How to migrate DB

yarn migrate

Run Project

yarn dev

Build Project

yarn build:local

Run Unit Test

yarn test

For Integration Test

Use docker-compoes.test.yml

yarn database-test:up

Run Integration Test

yarn test:integration

Docker

Create .env.local for API

NODE_ENV=
PORT=
DATABASE_URL=postgresql://<user>:<password>@postgres:<port>/<db>?schema=public&connect_timeout=300
PRISMA_GENERATE_OUTPUT=../generated/client
API_KEY_PUBLIC=

Run Docker Image Postgres

docker compose up db -d

Run Project with Compose

docker compose up -d