How skinatech/orfeong_backend works
Main Components
• API Layer: Located in the “api” directory, this component contains its own controllers, models, views (including version modules such as “api/modules/version1”), and configuration files. It is responsible for exposing REST endpoints and handling specific document management tasks (for example, radication, notification, external client interactions, dynamic forms, etc.).
• Backend: Found in the “backend” directory, this is the administrative or management interface. It follows the MVC pattern with distinct controllers, models, views, and configuration files. It likely handles administration, configuration, and management tasks and integrates heavily with the common components.
• Frontend: Placed in the “frontend” directory, this component serves the public or end-user interface (e.g., for registration of PQRS, consultation, or displaying documents). It too follows MVC, with its own controllers, models, views, and web assets.
• Common Components: The “common” directory holds shared business logic, configuration files, models (such as the User model and login forms), shared fixtures, and widgets that are used across API, frontend, and backend.
• Console: The “console” directory encapsulates CLI-based operations such as migrations, scheduled tasks, and any command-line utilities required for deployment or maintenance.
• Deployment and Infrastructure: Beyond the code itself, notice that there are Dockerfiles (in api, backend and frontend), Vagrant configurations, and docker-compose.yml – these indicate containerization and virtualized development environments which are key to deployment.
• Documentation & Testing: Several testing directories (under tests for api, frontend, and backend) and documentation paths (like “api/documentacion” and “vagrant” for provisioning) should be factored in to show integration and quality control aspects.
Relationships and Interactions
• The UI (both backend administrative UI and frontend public UI) interacts with their respective controllers but also shares common logic and models.
• The API layer exposes endpoints (e.g., via its modules in “version1”) which may be consumed by external clients or even by the frontend when asynchronous data exchange is needed.
• All three layers (api, backend, frontend) rely on the shared “common” components for consistent business rules, configurations, and data models.
• The console application manages the database migrations and other background tasks that ensure the system remains synchronized.
Architectural Patterns and Design Principles
• MVC Pattern: Since the project is developed using the Yii2 framework, each layer (api, backend, frontend) adheres to the Model-View-Controller pattern for separation of concerns.
• Modular Design: The API’s use of modules (e.g., “version1”) indicates a modular architecture that facilitates versioning and clear separation of business functionalities.
• Layered Separation: There is a clear separation between presentation (frontend and backend), business logic (common and models), and data operations (migrations, database interactions).
• Containerization & Virtualization: Docker and Vagrant configurations show an orientation towards modern deployment practices.
Relevant Technologies and Libraries
• Yii2 Framework (PHP-based)
• Docker and Vagrant (for containerized and virtualized setups)
• Codeception (for testing, seen in the test directories)
• Likely relational database systems (MySQL/MariaDB, as suggested by scripts and documentation files)
• A broad set of web assets (CSS, JS, fonts used for frontend UI – e.g., Font Awesome, Google Fonts, etc.)