How itflow-org/itflow works
Project Components
a. User Interfaces:
• Admin Panel – the numerous “admin_*.php” files along with subdirectories (for example, files in the “post/admin” folder) present an interface for managing settings, clients, tickets, invoices, and system configuration.
• Client Portal – the “client” directory, including login pages, dashboards, and ticket management files, supports self-service actions for clients.
• Guest/General Interface – pages like “index.php”, “login.php”, “guest/” similarly hint at public or unauthenticated entry points.
b. API Layer:
• The “api” folder (with version subdirectory “api/v1”) clearly establishes REST endpoints for assets, clients, tickets, invoices, etc. This API is likely consumed by AJAX calls on the frontend and may also support integrations.
c. AJAX Endpoints:
• The “ajax” directory shows many endpoints (like ajax/ajax_ticket_edit.php, ajax/ajax_asset_details.php) that are used for asynchronous functionality in the web‐app.
d. Data & Persistence:
• There is “db.sql” indicating the database structure (most likely a MySQL database) that stores data for all modules.
e. Background Jobs & Scripts:
• The “scripts” folder and specific cron job files (e.g., “cron_mail_queue.php”, “cron_ticket_email_parser.php”) handle asynchronous tasks, data updates, and notifications.
f. Plugins and External Libraries:
• The “plugins” directory contains many third‐party libraries (e.g., PHPMailer, TCPDF, Select2, TinyMCE, FullCalendar, and stripe-php) which are essential for email handling, PDF generation, UI enhancements, and payment processing.
g. Configuration and Deployment:
• Files like “.github” workflows, “.htaccess”, and “LICENSE” as well as the changelog/documentation indicate CI/CD, security rules, and licensing management.
Mapping Component Relationships
• Web Clients (Admin, Client, Guest) – Users access distinct frontend interfaces via the web server.
• Web Server Layer (PHP) – The PHP scripts (both traditional page loads and AJAX endpoints) are executed by a web server (such as Apache or Nginx) and they handle routing and business logic.
• API Layer – Requests from the interfaces or external systems (e.g., for mobile apps or integrations) are routed through the API endpoints under “api/v1”, following REST principles.
• Database – All modules (whether via regular page requests, API calls, or cron jobs) interact with a central database whose schema is defined in “db.sql”.
• Background Jobs – Scheduled scripts (in the “scripts” directory) run periodically, handling tasks such as mail queue processing, certificate and domain updates, and ticket email parsing.
• Plugins Libraries – These support additional functions (like sending emails via PHPMailer, generating PDFs with TCPDF, or interacting with Stripe for payments) and are incorporated into various parts of the codebase.
Architectural Patterns
• Although not strictly following a modern MVC framework, note that ITFlow separates out different concerns by having specific directories/files for admin, client, API, AJAX, and background processing.
• There is an implicit layering where presentation (HTML/JS/CSS in “client”, “modals”, “includes”), business logic (PHP files/handlers for admin and user operations), and data persistence (SQL database) are clearly discernible.
• Use of versioned API endpoints and dedicated cron scripts are patterns that add modularity to the otherwise monolithic structure.