# creesteencodes/mabini-meo architecture

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

- Interactive diagram: https://gitdiagram.com/creesteencodes/mabini-meo
- Repository: https://github.com/creesteencodes/mabini-meo

## Overview

This is a local-road project management application for recording road projects, inspections, maintenance, users, and related reporting or analytics. The main workflow is sign-in, dashboard/module selection, project and inspection updates through the application API, and persistence in a local SQLite database; maintenance has a parallel API-backed workflow. The graph also preserves documented-in-code AI, analytics, progress, reports, and user-management branches. Several component and route excerpts are incomplete, so unverified connections are omitted rather than inferred.

Main entry points: [`src/app/App.tsx`](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/App.tsx) (App shell), [`src/lib/local-database.ts`](https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/local-database.ts) (Local SQLite store), [`src/app/components/LocalRoadList.tsx`](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/LocalRoadList.tsx) (Road projects), [`src/app/components/InspectionModule.tsx`](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/InspectionModule.tsx) (Inspections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Application interface"]
  node_app["App shell<br/>[App.tsx]"]
  node_login["Login<br/>[LoginPage.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_sidebar["Navigation<br/>[Sidebar.tsx]"]
end

subgraph group_domain["Road operations"]
  node_roads_ui["Road projects<br/>[LocalRoadList.tsx]"]
  node_road_form["Project form<br/>[LocalRoadForm.tsx]"]
  node_inspections_ui["Inspections"]
  node_maintenance_ui["Maintenance"]
  node_ai_ui["AI predictions"]
  node_analytics["Analytics"]
  node_progress["Project progress"]
  node_reports["Reports<br/>[ReportsModule.tsx]"]
  node_users_ui["User management"]
  node_print["Print documents<br/>[PrintDocument.tsx]"]
  node_confirm["Action confirmation"]
end

subgraph group_server["API and access"]
  node_roads_api["Road API<br/>[route.ts]"]
  node_inspections_api["Inspection API<br/>[route.ts]"]
  node_maintenance_api["Maintenance API<br/>[route.ts]"]
  node_activity_api["Activity API<br/>[route.ts]"]
  node_auth_login["Login API<br/>[route.ts]"]
  node_auth_status["Auth status API<br/>[route.ts]"]
  node_lock_api["Lockout APIs<br/>[route.ts]"]
  node_unlock_api["Unlock API<br/>[route.ts]"]
  node_ai_api["AI priority API<br/>[route.ts]"]
end

subgraph group_data["Persistence and services"]
  node_db[("Local SQLite store<br/>[local-database.ts]")]
  node_activity_client["Activity client"]
  node_lockout[("Lockout state<br/>[lockout.ts]")]
  node_ai_service["AI service<br/>[ai.ts]"]
end

node_operator(("Staff user"))

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_sidebar
node_app -->|"selects"| node_dashboard
node_app -->|"selects"| node_roads_ui
node_app -->|"selects"| node_road_form
node_app -->|"selects"| node_inspections_ui
node_app -->|"selects"| node_maintenance_ui
node_app -->|"selects"| node_ai_ui
node_app -->|"selects"| node_analytics
node_app -->|"selects"| node_progress
node_app -->|"selects"| node_users_ui
node_app -->|"fetches"| node_roads_api
node_app -->|"fetches"| node_inspections_api
node_app -->|"fetches"| node_maintenance_api
node_roads_api -->|"reads and writes"| node_db
node_inspections_api -->|"reads and writes"| node_db
node_maintenance_api -->|"reads and writes"| node_db
node_activity_api -->|"records logs"| node_db
node_activity_client -->|"posts activity"| node_activity_api
node_inspections_ui -->|"records activity"| node_activity_client
node_roads_ui -->|"records activity"| node_activity_client
node_maintenance_ui -->|"records activity"| node_activity_client
node_auth_login -->|"checks credentials"| node_db
node_auth_login -->|"checks attempts"| node_lockout
node_auth_status -->|"reads users"| node_db
node_lock_api -->|"checks status"| node_lockout
node_unlock_api -->|"updates access"| node_db
node_unlock_api -->|"clears lockout"| node_lockout
node_ai_api -->|"requests priority"| node_ai_service
node_ai_ui -.->|"requests priority"| node_ai_api
node_inspections_ui -->|"renders"| node_print
node_roads_ui -->|"renders"| node_print
node_maintenance_ui -->|"renders"| node_print
node_inspections_ui -->|"uses"| node_confirm
node_roads_ui -->|"uses"| node_confirm
node_maintenance_ui -->|"uses"| node_confirm

click node_app "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/App.tsx"
click node_login "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/LoginPage.tsx"
click node_dashboard "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/Dashboard.tsx"
click node_sidebar "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/Sidebar.tsx"
click node_roads_ui "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/LocalRoadList.tsx"
click node_road_form "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/LocalRoadForm.tsx"
click node_inspections_ui "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/InspectionModule.tsx"
click node_maintenance_ui "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/MaintenanceModule.tsx"
click node_ai_ui "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/AIPredictionModule.tsx"
click node_analytics "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/AnalyticsDashboard.tsx"
click node_progress "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/ProjectProgressModule.tsx"
click node_reports "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/ReportsModule.tsx"
click node_users_ui "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/UserManagementModule.tsx"
click node_print "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/PrintDocument.tsx"
click node_confirm "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/ConfirmActionDialog.tsx"
click node_roads_api "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/local-road/route.ts"
click node_inspections_api "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/inspections/route.ts"
click node_maintenance_api "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/maintenance/route.ts"
click node_activity_api "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/activity-logs/route.ts"
click node_auth_login "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/login/route.ts"
click node_auth_status "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/status/route.ts"
click node_lock_api "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/lock-status/route.ts"
click node_unlock_api "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/unlock/route.ts"
click node_ai_api "https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/ai-priority/route.ts"
click node_db "https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/local-database.ts"
click node_activity_client "https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/activity-log-client.ts"
click node_lockout "https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/lockout.ts"
click node_ai_service "https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/ai.ts"

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_app,node_login,node_dashboard,node_sidebar,node_operator toneBlue
class node_roads_ui,node_road_form,node_inspections_ui,node_maintenance_ui,node_ai_ui,node_analytics,node_progress,node_reports,node_users_ui,node_print,node_confirm toneAmber
class node_roads_api,node_inspections_api,node_maintenance_api,node_activity_api,node_auth_login,node_auth_status,node_lock_api,node_unlock_api,node_ai_api toneMint
class node_db,node_activity_client,node_lockout,node_ai_service toneRose
```

## Components

### Application interface

- [App shell](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Login](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/LoginPage.tsx): `src/app/components/LoginPage.tsx`
- [Dashboard](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/Dashboard.tsx): `src/app/components/Dashboard.tsx`
- [Navigation](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/Sidebar.tsx): `src/app/components/Sidebar.tsx`

### Road operations

- [Road projects](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/LocalRoadList.tsx): `src/app/components/LocalRoadList.tsx`
- [Project form](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/LocalRoadForm.tsx): `src/app/components/LocalRoadForm.tsx`
- [Inspections](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/InspectionModule.tsx): `src/app/components/InspectionModule.tsx`
- [Maintenance](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/MaintenanceModule.tsx): `src/app/components/MaintenanceModule.tsx`
- [AI predictions](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/AIPredictionModule.tsx): `src/app/components/AIPredictionModule.tsx`
- [Analytics](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/AnalyticsDashboard.tsx): `src/app/components/AnalyticsDashboard.tsx`
- [Project progress](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/ProjectProgressModule.tsx): `src/app/components/ProjectProgressModule.tsx`
- [Reports](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/ReportsModule.tsx): `src/app/components/ReportsModule.tsx`
- [User management](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/UserManagementModule.tsx): `src/app/components/UserManagementModule.tsx`
- [Print documents](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/PrintDocument.tsx): `src/app/components/PrintDocument.tsx`
- [Action confirmation](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/components/ConfirmActionDialog.tsx): `src/app/components/ConfirmActionDialog.tsx`

### API and access

- [Road API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/local-road/route.ts): `src/app/api/local-road/route.ts`
- [Inspection API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/inspections/route.ts): `src/app/api/inspections/route.ts`
- [Maintenance API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/maintenance/route.ts): `src/app/api/maintenance/route.ts`
- [Activity API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/activity-logs/route.ts): `src/app/api/activity-logs/route.ts`
- [Login API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/login/route.ts): `src/app/api/auth/login/route.ts`
- [Auth status API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/status/route.ts): `src/app/api/auth/status/route.ts`
- [Lockout APIs](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/lock-status/route.ts): `src/app/api/auth/lock-status/route.ts`
- [Unlock API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/auth/unlock/route.ts): `src/app/api/auth/unlock/route.ts`
- [AI priority API](https://github.com/creesteencodes/mabini-meo/blob/main/src/app/api/ai-priority/route.ts): `src/app/api/ai-priority/route.ts`

### Persistence and services

- [Local SQLite store](https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/local-database.ts): `src/lib/local-database.ts`
- [Activity client](https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/activity-log-client.ts): `src/lib/activity-log-client.ts`
- [Lockout state](https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/lockout.ts): `src/lib/lockout.ts`
- [AI service](https://github.com/creesteencodes/mabini-meo/blob/main/src/lib/ai.ts): `src/lib/ai.ts`

### Other components

- **Staff user**

## Connections

- Staff user → App shell: uses
- App shell → Login: renders (evidence: `src/app/App.tsx`)
- App shell → Navigation: renders (evidence: `src/app/App.tsx`)
- App shell → Dashboard: selects (evidence: `src/app/App.tsx`)
- App shell → Road projects: selects (evidence: `src/app/App.tsx`)
- App shell → Project form: selects (evidence: `src/app/App.tsx`)
- App shell → Inspections: selects (evidence: `src/app/App.tsx`)
- App shell → Maintenance: selects (evidence: `src/app/App.tsx`)
- App shell → AI predictions: selects (evidence: `src/app/App.tsx`)
- App shell → Analytics: selects (evidence: `src/app/App.tsx`)
- App shell → Project progress: selects (evidence: `src/app/App.tsx`)
- App shell → User management: selects (evidence: `src/app/App.tsx`)
- App shell → Road API: fetches (evidence: `src/app/App.tsx`)
- App shell → Inspection API: fetches (evidence: `src/app/App.tsx`)
- App shell → Maintenance API: fetches (evidence: `src/app/App.tsx`)
- Road API → Local SQLite store: reads and writes (evidence: `src/app/api/local-road/route.ts`)
- Inspection API → Local SQLite store: reads and writes (evidence: `src/app/api/inspections/route.ts`)
- Maintenance API → Local SQLite store: reads and writes (evidence: `src/app/api/maintenance/route.ts`)
- Activity API → Local SQLite store: records logs (evidence: `src/app/api/activity-logs/route.ts`)
- Activity client → Activity API: posts activity (evidence: `src/lib/activity-log-client.ts`)
- Inspections → Activity client: records activity (evidence: `src/app/components/InspectionModule.tsx`)
- Road projects → Activity client: records activity (evidence: `src/app/components/LocalRoadList.tsx`)
- Maintenance → Activity client: records activity (evidence: `src/app/components/MaintenanceModule.tsx`)
- Login API → Local SQLite store: checks credentials (evidence: `src/app/api/auth/login/route.ts`)
- Login API → Lockout state: checks attempts (evidence: `src/app/api/auth/login/route.ts`)
- Auth status API → Local SQLite store: reads users (evidence: `src/app/api/auth/status/route.ts`)
- Lockout APIs → Lockout state: checks status (evidence: `src/app/api/auth/lock-status/route.ts`)
- Unlock API → Local SQLite store: updates access (evidence: `src/app/api/auth/unlock/route.ts`)
- Unlock API → Lockout state: clears lockout (evidence: `src/app/api/auth/unlock/route.ts`)
- AI priority API → AI service: requests priority (evidence: `src/app/api/ai-priority/route.ts`)
- AI predictions → AI priority API: requests priority
- Inspections → Print documents: renders (evidence: `src/app/components/InspectionModule.tsx`)
- Road projects → Print documents: renders (evidence: `src/app/components/LocalRoadList.tsx`)
- Maintenance → Print documents: renders (evidence: `src/app/components/MaintenanceModule.tsx`)
- Inspections → Action confirmation: uses (evidence: `src/app/components/InspectionModule.tsx`)
- Road projects → Action confirmation: uses (evidence: `src/app/components/LocalRoadList.tsx`)
- Maintenance → Action confirmation: uses (evidence: `src/app/components/MaintenanceModule.tsx`)
