Skip to content

NodeJs API build with Typescript, TDD, Clean Architecture, Design Patterns, and SOLID principles.

License

Notifications You must be signed in to change notification settings

nandotomio/clean-node-api

Repository files navigation

Build Status Coverage Status Known Vulnerabilities js-standard-style Open Source

Clean Node API

This API project is part a course provided by professor Rodrigo Manguinho (Mango) at Udemy.

The purpose of the training is to show how to create an API with a well-defined and decoupled architecture, using:

  • TDD (test-oriented programming) as the working methodology
  • Clean Architecture to distribute responsibilities in layers
  • SOLID principles
  • Design Patterns to solve some common problems

APIs built in training

  1. Sign up
  2. Login
  3. Create survey
  4. List surveys
  5. Answer survey
  6. Survey result

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

  • API documentation with Swagger
  • REST API with Express
  • GraphQL with Apollo Server
  • Error Log
  • Security (Hashing, Encryption and Encoding)
  • CORS
  • Middlewares
  • Routes Access Control (Admin, User and Anonymous)
  • Deploy at Heroku
  • Serving 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
  • Paths Modularization
  • Configurations
  • Build
  • Deploy
  • Use of Breakpoints

Tests features

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

MongoDb features

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