Skip to content

gabrielbahniuk/clean-code-ts-api

Repository files navigation

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

Clean Node API

alt text


This API is part of professor Rodrigo Manguinho's training on Udemy.

It aims to show how to create an API with a well defined architecture and decoupled architecture, using TDD (Test-driven Development) as development metodology, Clean Architecture to distribute responsibility in layers, always following SOLID principles and whenever possible, applying Design Patterns to solve some common issues.

APIs build in this training

  1. SignUp
  2. Login
  3. Create survey
  4. List surveys
  5. Answer survey
  6. [Survey result] Work in Progress

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

Metodologies 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
  • Supertest
  • Husky
  • Lint Staged
  • Eslint
  • Standard Javascript Style
  • Sucrase
  • Nodemon
  • Rimraf
  • In-Memory MongoDb Server
  • MockDate
  • Module-Alias
  • Copyfiles
  • Npm Check

Node features

  • API documentation with Swagger
  • Error logs
  • Security (Hashing, Encryption and Encoding)
  • CORS
  • Middlewares
  • Access level on routes (Admin, User and Anonym)
  • Deploy on Heroku
  • Serve static files

Git features

  • Alias
  • Personalized log
  • Branch
  • Reset
  • Amend
  • Tag
  • Stash
  • Rebase
  • Merge

Typescript features

  • Advanced POO
  • Interface
  • TypeAlias
  • Utility Types
  • Paths Modularization
  • Build
  • Deploy
  • Breakpoints usage

Test features

  • Unity tests
  • Integration tests
  • Tests 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

About

API using Typescript with Nodejs and most of the known best practices and concepts like SOLID, Clean Architecture, Clean Code, DRY, etc.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published