REST API to provide questionnaires.
This is my playground github repository for applying principles and new technologies.
For better future maintenance, the application was separated according to the components in the image below. Created abstractions to facilitate testing and refactorings, as well as applying the Clean Code principles.
Controller: management of the REST interface to the business logic
Service: business logic implementations
Repository: storage of the entity in the system
Next steps: apply SOLID principles and more Typescript types
- Core: Typescript, Node.js and Expressjs
- Database: MongoDB using mongoose
- Authentication: JWT
- E-mail: nodemailer and handlebars
- Tests: Jest and supertest
- Validation: Yup
- Security: CORS, helmet and rate-limit
- Hash: bcrypt
- Documentation: Swagger
- Log: Morgan
- Code analysis: ESlint
- Code formatter: Prettier
- E-mail tests with Mailtrap.io (development use ethereal.email)
- Config
.env
with yours credentials or rename.env.example
docker-compose up
or- Install dependencies:
yarn
- Development
yarn dev
- Build
yarn build
- Start
yarn start
$ docker-compose up -d
$ http://localhost:3000/api-docs