How shellrean-dev/exo-cbt-service works
Main System Components
• Frontend/UI Layer:
• Public assets (under “public”) include stylesheets, images, installer assets, and the index.php file.
• Backend/API Layer:
• “app/Http/Controllers” contains multiple controllers organized by API version (v1, v2, v3) plus additional gateway and system controllers. This indicates RESTful endpoints for exam operations (auth, exam sessions, user management, exam content, etc.).
• “routes” directory holds the API routing definitions (api.php, api_v2.php, api_v3.php) as well as gateway and web routes, showing clear separation of API access.
• Business Logic & Service Layer:
• “app/Services” and “app/Repositories” directories encapsulate the core business logic (services for exam handling, backup, file processing, exam question handling [multiple types]) and data interactions.
• Other folders like “app/Actions”, “app/Console” and “app/Imports/Exports” indicate additional command-line utilities and import/export functionalities.
• Data / Persistence Layer:
• “database/migrations”, “database/seeds” and “database/factories” represent the database schema, data initialization, and test data creation.
• The “config/database.php” file shows the database configuration.
• Caching and External/Offline Capabilities:
• The “app/Cache” folder and configuration for caching show that caching is part of the design.
• The offline capability is hinted by the README and use of backup functions (see app/ExoBackup.php and BackupController).
Architectural Patterns and Relationships
• MVC and Layered Architecture: Controllers handle requests/responses, Services and Repositories process business logic and data access, while Models (in “app” and “app/Models”) represent the domain entities.
• API Versioning: Multiple API versions (v1, v2, v3) indicate an evolving interface for various clients or exam conditions, and gateway controllers further abstract interactions with certain systems.
• Separation of Concerns: Directories for imports, exports, cache handling, and scheduling (e.g., “app/SesiSchedule.php”) illustrate the adherence to modular design principles.
• Command & Background Processing: Console commands (in “app/Console/Commands/Exo”) are used for administrative and backend tasks like installations, repository creation, or service setup.
• Client Interface: Represent both web and potentially mobile exam interfaces drawing from Vue components and Blade templates.
• Caching & File Storage: Represent caching (app/Cache) and file storage (storage/app, public/download) as auxiliary components that support performance and offline capabilities.
• Requests moving from the front end to the API controllers.
• Controllers invoking services which in turn interact with repositories (data layer).
• Output or data being sent to the client.
• External interactions or administrative flows (console commands, backup processes).