The Problem
Building a Node.js/Express backend with TypeScript often devolves into ad-hoc architecture. Domain logic leaks into controllers, dependencies are wired manually, and testing becomes an afterthought. This repo is a seed project that demonstrates how to structure a TypeScript Express app around Domain-Driven Design (DDD) and CQRS, with dependency injection handled by Inversify.js and persistence via TypeORM.
What This Does
The project is a reference implementation, not a production-ready service. It models a small movie rental domain (src/domain/movie.ts, src/domain/customer.ts) and exposes REST endpoints through src/presentation/rest/customer-controller.ts and src/presentation/rest/movie.controller.ts. The application layer (src/application/) contains command handlers and application services that orchestrate domain logic, while the infrastructure layer (src/infrastructure/db/typeorm/) provides TypeORM-based repository implementations.
Dependency injection is centralized in src/ioc-container.ts using Inversify.js, which wires the domain interfaces to their concrete implementations. The setup is intentionally small—34 files total—so each pattern (DDD, CQRS, DI) is easy to trace from controller to repository.
How To Use It
The README documents the setup. Clone the repo, install dependencies, and start the server:
$ git clone https://julianosam@bitbucket.org/julianosam/ts-express-ddd-seed.git $ cd ts-express-ddd-seed $ npm install $ npm start
Run E2E tests and generate a coverage report:
$ npm run test:e2e:coverage $ open coverage-e2e/lcov-report/index.html
Configuration lives in config/app-config.ts for application settings and ormconfig.json for TypeORM database credentials. The entry point is src/app.ts, which boots Express and wires the DI container. The Dockerfile exists but is marked as work-in-progress in the README. The apidoc.json suggests API documentation tooling, but that's also unfinished.
Real-World Use
This is most useful as a teaching scaffold. A team adopting DDD with TypeScript could fork this, replace the movie/customer domain with their own aggregates, and use the established layering as a template. The CQRS pattern is partially implemented—commands exist (register-movie-command.ts, rent-movie-command.ts) but there are no separate query models. For a production system, you'd extend the query side and add proper transaction management, which the README explicitly flags as unfinished.
Code Health & Issues
Med - No CI/CD pipeline - No .github/ or CI config exists. There's no automated build or test gate, so regressions ship silently. Med - No LICENSE file - Forking or redistributing this code has unclear legal footing. The original repo has 40 stars, so it's being used, but the license status is ambiguous. Low - No lockfile - package.json exists without package-lock.json or yarn.lock. Builds are not reproducible across environments. Low - Partial CQRS - The README marks CQRS as work-in-progress. Commands are present, but the query side isn't separated, which could confuse developers expecting a complete pattern. Low - Unfinished Docker setup - The Dockerfile exists but is marked WIP. Don't rely on containerized deploys yet.
The Bottom Line
This is a solid learning resource for TypeScript, DDD, and dependency injection patterns, with a clean separation of concerns across layers. It is not production-ready—missing CI, a license, and lockfile, plus incomplete CQRS and Docker work, make it unsuitable for direct deployment. Use it as a reference for structuring your own Express/TypeScript services, not as a drop-in foundation.