How alvaro-chambi/back works
Main Components
• HTTP/API Layer – Representing the public endpoints that interact with internal services. In the project, these are the controllers located under the “app/Http/Controllers” directory. Note that you have multiple subdirectories (e.g., API/Gen, API/Reports, API/Lookup, etc.) organized by domain or responsibility.
• Service/Business Logic Layer – Contains the core processes and rules. Check out the “app/Services” directory (e.g., CreateRaiApplicationService, ProcedureInspectionService) and the “app/StateMachines” directory that encapsulates distinct workflows like for IRAP and RAI. These describe the domain logic and workflows.
• Repository/Data Access Layer – This layer is abstracted in “app/Repositories” where the application’s repositories interface with the “app/Models” (and by extension, the database) to persist and retrieve data.
• External Services and Infrastructure – Include components like Passport (for API authentication), Laravel’s Task Scheduling, file storage (the “storage” directory and the public storage link), and third-party tools (Telescope, Swagger, Larastan, and IDE helper tools). Even though these may be initially configured outside the main application code, they play a critical role in authentication, debugging, and auxiliary operations.
Emphasized Architectural Patterns and Design Principles
• Layered Architecture: Make it explicit that there are clear separations between Controllers, Services (Business Logic), Repositories (Data Access), and the Database.
• Domain-Driven Design Elements: The existence of state machines and services (with “Ruleset” files and “State” classes) indicates a business process that adapts to state and workflow rules.
• Dependency Injection and Inter-module Communication: Note how Controllers invoke Services which, in turn, rely on Repositories, encouraging clear separations of concern.
• Extensibility: The heavy use of modular directories (e.g., separate folders for API, Domain, and Lookup functionalities) shows the system is designed for scalability and maintainability.