# mendozagabii/mabini-meo architecture

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

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

## Overview

This is a municipal road-project management application: staff sign in, work with road projects, inspections, maintenance, and related administrative modules, while API routes enforce access and persist records. The sampled routes show annual validation, workflow notifications, and inspection logging alongside the core record flow. Supabase is the documented persistence layer; AI prioritization, analytics, and user administration are also represented in the tree. The README gives no product detail, so links from UI modules to API routes are omitted where source evidence is unavailable.

Main entry points: [`src/app/App.tsx`](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/App.tsx) (Application shell), [`src/lib/supabase-data.ts`](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/supabase-data.ts) (Record translation), [`src/lib/api.ts`](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/api.ts) (API access helpers), [`src/app/api/local-road/route.ts`](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/local-road/route.ts) (Road API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Application experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_login["Sign in<br/>[LoginPage.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_operations["Road operations"]
  node_road_ui["Road projects<br/>[LocalRoadList.tsx]"]
  node_road_form["Project editor<br/>[LocalRoadForm.tsx]"]
  node_inspection_ui["Inspections"]
  node_maintenance_ui["Maintenance"]
  node_ai_ui["AI prioritization"]
  node_analytics["Analytics"]
end

subgraph group_workflow["Validation and workflow"]
  node_users_ui["User administration"]
  node_validation["Validation rules"]
  node_validation_flow["Validation workflow"]
  node_reminder_rules["Reminder scheduling"]
  node_notifications["Email notifications<br/>[notifications.ts]"]
  node_activity["Activity logging"]
end

subgraph group_services["API and services"]
  node_road_api["Road API<br/>[route.ts]"]
  node_inspection_api["Inspection API<br/>[route.ts]"]
  node_maintenance_api["Maintenance API<br/>[route.ts]"]
  node_reminders_api["Reminder API<br/>[route.ts]"]
  node_ai_api["AI priority API<br/>[route.ts]"]
  node_auth_api["Authentication API<br/>[route.ts]"]
  node_api_helpers["API access helpers<br/>[api.ts]"]
end

subgraph group_storage["Persistence"]
  node_supabase_data["Record translation<br/>[supabase-data.ts]"]
  node_supabase["Supabase clients<br/>[supabase.ts]"]
  node_database[("Supabase database")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_road_ui
node_app -->|"renders"| node_road_form
node_app -->|"renders"| node_inspection_ui
node_app -->|"renders"| node_maintenance_ui
node_app -->|"renders"| node_ai_ui
node_app -->|"renders"| node_analytics
node_app -->|"renders"| node_users_ui
node_road_api -->|"checks access"| node_api_helpers
node_road_api -->|"validates dates"| node_validation
node_road_api -->|"notifies workflow"| node_notifications
node_road_api -->|"reads and saves"| node_supabase_data
node_inspection_api -->|"reads and saves"| node_supabase_data
node_inspection_api -->|"notifies workflow"| node_notifications
node_inspection_api -.->|"logs client activity"| node_activity
node_maintenance_api -->|"checks access"| node_api_helpers
node_maintenance_api -->|"reads and saves"| node_supabase_data
node_reminders_api -->|"finds due reminders"| node_reminder_rules
node_reminders_api -->|"loads and records"| node_supabase_data
node_reminders_api -->|"sends reminders"| node_notifications
node_reminders_api -->|"checks access"| node_api_helpers
node_ai_api -->|"loads records"| node_supabase_data
node_ai_api -->|"uses API helpers"| node_api_helpers
node_auth_api -->|"authenticates"| node_supabase
node_api_helpers -->|"checks sessions"| node_supabase
node_supabase_data -->|"uses clients"| node_supabase
node_supabase -->|"connects to"| node_database
node_supabase_data -->|"reads and writes"| node_database

click node_app "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/App.tsx"
click node_login "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/LoginPage.tsx"
click node_dashboard "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/Dashboard.tsx"
click node_road_ui "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/LocalRoadList.tsx"
click node_road_form "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/LocalRoadForm.tsx"
click node_inspection_ui "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/InspectionModule.tsx"
click node_maintenance_ui "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/MaintenanceModule.tsx"
click node_ai_ui "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/AIPredictionModule.tsx"
click node_analytics "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/AnalyticsDashboard.tsx"
click node_users_ui "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/UserManagementModule.tsx"
click node_road_api "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/local-road/route.ts"
click node_inspection_api "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/inspections/route.ts"
click node_maintenance_api "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/maintenance/route.ts"
click node_reminders_api "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/validation-reminders/route.ts"
click node_ai_api "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/ai-priority/route.ts"
click node_auth_api "https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/auth/login/route.ts"
click node_validation "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/project-form-validation.ts"
click node_validation_flow "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/project-validation-workflow.ts"
click node_reminder_rules "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/validation-reminders.ts"
click node_notifications "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/notifications.ts"
click node_activity "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/activity-log-client.ts"
click node_api_helpers "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/api.ts"
click node_supabase_data "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/supabase-data.ts"
click node_supabase "https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/supabase.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_staff toneBlue
class node_road_ui,node_road_form,node_inspection_ui,node_maintenance_ui,node_ai_ui,node_analytics toneAmber
class node_users_ui,node_validation,node_validation_flow,node_reminder_rules,node_notifications,node_activity toneMint
class node_road_api,node_inspection_api,node_maintenance_api,node_reminders_api,node_ai_api,node_auth_api,node_api_helpers toneRose
class node_supabase_data,node_supabase,node_database toneIndigo
```

## Components

### Application experience

- [Application shell](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Sign in](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/LoginPage.tsx): `src/app/components/LoginPage.tsx`
- [Dashboard](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/Dashboard.tsx): `src/app/components/Dashboard.tsx`

### Road operations

- [Road projects](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/LocalRoadList.tsx): `src/app/components/LocalRoadList.tsx`
- [Project editor](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/LocalRoadForm.tsx): `src/app/components/LocalRoadForm.tsx`
- [Inspections](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/InspectionModule.tsx): `src/app/components/InspectionModule.tsx`
- [Maintenance](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/MaintenanceModule.tsx): `src/app/components/MaintenanceModule.tsx`
- [AI prioritization](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/AIPredictionModule.tsx): `src/app/components/AIPredictionModule.tsx`
- [Analytics](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/AnalyticsDashboard.tsx): `src/app/components/AnalyticsDashboard.tsx`

### Validation and workflow

- [User administration](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/components/UserManagementModule.tsx): `src/app/components/UserManagementModule.tsx`
- [Validation rules](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/project-form-validation.ts): `src/lib/project-form-validation.ts`
- [Validation workflow](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/project-validation-workflow.ts): `src/lib/project-validation-workflow.ts`
- [Reminder scheduling](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/validation-reminders.ts): `src/lib/validation-reminders.ts`
- [Email notifications](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/notifications.ts): `src/lib/notifications.ts`
- [Activity logging](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/activity-log-client.ts): `src/lib/activity-log-client.ts`

### API and services

- [Road API](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/local-road/route.ts): `src/app/api/local-road/route.ts`
- [Inspection API](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/inspections/route.ts): `src/app/api/inspections/route.ts`
- [Maintenance API](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/maintenance/route.ts): `src/app/api/maintenance/route.ts`
- [Reminder API](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/validation-reminders/route.ts): `src/app/api/validation-reminders/route.ts`
- [AI priority API](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/ai-priority/route.ts): `src/app/api/ai-priority/route.ts`
- [Authentication API](https://github.com/mendozagabii/mabini-meo/blob/main/src/app/api/auth/login/route.ts): `src/app/api/auth/login/route.ts`
- [API access helpers](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/api.ts): `src/lib/api.ts`

### Persistence

- [Record translation](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/supabase-data.ts): `src/lib/supabase-data.ts`
- [Supabase clients](https://github.com/mendozagabii/mabini-meo/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase database**

### Other components

- **Staff user**

## Connections

- Staff user → Application shell: uses (evidence: `src/app/App.tsx`)
- Application shell → Sign in: renders (evidence: `src/app/App.tsx`)
- Application shell → Dashboard: renders (evidence: `src/app/App.tsx`)
- Application shell → Road projects: renders (evidence: `src/app/App.tsx`)
- Application shell → Project editor: renders (evidence: `src/app/App.tsx`)
- Application shell → Inspections: renders (evidence: `src/app/App.tsx`)
- Application shell → Maintenance: renders (evidence: `src/app/App.tsx`)
- Application shell → AI prioritization: renders (evidence: `src/app/App.tsx`)
- Application shell → Analytics: renders (evidence: `src/app/App.tsx`)
- Application shell → User administration: renders (evidence: `src/app/App.tsx`)
- Road API → API access helpers: checks access (evidence: `src/app/api/local-road/route.ts`)
- Road API → Validation rules: validates dates (evidence: `src/app/api/local-road/route.ts`)
- Road API → Email notifications: notifies workflow (evidence: `src/app/api/local-road/route.ts`)
- Road API → Record translation: reads and saves (evidence: `src/app/api/local-road/route.ts`)
- Inspection API → Record translation: reads and saves (evidence: `src/app/api/inspections/route.ts`)
- Inspection API → Email notifications: notifies workflow (evidence: `src/app/api/inspections/route.ts`)
- Inspection API → Activity logging: logs client activity
- Maintenance API → API access helpers: checks access (evidence: `src/app/api/maintenance/route.ts`)
- Maintenance API → Record translation: reads and saves (evidence: `src/app/api/maintenance/route.ts`)
- Reminder API → Reminder scheduling: finds due reminders (evidence: `src/app/api/validation-reminders/route.ts`)
- Reminder API → Record translation: loads and records (evidence: `src/app/api/validation-reminders/route.ts`)
- Reminder API → Email notifications: sends reminders (evidence: `src/app/api/validation-reminders/route.ts`)
- Reminder API → API access helpers: checks access (evidence: `src/app/api/validation-reminders/route.ts`)
- AI priority API → Record translation: loads records (evidence: `src/app/api/ai-priority/route.ts`)
- AI priority API → API access helpers: uses API helpers (evidence: `src/app/api/ai-priority/route.ts`)
- Authentication API → Supabase clients: authenticates (evidence: `src/app/api/auth/login/route.ts`)
- API access helpers → Supabase clients: checks sessions (evidence: `src/lib/api.ts`)
- Record translation → Supabase clients: uses clients (evidence: `src/lib/supabase-data.ts`)
- Supabase clients → Supabase database: connects to (evidence: `src/lib/supabase.ts`)
- Record translation → Supabase database: reads and writes (evidence: `src/lib/supabase-data.ts`)
