Skip to content

DanielAraldi/clean-node-api

Repository files navigation

Coverage Status wakatime

Clean Node API

alt text

This API makes part of training of the teacher Rodrigo Manguinho (Mango) on Udemy.

The objective of the training is show to create an API with a defined architecture well and uncoupled, using TDD (Test Drive Development) such as work methodology. Clean Architecture to do responsibility distribution in layer, always following the SOLID principles and, whenever possible, applying Design Patterns to solve some common problems.

APIs:

  1. Sign Up
  2. Login
  3. Add survey
  4. List surveys
  5. Answer survey
  6. Load survey result

Additional APIs:

  1. Refresh token
  2. Edit user data

Principles applied:

  • Single Responsibility Principle (SRP)
  • Open Closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
  • Dependency Inversion Principle (DIP)
  • Don't Repeat Yourself (DRY)
  • Composition Over Inheritance
  • Small Commits

Design Patterns applied:

  • Factory
  • Adapter
  • Composite
  • Decorator
  • Dependency Injection
  • Abstract Server
  • Composition Root

Dethodology/designs used:

  • TDD
  • Clean Architecture
  • DDD
  • Conventional Commits
  • GitFlow
  • Modular Design
  • Dependency Diagrams
  • Use Cases

Libraries e tools used:

Features taught:

  • Git alias
  • Log error
  • Security (Hashing, Encryption e Encoding)
  • CORS
  • Middlewares
  • Integration tests
  • Unit tests
  • Coverage of tests
  • Test Doubles
  • Mocks
  • Stubs
  • Spies
  • Deploy with Typescript
  • Deploy on Render
  • Use breakpoints on Typescript
  • Use correct tags on Git
  • Fakes

MongoDB's Features

  • Connect e Reconnect
  • Collections
  • InsertOne e InserMany
  • Find, FindOne e FindOneAndUpdate
  • DeleteMany
  • UpdateOne
  • Aggregation (Match, Group, Unwind, Lookup, AddFields, Project, Sort)
  • ObjectId
  • Upsert e ReturnOriginal
  • Push, Divide, Multiply, ArrayElemAt, Cond, Sum
  • Filter, Map, Reduce, MergeObjects, ConcatArrays