How neuharthr/fleetco works
Main Components
• User Interface (UI) Layer: This includes all PHP pages (login.php, dashboard files, and hundreds of view/edit/add templates), CSS files (pagestyles, styles directories), JavaScript files (in include, plugins such as jQuery, bootstrap, and others), and HTML templates (found in the “templates” folder).
• Business Logic Layer: Represented by the “classes” directory (which contains classes for pages, controls, search functionality, report pages, etc.), “include” folder (which holds shared functions, configuration files, event handlers, and security controls) and additional handlers (such as buttonhandler.php, autofillfields.php, etc.).
• Data Access Layer: This includes the “connections” folder (with ADOConnection.php, ConnectionManager.php and all the specialized connection drivers for MySQL, MSSQL, PDO etc.), “dal” (data access layer) files, and dbcommon.php.
• Database: The application depends on MySQL for persistence. The provided SQL dump (mysql-dump-with dummy-data.sql) serves to initialize the database schema and sample data.
• External Libraries and Integrations: There are integrations with PHPMailer (for email), PHPExcel (for spreadsheet related features), and DomPDF (to generate PDFs) among others.
Out Component Interactions
• The User Interface layer receives requests from the user (login, CRUD operations for fueling, maintenance, inventory, etc.).
• These UI components call the business logic layer (via controller pages and included classes) to process requests – for example, using search controls, listing and reporting modules.
• Business logic components interact with the data access layer to execute SQL queries, as orchestrated by the connection classes or the DAL.
• Data retrieved from the database is processed and then returned to the UI for display or further actions.
• Additional integrations (like PDF generation or Excel export) are triggered from the business logic layer which calls the appropriate external library functions.
Architectural Patterns and Design Principles
• MVC-like Pattern (without a strict framework): Although not built on a modern MVC framework, the separation of presentation (templates/pages), business logic (classes and includes) and data access (connections/DAL) is evident.
• Layered Architecture: Clear separation between front-end presentation, business processing and database interaction.
• Reusability & Extensibility: The abundance of control classes, modular templates, and loosely coupled components (for example, changeable connection settings via ConnectionManager.php) suggest that the design supports maintainability and extensibility.
• Use of External Libraries: Specialized libraries like PHPMailer, DomPDF, and PHPExcel are integrated to extend functionality without reinventing the wheel.