# ciannnnnn/smart-iba architecture

> Architecture diagram of the GitHub repository ciannnnnn/smart-iba, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ciannnnnn/smart-iba
- Repository: https://github.com/ciannnnnn/smart-iba

## Overview

Smart-Iba is a PHP admin panel for managing municipal services and public information. An administrator signs in, then uses the dashboard and domain pages to review or update users, service requests, reports, scholarships, events, news, and office contacts. The pages render through a shared admin layout and use Firebase-backed operations where enabled; login also uses a PDO/MySQL database. The excerpts establish the main page-to-service calls, but several modules are only partially shown, so their detailed operations are not expanded here.

Main entry points: [`includes/firebase_config.php`](https://github.com/ciannnnnn/smart-iba/blob/main/includes/firebase_config.php) (Firebase integration), [`includes/admin_layout.php`](https://github.com/ciannnnnn/smart-iba/blob/main/includes/admin_layout.php) (Admin layout), [`login.php`](https://github.com/ciannnnnn/smart-iba/blob/main/login.php) (Admin login), [`index.php`](https://github.com/ciannnnnn/smart-iba/blob/main/index.php) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and dashboard"]
  node_login["Admin login<br/>[login.php]"]
  node_dashboard["Dashboard<br/>[index.php]"]
  node_layout["Admin layout<br/>[admin_layout.php]"]
  node_users["User management<br/>[users.php]"]
end

subgraph group_content["Public information"]
  node_events["Event management<br/>[event.php]"]
  node_news["News management<br/>[news.php]"]
  node_offices["Office directory"]
end

subgraph group_services["Requests and reports"]
  node_requests["Service requests<br/>[manage_request.php]"]
  node_reports["Citizen reports<br/>[reports.php]"]
  node_scholarships["Scholarships<br/>[scholarship.php]"]
end

subgraph group_platform["Data services"]
  node_firebase["Firebase integration"]
  node_firestore[("Firestore")]
  node_mysql[("MySQL")]
end

node_admin(("Administrator"))

node_admin -.->|"signs in"| node_login
node_login -.->|"checks credentials"| node_mysql
node_dashboard -->|"redirects unauthenticated"| node_login
node_login -->|"uses PDO"| node_mysql
node_dashboard -->|"loads counts"| node_firebase
node_dashboard -.->|"renders page"| node_layout
node_users -.->|"renders page"| node_layout
node_users -.->|"uses Firebase"| node_firebase
node_events -->|"loads and updates"| node_firebase
node_events -.->|"renders page"| node_layout
node_news -->|"sends notifications"| node_firebase
node_news -.->|"renders page"| node_layout
node_offices -->|"reads and updates"| node_firebase
node_offices -->|"renders page"| node_layout
node_requests -->|"updates requests"| node_firebase
node_requests -->|"renders page"| node_layout
node_reports -->|"updates reports"| node_firebase
node_reports -.->|"renders page"| node_layout
node_scholarships -->|"manages applications"| node_firebase
node_scholarships -.->|"renders page"| node_layout
node_firebase -->|"reads and writes"| node_firestore
node_firebase -->|"sends push alerts"| node_admin
node_login -->|"authenticates via"| node_mysql

click node_login "https://github.com/ciannnnnn/smart-iba/blob/main/login.php"
click node_dashboard "https://github.com/ciannnnnn/smart-iba/blob/main/index.php"
click node_layout "https://github.com/ciannnnnn/smart-iba/blob/main/includes/admin_layout.php"
click node_users "https://github.com/ciannnnnn/smart-iba/blob/main/users.php"
click node_events "https://github.com/ciannnnnn/smart-iba/blob/main/event.php"
click node_news "https://github.com/ciannnnnn/smart-iba/blob/main/news.php"
click node_offices "https://github.com/ciannnnnn/smart-iba/blob/main/office_directory.php"
click node_requests "https://github.com/ciannnnnn/smart-iba/blob/main/manage_request.php"
click node_reports "https://github.com/ciannnnnn/smart-iba/blob/main/reports.php"
click node_scholarships "https://github.com/ciannnnnn/smart-iba/blob/main/scholarship.php"
click node_firebase "https://github.com/ciannnnnn/smart-iba/blob/main/includes/firebase_config.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_login,node_dashboard,node_layout,node_users toneBlue
class node_events,node_news,node_offices toneAmber
class node_requests,node_reports,node_scholarships toneMint
class node_firebase,node_firestore,node_mysql toneRose
class node_admin toneIndigo
```

## Components

### Access and dashboard

- [Admin login](https://github.com/ciannnnnn/smart-iba/blob/main/login.php): `login.php`
- [Dashboard](https://github.com/ciannnnnn/smart-iba/blob/main/index.php): `index.php`
- [Admin layout](https://github.com/ciannnnnn/smart-iba/blob/main/includes/admin_layout.php): `includes/admin_layout.php`
- [User management](https://github.com/ciannnnnn/smart-iba/blob/main/users.php): `users.php`

### Public information

- [Event management](https://github.com/ciannnnnn/smart-iba/blob/main/event.php): `event.php`
- [News management](https://github.com/ciannnnnn/smart-iba/blob/main/news.php): `news.php`
- [Office directory](https://github.com/ciannnnnn/smart-iba/blob/main/office_directory.php): `office_directory.php`

### Requests and reports

- [Service requests](https://github.com/ciannnnnn/smart-iba/blob/main/manage_request.php): `manage_request.php`
- [Citizen reports](https://github.com/ciannnnnn/smart-iba/blob/main/reports.php): `reports.php`
- [Scholarships](https://github.com/ciannnnnn/smart-iba/blob/main/scholarship.php): `scholarship.php`

### Data services

- [Firebase integration](https://github.com/ciannnnnn/smart-iba/blob/main/includes/firebase_config.php): `includes/firebase_config.php`
- **Firestore**
- **MySQL**

### Other components

- **Administrator**

## Connections

- Administrator → Admin login: signs in
- Admin login → MySQL: checks credentials
- Dashboard → Admin login: redirects unauthenticated (evidence: `index.php`)
- Admin login → MySQL: uses PDO (evidence: `login.php`)
- Dashboard → Firebase integration: loads counts (evidence: `index.php`)
- Dashboard → Admin layout: renders page (evidence: `index.php`)
- User management → Admin layout: renders page (evidence: `users.php`)
- User management → Firebase integration: uses Firebase (evidence: `users.php`)
- Event management → Firebase integration: loads and updates (evidence: `event.php`)
- Event management → Admin layout: renders page (evidence: `event.php`)
- News management → Firebase integration: sends notifications (evidence: `news.php`)
- News management → Admin layout: renders page (evidence: `news.php`)
- Office directory → Firebase integration: reads and updates (evidence: `office_directory.php`)
- Office directory → Admin layout: renders page (evidence: `office_directory.php`)
- Service requests → Firebase integration: updates requests (evidence: `manage_request.php`)
- Service requests → Admin layout: renders page (evidence: `manage_request.php`)
- Citizen reports → Firebase integration: updates reports (evidence: `reports.php`)
- Citizen reports → Admin layout: renders page (evidence: `reports.php`)
- Scholarships → Firebase integration: manages applications (evidence: `scholarship.php`)
- Scholarships → Admin layout: renders page (evidence: `scholarship.php`)
- Firebase integration → Firestore: reads and writes (evidence: `includes/firebase_config.php`)
- Firebase integration → Administrator: sends push alerts (evidence: `includes/firebase_config.php`)
- Admin login → MySQL: authenticates via (evidence: `login.php`)
