- start with dev database
yarn start:dev
- start with local database
yarn start:local dbname={dbname} dbusername={dbusername} dbpassword={dbpassword}
- This project is a seed for building a node.js api. It includes the following features:
-
- tsoa
typescript
- tsoa
-
- inversify
inversion of controll / dependency injection
- inversify
-
- typeorm
SQL ORM
- typeorm
-
- mocha, chai,ts-mockito sinon
unit and integration testing
- mocha, chai,ts-mockito sinon
-
- pg-mem
In memory postgres DB for testing
- pg-mem
<url>/api-docs
<url>/service
- instalation:
yarn install
- dev:
yarn start
build tsoa routes, swagger definitions and starts the server on development mode listening to file changes (swagger definition changes will require a manual restart) - test:
yarn test
unit and integration tests - build:
yarn build
production build - prod:
yarn start:prod
starts the server on production mode - local:
yarn start:local
lets the user sets the database via arguments- required arguments:
- dbname=LOCAL_DBNAME
- dbusername=LOCAL_USERNAME
- dbpassword=LOCAL_PASSWORD
- default arguments (can be overriden):
- dbhost=localhost
- dbport=3306
- dbdialect=postgres
- required arguments:
- config
express server, DB connection, Logger, etc
- env
.env files
- env
- controllers
routes configuration
- persistance
data abstraction layers
- Entities
classes and interfaces representing entities.
- Repositories
abstraction layer being used by services to access entities
- Entities
- services
business logic to be used primary by controllers
- Dtos
Data transfer objects, to decouple domain from Rest resources
- Dtos
- utils
- tests
- Base Image
phusion/baseimage
- Process Manager for Nodejs
PM2