Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean Architecture — Product Use Cases

Full Cycle challenge applying Clean Architecture in TypeScript: domain entities stay independent of frameworks, while use cases orchestrate application rules and infrastructure adapters (Express, Sequelize, presenters) sit at the edges.

Highlights

  • Domain-driven building blocks: entities, factories, validators, domain events
  • Application use cases for Product and Customer (create, find, list, update)
  • Infrastructure: Sequelize repositories, Express routes, XML/JSON presenters
  • Automated tests (unit + e2e) with Jest

Stack

Layer Tech
Language TypeScript
HTTP Express
Persistence Sequelize + SQLite
Validation Yup
Tests Jest, Supertest, SWC

Architecture sketch

HTTP (Express) → Controllers/Routes → Use Cases → Domain
                                      ↓
                               Repository interfaces
                                      ↓
                          Sequelize / SQLite adapters

Prerequisites

  • Node.js 18+
  • npm

Setup

git clone https://github.com/fellipesg/fc-clean-architecture.git
cd fc-clean-architecture
npm install

Run (API)

npm run dev

Starts the API via Nodemon (src/infrastructure/api/server.ts).

Tests

npm test

Type-checks the project and runs Jest.

Project layout

src/
├── domain/                 # Entities, events, factories, validators
│   ├── product/
│   ├── customer/
│   └── checkout/
├── usecase/                # Application services (create/find/list/…)
├── infrastructure/
│   ├── api/                # Express server, routes, presenters, e2e tests
│   └── product|customer|…  # Sequelize repositories
└── …

What this demonstrates

  • Clean Architecture / hexagonal boundaries in a Node codebase
  • Product-focused use cases as the application core
  • Framework-independent domain layer with adapters for HTTP and DB
  • Testable use cases with in-memory or SQLite-backed repositories

License

Educational project — Full Cycle course challenge.

About

Clean Architecture in TypeScript — product & customer use cases (Full Cycle)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages