How udistrital/iris works
Main Components
a. Client/Frontend Interface: Represented by files like index.php, login.php, profile.php, kb (knowledge base) directories, and assets (CSS, images, JavaScript). This is the user-facing interface where customers submit and view tickets.
b. Staff/Administration Interface: The “scp” directory, which contains a separate set of pages (dashboard, tickets, reports, user management, etc.) and assets (CSS, JS) to enable support staff tasks.
c. API/Background Processes: The “api” folder (with endpoints, HTTP handlers, cron.php) and CLI modules (in include/cli) manage automated processes, integrations, and scheduled tasks.
e. Plugin and Extensibility Modules: The “include/plugins” directory holds additional packaged functionality (such as LDAP, OAuth2, storage, etc.) that integrates into the system.
f. Infrastructure & Configuration: Configuration files in “.elasticbeanstalk”, “.ebextensions”, and “include/config” suggest deployment settings (possibly on AWS Elastic Beanstalk) along with database and environment configurations.
g. External Libraries: Libraries such as laminas-mail, mpdf, and various PEAR components support email handling, PDF generation, and other auxiliary functions.
h. Auxiliary Scripts and CLI Tools: Files in “include/cli” and maintenance/upgrader scripts (in include/upgrader and its streams) manage maintenance, upgrades, and batch operations.
Relationships and Interactions
a. Web Server → PHP Frontend: Users access the system via a web server. Requests hit entry point pages (index.php, login.php, etc.) which delegate to the core libraries in “include”.
b. Frontend ↔ API: The client’s interactions may trigger API requests (via ajax.php in “include/ajax*” or the api folder) for dynamic content and ticket management.
c. Staff Panel Interaction: Administrators or support staff access functionality through the “scp” directory. These pages utilize similar underlying business logic, but serve different functions (e.g., tickets management, configuration, reporting).
d. Background and Cron Jobs: There are API/cron endpoints (api/cron.php) and CLI modules (include/cli) that are scheduled to perform tasks such as email fetching, ticket processing, and system maintenance.
e. Plugin/Extension Communication: Plugins interact with core systems by following defined interfaces and hooks present in the “include” folder, thereby extending authentication, storage, and other features.
f. Integration with External Services: The presence of email libraries (laminas-mail) and potential integrations (e.g., with LDAP, OAuth2) imply external connections, like email servers and directory services.
Architectural Patterns and Design Principals
a. Modularization: The system is decomposed into modular components (frontend, backend, API, CLI tools) which promotes separation of concerns.
b. Extensibility: A well-defined plugin architecture allows for additional functionality to be plugged into the core system.
c. Layered Design: There is a layered separation between presentation (templates in “scp” and client directories), business logic (classes in “include”), and infrastructure (configuration, deployment).
d. Reusability: Common functionalities (authentication, formatting, mail handling) are abstracted in separate classes, often utilizing third-party libraries.