Skip to content

edmilson-torres/simplequiz-api

Repository files navigation

Nest, GraphQL and PostgreSQL Logos

✅ Simple Quiz!

REST API to provide questionnaires.

This is my playground github repository for applying principles and new technologies.

👷‍♂️ Pattern

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

Nest, GraphQL and PostgreSQL Logos

Next steps: apply SOLID principles and more Typescript types

⚙️ Technologies

  • 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)

🚀 Running

  • 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

$ docker-compose up -d

📄 API Docs

$ http://localhost:3000/api-docs

🖼️ Swagger

localhost_3000_api-docs