This repository contains the API of the Rodrigo Manguinho - NodeJs, Typescript, TDD, DDD, Clean Architecture and SOLID training on udemy.
The goal of this API is to create a well defined and decoupled architecture, using TDD (Test Driven Development) as a working methodology. It also uses the Clean Architecture to distribute the responsibilities between layers, always following the principles of SOLID and applying Design Patterns to solve common problems.
First of all, clone this repo
:
git clone [email protected]:leonardopliski/clean-ts-api.git
Move to the project dir:
cd clean-ts-api/
Review the .env.local
settings to bootstrap your environment.
With NVM run:
nvm use
With NPM run:
npm install
With Docker Compose just run:
npm run up
Done! Access your endpoints:
API Docs:
http://localhost:5050/api-docs/
MongoDB Express Interface:
http://localhost:8081/
- SRP - Single Responsibility Principle
- OCP - Open Closed Principle
- LSP - Liskov Substitution Principle
- ISP - Interface Segregation Principle
- DIP - Dependency Inversion Principle
- SOC - Separation of Concerns
- DRY - Don't Repeat Yourself
- YAGNI - You Aren't Gonna Need It
- KISS - Keep It Simple, Silly
- Composition Over Inheritance
- Small Commits
- Factory
- Adapter
- Composite
- Decorator
- Proxy
- Dependency Injection
- Abstract Server
- Composition Root
- Builder
- Singleton
- DDD
- TDD
- Clean Architecture
- Conventional Commits
- Modular Design
- Dependency Diagrams
- Use Cases
- CI - Continuous Integration
- CD - Continuous Deployment
- 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
- OpenAPI Docs with Swagger
- Rest API with Express
- GraphQL with Apollo Server
- Error Logging
- Security (Hashing, Encryption and Encoding)
- CORS
- Middlewares
- Per-Route access control (Admin, Normal User and Anonymous UserAnonymous User)
- Heroku deployment
- Static File Serving (Just for demonstration purposes, it's recommended to segregate it in production API's).
- Types
- Queries
- Mutations
- Resolvers
- Directives
- Scalars
- Plugins
- Aliases
- Branch
- Reset
- Amend
- Tag
- Stash
- Rebase
- Merge
- Advanced OOP
- Interfaces
- TypeAliases
- Namespaces
- Utility Types
- Path Modularization
- Config preparation
- Build
- Deploy
- Breakpoints usage with VSCode
- Unit tests
- Integration tests (For the Rest API & GraphQL)
- Tests coverage
- Test Doubles
- Mocks
- Stubs
- Spies
- Fakes
- Connect and Reconnect
- Collections
- InsertOne and InserMany
- 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