Skip to content

pedrov4z/clean-node-api

Repository files navigation

Build Status Coverage Status js-standard-style GPLv3 License Open Source

Clean Node API

Click here to access the course

Leia-me em Português (Brasil)


This API is part of Rodrigo Manguinho's 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.

APIs planned for this training:

  1. User Signup
  2. User Login
  3. Create poll
  4. List polls
  5. Answer poll
  6. Survey results

Applied 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:

  • 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

NodeJS Features

  • Swagger API Docs
  • Rest API using Express
  • GraphQL w/ Apollo Server
  • Error Logging
  • Security (Hashing, Encryption and Encoding)
  • CORS
  • Middlewares
  • Secure endpoints (Admin, User and Public)
  • Deploy using Heroku
  • Static Files

GraphQL Features

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

Git Features

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

Typescript Features

  • Advanced OOP
  • Interface
  • TypeAlias
  • Namespace
  • Utility Types
  • Path Mapping
  • Config
  • Build
  • Deploy
  • Breakpoints

Testing Features

  • Unit Tests
  • Integration Tests (Rest API & GraphQL)
  • Test Coverage
  • Test Doubles
  • Mocks
  • Stubs
  • Spies
  • Fakes

MongoDb Features

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