Skip to content

vladislav-shkutovich/NestJS-Expenses-App

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Installation

$ yarn install

Running the app (with UTC timezone)

# development
$ yarn run start

# development using Docker + local MongoDB
$ docker-compose -f docker-compose.dev.yaml up --build

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Test

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Migrations (with UTC timezone)

Create a new migration template

Generate a new migration file with a timestamp and your specified name.

$ MONGODB_URI='value' yarn run migrate create --folder migrations --name <migration-name>.mjs

Example:

$ MONGODB_URI='value' yarn run migrate create --folder migrations --name currencies-seed-collection.mjs

You need to specify --folder migrations only for creating the first migration.

Run migrations up

Apply all pending migrations to update the database schema.

$ MONGODB_URI='value' yarn run migrate up

Run migrations down

Revert the last applied migration.

$ MONGODB_URI='value' yarn run migrate down

List pending migrations

Show all currently pending migrations.

$ MONGODB_URI='value' yarn run migrate pending

List executed migrations

Show all executed migrations.

$ MONGODB_URI='value' yarn run migrate executed

For the rest possible migration commands visit official Umzug documentation.