π« A Class Base Routing Boilerplate for Node.js, Express.js, MongoDB with Typescript.
Try to implement A Class Base Routing with clean structure and scalable boilerplate in Node.js,Express.js and Typescript.
- Sentry catch errors.
- API Documentation using Swagger.
- Basic Security Features using Helmet, hpp and xss clean.
- Validation using class-validator
- class base routing using routing-controllers
- Authentication - using Passport.js passport-jwt which is compatible with Express.js and is a authentication middleware for Node.js.
- Database using mongoose odm for interacting with mongoDB.
- run testing using Jest
- linting using ESLint
- prettier using Prettier
install dependencies
yarn
Note: It is assumed here that you have MongoDB running in the background.
set .env.development.local
file with your credentials.(like DB URL)
Run the app
yarn dev
Note: It is assumed here that you have installed Docker and running in the background.
yarn docker:db
set .env.development.local
file with your credentials.(like DB URL)
Run the app
yarn dev
you can access swagger documentation at http://localhost:3000/api-docs
express-typescript-boilerplate
ββ .
β ββ workflows
β ββ tests.yml
ββ README.md
ββ ecosystem.config.js
ββ jest.config.js
ββ package.json
ββ src
β ββ __tests__
β β ββ api
β β β ββ v1
β β β ββ auth
β β β ββ users
β ββ api
β β ββ v1
β β ββ auth
β β β ββ auth.controller.ts
β β β ββ dtos
β β ββ index.ts
β β ββ user
β β ββ user.controller.ts
β ββ app.ts
β ββ common
β β ββ constants
β β β ββ index.ts
β β ββ interfaces
β β β ββ crud.interface.ts
β β β ββ timestamp.interface.ts
β β ββ types
β ββ config
β β ββ index.ts
β β ββ passport.ts
β ββ exceptions
β β ββ HttpException.ts
β ββ index.ts
β ββ middlewares
β β ββ auth.middleware.ts
β β ββ handlingErrors.middleware.ts
β β ββ validation.middleware.ts
β ββ models
β β ββ tokens.model.ts
β β ββ users.model.ts
β ββ services
β β ββ v1
β β ββ auth.service.ts
β β ββ index.ts
β β ββ token.service.ts
β β ββ user.service.ts
β ββ utils
β ββ toJSON.plugin.ts
ββ tsconfig.json