module-architecture

Implement NestJS feature modules with layered architecture injection rules.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/Zoppy-crm/.github --skill module-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: module-architecture
Source: https://github.com/Zoppy-crm/.github/tree/main/skills/backend/module-architecture
Command: npx skills add https://github.com/Zoppy-crm/.github --skill module-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers design and enforce correct module boundaries in NestJS projects by showing how to structure feature modules and manage injection rules across layers.

Core Features & Use Cases

  • Feature Module Pattern: One module per bounded context with a reference implementation like UploadDataModule and guidance on module structure.
  • Layered Architecture Rules: Clear guidelines on which layer can inject which and how to register providers in ApplicationModule.
  • Use Case: Organize a large monolith by isolating features into modules to improve maintainability and testability.

Quick Start

Create a dedicated NestJS module per bounded context and export only the public applications via the module exports.

Frequently Asked Questions about module-architecture

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

FAQPage Schema
How do I structure NestJS feature modules within a bounded context?

NestJS feature modules within a bounded context are structured by creating one dedicated module per feature, isolating providers, and exporting only public applications to maintain strict architectural boundaries.

What are the dependency injection rules for NestJS layered architecture?

NestJS layered architecture injection rules dictate which specific layers can inject dependencies and when to register providers directly in the ApplicationModule to prevent cross-boundary coupling and maintain module isolation.

When do I need to register providers in the NestJS ApplicationModule?

You need to register providers in the NestJS ApplicationModule when following layered architecture rules to explicitly control dependency injection scope and ensure providers are available to the correct feature layers.

What is the best way to export only public applications from a NestJS module?

The best way to export public applications from a NestJS module is to use the module's exports array exclusively for application services, keeping internal domain providers private to enforce bounded context encapsulation.

Can I use bounded context modules to organize a large NestJS monolith?

Yes, you can use bounded context modules to organize a large NestJS monolith by isolating features into distinct modules, which significantly improves overall maintainability and testability without requiring microservices.

Why does my NestJS feature module structure cause circular dependency issues?

NestJS feature module circular dependency issues occur when layered architecture rules are violated and modules inject across bounded contexts, requiring you to restrict exports to public applications and restructure provider registration.