Skip to content

Latest commit

 

History

History
104 lines (72 loc) · 1.85 KB

README.md

File metadata and controls

104 lines (72 loc) · 1.85 KB

Swifter server

Nest.js, TypeORM

Table of contents

Documentations

Installation

$ npm install

Getting Started

$ npm install # install dependencies
$ npm run set # execute mysql container
$ npm run migrate # execute all migration files
$ npm run start:dev # run development server (watch mode)

Commands

Docker

you should execute docker-compose to run development server

# execute docker-compose
$ npm run set

# clear docker containers
$ npm run set:down

Running the app

# run
$ npm run start

# development - watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

TypeORM:Migration

We use migrations to manage database changes

# generate migation file by codebase change
# e.g. npm run makemigrations UpdateUser
# you can find generated file in src/database/migrations
$ npm run makemigrations <MIGRATION_NAME>

# apply existing migration files
$ npm run migrate

# revert last-applied migration
$ npm run migrate:revert

# list applied migrations
$ npm run migrations

Check

Includes lint, type, unit test

# lint
$ npm run check:lint

# type check
$ npm run check:type

# unit test
$ npm run check:test

# run all checks parallely (it's fast!!)
$ npm run check

How to deploy

Commits pushed to the main branch are automatically deployed. (via GitHub Action)