Skip to content

API in NodeJs using Typescript, TDD, Clean Architecture, Design Patterns and SOLID principles

License

Notifications You must be signed in to change notification settings

bruno-silverio/node-clean-api

Repository files navigation

Coverage Status Known Vulnerabilities js-standard-style GPLv3 License Open Source

Clean Node API

image


This API is part of professor Rodrigo Manguinho's (Mango) training at Udemy.

The objective of the training is to show how to create an API with a well-defined and decoupled architecture, using TDD (test-oriented programming) as a working methodology, Clean Architecture to distribute responsibilities in layers, always following the principles of SOLID and, whenever possible, applying Design Patterns to solve some common problems.

image

  1. Cadastro
  2. Login
  3. Criar enquete
  4. Listar enquetes
  5. Responder enquete
  6. Resultado da enquete

Principles

  • Single Responsibility Principle (SRP)
  • Open Closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
  • Dependency Inversion Principle (DIP)
  • Separation of Concerns (SOC)
  • Don't Repeat Yourself (DRY)
  • You Aren't Gonna Need It (YAGNI)
  • Keep It Simple, Silly (KISS)
  • Composition Over Inheritance
  • Small Commits

Design Patterns

  • Factory
  • Adapter
  • Composite
  • Decorator
  • Proxy
  • Dependency Injection
  • Abstract Server
  • Composition Root
  • Builder
  • Singleton

Methodologies and Designs

  • TDD
  • Clean Architecture
  • DDD
  • Conventional Commits
  • GitFlow
  • Modular Design
  • Dependency Diagrams
  • Use Cases
  • Continuous Integration
  • Continuous Delivery
  • Continuous Deployment

Libraries and Tools

  • NPM
  • Typescript
  • Git
  • Docker
  • Jest
  • MongoDb
  • Travis CI
  • Swagger
  • Bcrypt
  • JsonWebToken
  • Faker
  • Coveralls
  • Validator
  • Express
  • Apollo Server Express
  • Graphql
  • Graphql ISO Date
  • Graphql Scalars
  • Graphql Tools
  • Supertest
  • Husky
  • Lint Staged
  • Eslint
  • Standard Javascript Style
  • Sucrase
  • Nodemon
  • Rimraf
  • In-Memory MongoDb Server
  • MockDate
  • Module-Alias
  • Copyfiles
  • Npm Check
  • Bson ObjectId
  • Apollo Server Integration Testing

Node Features

  • Documentação de API com Swagger
  • API Rest com Express
  • GraphQL com Apollo Server
  • Log de Erro
  • Segurança (Hashing, Encryption e Encoding)
  • CORS
  • Middlewares
  • Nível de Acesso nas Rotas (Admin, User e Anônimo)
  • Deploy no Heroku
  • Servir Arquivos Estáticos

GraphQL Features

  • Types
  • Queries
  • Mutations
  • Resolvers
  • Directives
  • Scalars
  • Plugins

Git Features

  • Alias
  • Log Personalizado
  • Branch
  • Reset
  • Amend
  • Tag
  • Stash
  • Rebase
  • Merge

Typescript Features

  • POO Avançado
  • Interface
  • TypeAlias
  • Namespace
  • Utility Types
  • Modularização de Paths
  • Configurações
  • Build
  • Deploy
  • Uso de Breakpoints

GraphQL Features

  • Resolvers
  • Type Definitions
  • Directives
  • Scalars
  • Plugins
  • Error Handling

Tests Features

  • Testes Unitários
  • Testes de Integração (API Rest & GraphQL)
  • Cobertura de Testes
  • Test Doubles
  • Mocks
  • Stubs
  • Spies
  • Fakes

MongoDb 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