nelsonwenner / clean-architecture-api

:sparkles: Clean Architecture, Design Patterns and SOLID principles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLEAN ARCHITECTURE API

🤔 How to apply clean architecture?

diagram

  • The diagram above is a visual representation of integrating all these architectures into a single actionable idea. As you can see, just doing the mental exercise of obeying these simple rules before coding a new system will save you a lot of headaches in the future. With this, if any of the technologies used in the system becomes obsolete (for example, the adopted web structure), you will be able to replace these elements without any problems. In practice, it's as simple as it sounds: by subdividing your project into layers you'll create a testable, readable, and easily optimizable system. In parallel, while defining the design layers in line with business rules and interface rules, it is essential to understand the relationship between application dependencies and entities.

    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

    Design Patterns

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

    Methodologies and Designs

    • TDD
    • Clean Architecture
    • DDD
    • Modular Design
    • Dependency Diagrams
    • Use Cases

🚀 Technologies

🔌 Prerequisites

ℹ️ Getting Started

  1. Fork this repository and clone it on your machine.
  2. Change the directory to clean-architecture-api where you cloned it.

🔐 Getting Started

  1. Install dependencies
$ npm install
  1. Setup database
/* Create `.env` of the system */
$ cp .env.example .env

/* Run database with docker */
$ docker-compose up -d

/* Setting database, how create tables */
$ npm run prisma:push
  1. Start the application
$ npm run dev

🧰 Running the tests

$ npm run test

About

:sparkles: Clean Architecture, Design Patterns and SOLID principles


Languages

Language:TypeScript 97.1%Language:JavaScript 2.4%Language:Shell 0.5%