-
MongoDb as database: using Mongoose as ODM
-
Socketio with multi nodes support: using the redis socketio adapter
-
TravisCI for CI/CD
- Separate Express 'app' and 'server': allowing a flexible testing environement of the API using Chai HTTP
- Solution structured by self-contained components (features): each feature (For example auth or rooms) contains it's own logic:
- Routes
- Controllers
- Services
- Validations
- Models
- Unit tests
- Errors handled centrally, not within a middlewares: see
src/middlewares/error.ts
. - Operational and programmer errors are seperated: we use a custom error class for this to extend the built in Error class (see
src/utils/ApiError.ts
) - Error logging using Winston: see
src/utils/logger.ts
- Eslint + Prettier + VsCode configuration to enforce code styles on file save
- Husky + lint-staged to enforce code styles before commits
- Unit testing of services using Mocha, Chai, and Chai-spies
- e2e testing using Chai-http
- Multinode support using redis socketio adapter
- Socket handlers separated per topic
- Socket authentification middleware
- We use multistage builds
Really simple CI/CD pipeline that gets triggered on every commit.
- Integrate test coverage into the CI/CD pipeline