# diazzhen06-pixel/irrigation-management-system architecture

> Architecture diagram of the GitHub repository diazzhen06-pixel/irrigation-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/diazzhen06-pixel/irrigation-management-system
- Repository: https://github.com/diazzhen06-pixel/irrigation-management-system

## Overview

This is a PHP/MySQL web system for planning and monitoring manual irrigation operations. Users log in, maintain irrigation areas and schedules, then review generated daily tasks and record field activity; dashboard and accomplishment reporting expose operational results. Cron jobs separately generate tasks, detect missed work, and process SMS notifications. The sampled router, authentication, schedule/area/task controllers, task generator, and views support the main web flow; other controller and cron connections are represented only where README features and the tree identify them.

Main entry points: [`public/index.php`](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/public/index.php) (Web router), [`controllers/IrrigationSchedulesController.php`](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationSchedulesController.php) (Schedule management), [`controllers/AuthController.php`](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/AuthController.php) (Authentication), [`controllers/IrrigationAreasController.php`](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationAreasController.php) (Area management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web access"]
  node_router["Web router<br/>[index.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_user_model["User records<br/>[User.php]"]
  node_login_view["Login screen<br/>[login.php]"]
end

subgraph group_planning["Irrigation planning"]
  node_area_ctrl["Area management"]
  node_area_model["Irrigation areas<br/>[IrrigationArea.php]"]
  node_area_views["Area screens<br/>[index.php]"]
  node_schedule_ctrl["Schedule management"]
  node_schedule_model["Schedules"]
  node_schedule_views["Schedule screens<br/>[index.php]"]
end

subgraph group_operations["Task operations"]
  node_task_ctrl["Task activity"]
  node_task_model["Irrigation tasks<br/>[IrrigationTask.php]"]
  node_task_views["Task screens<br/>[index.php]"]
  node_task_generator["Daily generation<br/>[generate_tasks.php]"]
  node_missed_detector["Missed-task detection"]
end

subgraph group_insight["Monitoring and reports"]
  node_dashboard["Dashboard"]
  node_dashboard_view["Operations overview<br/>[index.php]"]
  node_report["Accomplishment reports"]
  node_report_view["Report screen<br/>[accomplishment.php]"]
  node_alerts["Alerts<br/>[Alert.php]"]
end

subgraph group_runtime["Runtime services"]
  node_audit["Audit logging<br/>[AuditLog.php]"]
  node_audit_helper["Audit helper<br/>[audit_helper.php]"]
  node_sms_job["SMS queue processor<br/>[send_sms.php]"]
  node_sms_helper["SMS sender<br/>[SmsHelper.php]"]
  node_database["Database access<br/>[database.php]"]
end

node_staff(("System users"))
node_mysql[("MySQL database")]

node_staff -->|"requests pages"| node_router
node_router -->|"dispatches login"| node_auth
node_auth -->|"checks credentials"| node_user_model
node_auth -->|"renders"| node_login_view
node_router -->|"dispatches area routes"| node_area_ctrl
node_area_ctrl -->|"manages areas"| node_area_model
node_area_ctrl -->|"renders"| node_area_views
node_router -->|"dispatches schedule routes"| node_schedule_ctrl
node_schedule_ctrl -->|"manages schedules"| node_schedule_model
node_schedule_ctrl -->|"loads area choices"| node_area_model
node_schedule_ctrl -->|"renders"| node_schedule_views
node_router -->|"dispatches task routes"| node_task_ctrl
node_task_ctrl -->|"reads and logs tasks"| node_task_model
node_task_ctrl -->|"renders"| node_task_views
node_task_generator -->|"queries and inserts"| node_database
node_database -->|"executes SQL"| node_mysql
node_router -->|"dispatches dashboard"| node_dashboard
node_dashboard -->|"renders overview"| node_dashboard_view
node_router -->|"dispatches reports"| node_report
node_report -->|"renders report"| node_report_view
node_router -->|"loads audit helper"| node_audit_helper
node_audit_helper -->|"records events"| node_audit
node_missed_detector -->|"creates exceptions"| node_alerts
node_sms_job -.->|"processes notifications"| node_sms_helper

click node_router "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/public/index.php"
click node_auth "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/AuthController.php"
click node_user_model "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/User.php"
click node_login_view "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/auth/login.php"
click node_area_ctrl "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationAreasController.php"
click node_area_model "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/IrrigationArea.php"
click node_area_views "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/irrigation_areas/index.php"
click node_schedule_ctrl "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationSchedulesController.php"
click node_schedule_model "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/IrrigationSchedule.php"
click node_schedule_views "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/irrigation_schedules/index.php"
click node_task_ctrl "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationTasksController.php"
click node_task_model "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/IrrigationTask.php"
click node_task_views "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/irrigation_tasks/index.php"
click node_task_generator "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/cron/generate_tasks.php"
click node_missed_detector "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/cron/detect_missed_tasks.php"
click node_dashboard "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/DashboardController.php"
click node_dashboard_view "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/dashboard/index.php"
click node_report "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/ReportController.php"
click node_report_view "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/reports/accomplishment.php"
click node_alerts "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/Alert.php"
click node_audit "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/AuditLog.php"
click node_audit_helper "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/helpers/audit_helper.php"
click node_sms_job "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/cron/send_sms.php"
click node_sms_helper "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/lib/SmsHelper.php"
click node_database "https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/config/database.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_router,node_auth,node_user_model,node_login_view,node_staff toneBlue
class node_area_ctrl,node_area_model,node_area_views,node_schedule_ctrl,node_schedule_model,node_schedule_views,node_mysql toneAmber
class node_task_ctrl,node_task_model,node_task_views,node_task_generator,node_missed_detector toneMint
class node_dashboard,node_dashboard_view,node_report,node_report_view,node_alerts toneRose
class node_audit,node_audit_helper,node_sms_job,node_sms_helper,node_database toneIndigo
```

## Components

### Web access

- [Web router](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/public/index.php): `public/index.php`
- [Authentication](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/AuthController.php): `controllers/AuthController.php`
- [User records](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/User.php): `models/User.php`
- [Login screen](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/auth/login.php): `views/auth/login.php`

### Irrigation planning

- [Area management](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationAreasController.php): `controllers/IrrigationAreasController.php`
- [Irrigation areas](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/IrrigationArea.php): `models/IrrigationArea.php`
- [Area screens](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/irrigation_areas/index.php): `views/irrigation_areas/index.php`
- [Schedule management](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationSchedulesController.php): `controllers/IrrigationSchedulesController.php`
- [Schedules](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/IrrigationSchedule.php): `models/IrrigationSchedule.php`
- [Schedule screens](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/irrigation_schedules/index.php): `views/irrigation_schedules/index.php`

### Task operations

- [Task activity](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/IrrigationTasksController.php): `controllers/IrrigationTasksController.php`
- [Irrigation tasks](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/IrrigationTask.php): `models/IrrigationTask.php`
- [Task screens](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/irrigation_tasks/index.php): `views/irrigation_tasks/index.php`
- [Daily generation](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/cron/generate_tasks.php): `cron/generate_tasks.php`
- [Missed-task detection](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/cron/detect_missed_tasks.php): `cron/detect_missed_tasks.php`

### Monitoring and reports

- [Dashboard](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/DashboardController.php): `controllers/DashboardController.php`
- [Operations overview](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/dashboard/index.php): `views/dashboard/index.php`
- [Accomplishment reports](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/controllers/ReportController.php): `controllers/ReportController.php`
- [Report screen](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/views/reports/accomplishment.php): `views/reports/accomplishment.php`
- [Alerts](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/Alert.php): `models/Alert.php`

### Runtime services

- [Audit logging](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/models/AuditLog.php): `models/AuditLog.php`
- [Audit helper](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/helpers/audit_helper.php): `helpers/audit_helper.php`
- [SMS queue processor](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/cron/send_sms.php): `cron/send_sms.php`
- [SMS sender](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/lib/SmsHelper.php): `lib/SmsHelper.php`
- [Database access](https://github.com/diazzhen06-pixel/irrigation-management-system/blob/main/config/database.php): `config/database.php`

### Other components

- **System users**
- **MySQL database**

## Connections

- System users → Web router: requests pages
- Web router → Authentication: dispatches login
- Authentication → User records: checks credentials
- Authentication → Login screen: renders
- Web router → Area management: dispatches area routes
- Area management → Irrigation areas: manages areas
- Area management → Area screens: renders
- Web router → Schedule management: dispatches schedule routes
- Schedule management → Schedules: manages schedules
- Schedule management → Irrigation areas: loads area choices
- Schedule management → Schedule screens: renders
- Web router → Task activity: dispatches task routes
- Task activity → Irrigation tasks: reads and logs tasks
- Task activity → Task screens: renders
- Daily generation → Database access: queries and inserts
- Database access → MySQL database: executes SQL
- Web router → Dashboard: dispatches dashboard
- Dashboard → Operations overview: renders overview
- Web router → Accomplishment reports: dispatches reports
- Accomplishment reports → Report screen: renders report
- Web router → Audit helper: loads audit helper
- Audit helper → Audit logging: records events
- Missed-task detection → Alerts: creates exceptions
- SMS queue processor → SMS sender: processes notifications
