Skip to content

mvp-rockets/backend-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. Introduction

It's backend project build on nodejs. which can be used as a reference/based for new/existing project.

2. Pre-requirement

  • Ubuntu 20.04.4 LTS
  • docker(19.xx)
  • docker-compose(1.28.xx)

3. Running the project

docker-compose up

4. Connect to container

To perform db operations, installing new packages and running test cases. You need to connect to the container. use below cmd to connect.

./connect.sh

5. Db operations

To perform db operations connect to the container and execute below commends. Note: <:env> should be your environment name like dev,test or qa etc

Commands:
  npm run db:create  --env=<:env>                                                  Create database specified by configuration
  npm run db:migrate --env=<:env>                                                  Run pending migrations
  npm run db:migrate:undo --env=<:env>                                             Reverts a migration
  npm run db:seed:all --env=<:env>                                                 Run every **seeder**
  npm run model:generate --name=<modelName> --attributes=<listOfAttributes>        Generates a new migration file
  npm run migration:generate --name=<migrationName>                                Generates a model and its migration
  npm run db:drop --env=<:env>                                                     Drop database specified by configuration(Note: all connections are closed)

6. Test Cases

To execute test cases connect to the container and execute below commends

npm run test:watch                            Run all the test cases and wait for the changes
npm run test                                  Run all the test cases and exit
docker-compose -p tests run -p 3000 --rm web npm run test:watch

7. Health check apis

Project contain two health-check api end-points.

/health-check-api                            To check the health of api instance.
/health-check-db                             To check the connection between api instance and db.

Note: check index.js for code implementation.

8. Cron

For cron related works, Project use cron package for running your code and cronitor package to monitoring your cron.

cron

cron installation npm i cron

How to use : https://www.npmjs.com/package/cron

cronitor

Pre-requirement: Create account in cronitor portal (https://cronitor.io/)

cronitor installation npm i cronitor

How to use

9. cors

cors installation npm i cors

How to use : https://www.npmjs.com/package/cors

10. Authors/maintainers/contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages