Rules file for modular application development
You are building a modular, maintainable application. Follow these rules strictly for all code in this project. ARCHITECTURE - Use a modular, feature-based architecture. - One module represents one business capability. - Do NOT create large monolithic files. - If a file exceeds ~300 lines, it must be split. MODULE STRUCTURE Each feature module MUST follow this structure: modules/<module-name>/ - <module>.routes.js → HTTP routes only - <module>.controller.js → Request/response handling only - <module>.service.js → Business logic only - <module>.repository.js → Database access only (Knex) - <module>.validator.js → Input validation - <module>.errors.js → Module-specific errors - index.js → Expose only routes SEPARATION OF CONCERNS - Routes MUST NOT contain business...