finds.dev

panagiop/node.js-clean-architecture

A use case of Clean Architecture in Node.js comprising of Express.js, MongoDB and Redis as the main (but replaceable) infrastructure.

View on GitHub

★ 1,156JavaScriptupdated Jan 2026

// the take

A teaching example of Clean Architecture applied to a Node.js REST API — user/post CRUD with Express, MongoDB, and Redis. It follows Uncle Bob's layering faithfully: entities, use cases, interface adapters, and frameworks are all separated. This is a reference implementation, not a production starter.

The layer separation is genuinely clean — use cases in `application/use_cases/` have no framework imports, and the repository pattern (`postDbRepository.js` as interface, `postRepositoryMongoDB.js` as implementation) makes the dependency inversion concrete rather than theoretical. Docker Compose is included so you can actually run the stack without installing MongoDB and Redis locally. The Redis caching middleware sits in the frameworks layer where it belongs, not tangled into business logic. Unit tests cover both API and use-case layers separately, which is the whole point of this architecture.

It's JavaScript, not TypeScript, which undermines the architecture's main benefit — without types, the interface contracts between layers are invisible and easy to violate accidentally. The test suite is thin: a handful of fixtures and two spec files for posts only, no user or auth tests. The repo hasn't had meaningful updates in years (last substantive work predates 2024) and the ecosystem has moved on — no ESM, no modern Node conventions. Redis is used only for a caching middleware, not modeled as a proper repository in the entity sense, so the 'replaceable infrastructure' claim is only half-true.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,156
Forks
209
Language
JavaScript
Last commit
16 Jan 2026

// nearby

If node.js-clean-architecture isn't quite it.

All repos →