BennyKJohnson / Leonardo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setup

Environment variables

Environment variables such as credentials are included in the .env file. To use the example .env which includes database connection url to docker postgres db, run the following command:

cp .env.example .env

Node module installation

  • The app requires Node version 18. Install required packages with the following command:
$ npm install

Database setup

A postgres database server is required to run the app. This is included in docker compose

$ docker compose up

Migrate the database and seed data with:

$ npm run migrate 
$ npm run seed

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Documentation

Swagger docs are available on http://localhost:3000/api

Troubleshooting

PrismaClientInitializationError: Can't reach database server at `localhost`:`5432`
  • Postgres server is not running or your .env DATABASE_URL is incorrect

About


Languages

Language:TypeScript 98.4%Language:JavaScript 1.6%