02-modular-project-structure

Reorganize backend code into domain-driven modules with per-domain controllers, services, repositories, and tests.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/kennypallchizaca-coder/agentic-full-stack-skills --skill 02-modular-project-structure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 02-modular-project-structure
Source: https://github.com/kennypallchizaca-coder/agentic-full-stack-skills/tree/main/skills-backend/02-modular-project-structure
Command: npx skills add https://github.com/kennypallchizaca-coder/agentic-full-stack-skills --skill 02-modular-project-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

EN: A domain-first backend structure clarifies boundaries so a teammate can open a domain folder (e.g., catalog, billing, identity, notifications) and immediately understand where requests enter, where business rules live, where data access happens, and where tests belong. ES: Un backend orientado a dominios clarifica las fronteras para que un compañero pueda abrir una carpeta de dominio (por ejemplo, catalogo, facturación, identidad, notificaciones) e entender de inmediato dónde entran las solicitudes, dónde viven las reglas de negocio, dónde ocurre el acceso a datos y dónde pertenecen las pruebas.

Core Features & Use Cases

  • Per-domain module with a clear entry point and public boundary.
  • Keeps controller/handler, service/use-case, repository, DTOs, entities, and tests together in the same domain.
  • Supports scalable depth by adding transport/, application/, domain/, and infrastructure/ subfolders as the project grows.

Quick Start

Create one folder per business area under the source root (e.g., src/modules/ or src/features/) and place the domain's controller, service, repository, DTOs, entities, and tests beside each other.

Frequently Asked Questions about 02-modular-project-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize a backend by domain for scalable clarity?

To organize a backend by domain, create one folder per business area under the source root and place its controllers, services, repositories, DTOs, entities, and tests together to enforce clear module boundaries and scalable clarity.

What is domain-driven modular architecture in a backend project?

Domain-driven modular architecture is a structure that clarifies boundaries by keeping all related controllers, services, repositories, and tests in a single domain folder, allowing teammates to immediately understand where requests enter and business rules live.

How do I reorganize a monolith into domain-per-domain module structures?

Reorganize a monolith into domain-per-domain modules by creating a folder for each business domain with a single public entry point, grouping transport, application, domain, and infrastructure subfolders to enforce strict cross-cutting boundaries.

Can I use a single public entry point per domain in backend module scaffolding?

Yes, backend module scaffolding can enforce a single public entry point per domain, ensuring that all external requests route through one designated boundary while keeping internal services and repositories encapsulated.

When do I need to add transport, application, domain, and infrastructure subfolders?

You need to add transport, application, domain, and infrastructure subfolders when your project grows in complexity, allowing scalable depth by further separating request handling, business rules, and data access within each domain module.

What's the best way to separate cross-cutting concerns in a domain-first backend?

The best way to separate cross-cutting concerns in a domain-first backend is to keep them in shared layers outside the domain modules, ensuring each domain folder only contains its specific controllers, services, repositories, and tests.