🎫 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
├─ .github
│ └─ 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