# hamdisiwar350-lang/reclaonas architecture

> Architecture diagram of the GitHub repository hamdisiwar350-lang/reclaonas, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hamdisiwar350-lang/reclaonas
- Repository: https://github.com/hamdisiwar350-lang/reclaonas

## Overview

ReclaOnas is an ONAS web application for citizen complaints and professional intervention management. Citizens register or sign in, submit geographically located complaints with optional photos, and track progress; administrators manage citizens and teams, assign complaints, and teams update status and record intervention reports with photo evidence. The graph follows the documented front-controller routes and sampled controller/model calls. Some UI and service-worker behavior is represented only where the supplied excerpts or README support it.

Main entry points: [`index.php`](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/index.php) (Action router), [`controllers/EmployerController.php`](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/EmployerController.php) (Team operations), [`models/ReclamationModel.php`](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/ReclamationModel.php) (Complaint records), [`config/database.php`](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/config/database.php) (MySQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and security"]
  node_router["Action router<br/>[index.php]"]
  node_security["Session security<br/>[security.php]"]
  node_home["Portal home<br/>[accueil.php]"]
  node_service_worker["Service worker<br/>[sw.js]"]
end

subgraph group_citizens["Citizen services"]
  node_citizen_ctrl["Citizen accounts"]
  node_citizen_model["Citizen records<br/>[CitoyenModel.php]"]
  node_citizen_views["Citizen screens"]
  node_complaint_ctrl["Complaint handling"]
  node_complaint_views["Complaint screens"]
end

subgraph group_operations["Operations management"]
  node_employer_ctrl["Team operations"]
  node_admin_ctrl["Administration"]
  node_employer_model["Employer records<br/>[EmployerModel.php]"]
  node_admin_model["Admin records<br/>[AdminModel.php]"]
  node_staff_views["Staff dashboards"]
end

subgraph group_persistence["Data and files"]
  node_complaint_model["Complaint records"]
  node_database[("MySQL database<br/>[database.php]")]
  node_uploads[("Uploaded evidence")]
end

node_citizen(("Citizen"))
node_staff(("ONAS staff"))

node_citizen -->|"opens portal"| node_home
node_staff -->|"opens portal"| node_home
node_home -->|"registers"| node_service_worker
node_router -->|"loads security"| node_security
node_router -->|"serves home"| node_home
node_router -->|"routes account actions"| node_citizen_ctrl
node_router -->|"routes complaint actions"| node_complaint_ctrl
node_router -->|"routes staff actions"| node_employer_ctrl
node_router -->|"routes admin actions"| node_admin_ctrl
node_citizen_ctrl -->|"reads and creates"| node_citizen_model
node_citizen_ctrl -->|"renders account screens"| node_citizen_views
node_citizen_ctrl -->|"loads citizen complaints"| node_complaint_model
node_citizen_ctrl -->|"renders dashboard"| node_citizen_views
node_complaint_ctrl -->|"creates and edits"| node_complaint_model
node_complaint_ctrl -->|"queries complaint list"| node_database
node_complaint_ctrl -->|"renders complaint forms"| node_complaint_views
node_complaint_ctrl -->|"writes complaint photos"| node_uploads
node_employer_ctrl -->|"assigns and lists complaints"| node_complaint_model
node_employer_ctrl -->|"authenticates and records interventions"| node_employer_model
node_employer_ctrl -->|"loads team data"| node_admin_model
node_employer_ctrl -->|"renders dashboards"| node_staff_views
node_employer_ctrl -->|"writes intervention photos"| node_uploads
node_admin_ctrl -->|"manages citizens and teams"| node_admin_model
node_admin_ctrl -->|"loads complaint data"| node_complaint_model
node_admin_ctrl -->|"renders admin screens"| node_staff_views
node_citizen_model -->|"queries citizens"| node_database
node_admin_model -->|"queries admin records"| node_database
node_employer_model -->|"queries employer records"| node_database
node_complaint_model -->|"queries complaints"| node_database
node_database -->|"stores complaint state"| node_complaint_model

click node_router "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/index.php"
click node_security "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/config/security.php"
click node_home "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/views/accueil.php"
click node_citizen_ctrl "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/CitoyenController.php"
click node_citizen_model "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/CitoyenModel.php"
click node_citizen_views "https://github.com/hamdisiwar350-lang/reclaonas/tree/main/views"
click node_complaint_ctrl "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/ReclamationController.php"
click node_complaint_views "https://github.com/hamdisiwar350-lang/reclaonas/tree/main/views"
click node_employer_ctrl "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/EmployerController.php"
click node_admin_ctrl "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/AdminController.php"
click node_employer_model "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/EmployerModel.php"
click node_admin_model "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/AdminModel.php"
click node_staff_views "https://github.com/hamdisiwar350-lang/reclaonas/tree/main/views"
click node_complaint_model "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/ReclamationModel.php"
click node_database "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/config/database.php"
click node_uploads "https://github.com/hamdisiwar350-lang/reclaonas/tree/main/uploads"
click node_service_worker "https://github.com/hamdisiwar350-lang/reclaonas/blob/main/sw.js"

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_security,node_home,node_service_worker toneBlue
class node_citizen_ctrl,node_citizen_model,node_citizen_views,node_complaint_ctrl,node_complaint_views toneAmber
class node_employer_ctrl,node_admin_ctrl,node_employer_model,node_admin_model,node_staff_views toneMint
class node_complaint_model,node_database,node_uploads toneRose
class node_citizen,node_staff toneIndigo
```

## Components

### Web entry and security

- [Action router](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/index.php): `index.php`
- [Session security](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/config/security.php): `config/security.php`
- [Portal home](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/views/accueil.php): `views/accueil.php`
- [Service worker](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/sw.js): `sw.js`

### Citizen services

- [Citizen accounts](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/CitoyenController.php): `controllers/CitoyenController.php`
- [Citizen records](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/CitoyenModel.php): `models/CitoyenModel.php`
- [Citizen screens](https://github.com/hamdisiwar350-lang/reclaonas/tree/main/views): `views`
- [Complaint handling](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/ReclamationController.php): `controllers/ReclamationController.php`
- [Complaint screens](https://github.com/hamdisiwar350-lang/reclaonas/tree/main/views): `views`

### Operations management

- [Team operations](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/EmployerController.php): `controllers/EmployerController.php`
- [Administration](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/controllers/AdminController.php): `controllers/AdminController.php`
- [Employer records](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/EmployerModel.php): `models/EmployerModel.php`
- [Admin records](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/AdminModel.php): `models/AdminModel.php`
- [Staff dashboards](https://github.com/hamdisiwar350-lang/reclaonas/tree/main/views): `views`

### Data and files

- [Complaint records](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/models/ReclamationModel.php): `models/ReclamationModel.php`
- [MySQL database](https://github.com/hamdisiwar350-lang/reclaonas/blob/main/config/database.php): `config/database.php`
- [Uploaded evidence](https://github.com/hamdisiwar350-lang/reclaonas/tree/main/uploads): `uploads`

### Other components

- **Citizen**
- **ONAS staff**

## Connections

- Citizen → Portal home: opens portal (evidence: `README.md`)
- ONAS staff → Portal home: opens portal (evidence: `README.md`)
- Portal home → Service worker: registers (evidence: `views/accueil.php`)
- Action router → Session security: loads security (evidence: `index.php`)
- Action router → Portal home: serves home (evidence: `index.php`)
- Action router → Citizen accounts: routes account actions (evidence: `index.php`)
- Action router → Complaint handling: routes complaint actions (evidence: `index.php`)
- Action router → Team operations: routes staff actions (evidence: `index.php`)
- Action router → Administration: routes admin actions (evidence: `index.php`)
- Citizen accounts → Citizen records: reads and creates (evidence: `controllers/CitoyenController.php`)
- Citizen accounts → Citizen screens: renders account screens (evidence: `controllers/CitoyenController.php`)
- Citizen accounts → Complaint records: loads citizen complaints (evidence: `controllers/CitoyenController.php`)
- Citizen accounts → Citizen screens: renders dashboard (evidence: `controllers/CitoyenController.php`)
- Complaint handling → Complaint records: creates and edits (evidence: `controllers/ReclamationController.php`)
- Complaint handling → MySQL database: queries complaint list (evidence: `controllers/ReclamationController.php`)
- Complaint handling → Complaint screens: renders complaint forms (evidence: `controllers/ReclamationController.php`)
- Complaint handling → Uploaded evidence: writes complaint photos (evidence: `controllers/ReclamationController.php`)
- Team operations → Complaint records: assigns and lists complaints (evidence: `controllers/EmployerController.php`)
- Team operations → Employer records: authenticates and records interventions (evidence: `controllers/EmployerController.php`)
- Team operations → Admin records: loads team data (evidence: `controllers/EmployerController.php`)
- Team operations → Staff dashboards: renders dashboards (evidence: `controllers/EmployerController.php`)
- Team operations → Uploaded evidence: writes intervention photos (evidence: `controllers/EmployerController.php`)
- Administration → Admin records: manages citizens and teams (evidence: `controllers/AdminController.php`)
- Administration → Complaint records: loads complaint data (evidence: `controllers/AdminController.php`)
- Administration → Staff dashboards: renders admin screens (evidence: `controllers/AdminController.php`)
- Citizen records → MySQL database: queries citizens (evidence: `models/CitoyenModel.php`)
- Admin records → MySQL database: queries admin records (evidence: `models/AdminModel.php`)
- Employer records → MySQL database: queries employer records (evidence: `models/EmployerModel.php`)
- Complaint records → MySQL database: queries complaints (evidence: `models/ReclamationModel.php`)
- MySQL database → Complaint records: stores complaint state (evidence: `models/ReclamationModel.php`)
