Skip to content

gknguyen/backend-node-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend service

Technical Approach

Core

Testing:

Logger:

Payment Gateway

Pubsub

Message Streaming

ORM/ODM

Database

Install

npm ci

Start dependency containers

docker-compose up -d postgres mongo kafka-admin rabbitmq

Setup mongo in cluster mode

docker-compose exec -it mongo mongosh --eval 'rs.initiate({ _id: "mongo-set", members: [{ _id: 0, host: "mongo:27017" }]})'

Run service

npm run start:dev
npm run start:prod

Run test

npm test
npm run test:e2e
npm run test:bvt

Run DB migration

Postgres

# generate new migration file
npm run migration:typeorm:generate --db=<db> ---name=<name>

# revert migration
npm run migration:typeorm:revert --db=<db>

MongoDB

# generate new migration file
npm run migration:mongo:generate --db=<db> ---name=<name>

# run migration
npm run migration:mongo:up --db=<db>

# revert migration
npm run migration:mongo:down --db=<db> -- --last  #Undo the last applied migration
npm run migration:mongo:down --db=<db> -- --all   #Undo all applied migrations

# check migration status
npm run migration:mongo:status --db=<db>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •