# moonshibo/internet-barangay-system architecture

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

- Interactive diagram: https://gitdiagram.com/moonshibo/internet-barangay-system
- Repository: https://github.com/moonshibo/internet-barangay-system

## Overview

Internet Barangay System is a Laravel citizen-service portal paired with a Python NLP concern-classification service. Citizens register or log in, reach a protected dashboard, and can submit, track, and review concerns; personnel log in to manage requests and view reports. The sampled routes expose these interfaces, but no request-processing controller or persistence model appears in the tree. The README documents NLP classification and routing, though the sampled sources do not show how the Laravel and Python services connect, so that relationship is left unverified.

Main entry points: [`routes/web.php`](https://github.com/moonshibo/internet-barangay-system/blob/main/routes/web.php) (Web routes), [`public/index.php`](https://github.com/moonshibo/internet-barangay-system/blob/main/public/index.php) (HTTP entry), [`nlp-service/app.py`](https://github.com/moonshibo/internet-barangay-system/blob/main/nlp-service/app.py) (NLP service), [`app/Models/User.php`](https://github.com/moonshibo/internet-barangay-system/blob/main/app/Models/User.php) (User account model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and routing"]
  node_http["HTTP entry<br/>[index.php]"]
  node_routes["Web routes<br/>[web.php]"]
end

subgraph group_identity["Identity and access"]
  node_role["Role guard<br/>[RoleMiddleware.php]"]
  node_citizen_auth["Citizen authentication"]
  node_registration["Citizen registration"]
  node_personnel_auth["Personnel authentication"]
  node_user[("User account model<br/>[User.php]")]
end

subgraph group_citizen["Citizen services"]
  node_submit["Submit concern"]
  node_citizen_dash["Citizen dashboard"]
  node_tracking["Track concern"]
  node_history["Concern history<br/>[history.blade.php]"]
end

subgraph group_staff["Personnel operations"]
  node_staff_dash["Staff dashboard"]
  node_requests["Request management<br/>[requests.blade.php]"]
  node_details["Request details"]
  node_reports["Service reports<br/>[reports.blade.php]"]
end

subgraph group_nlp["Concern classification"]
  node_nlp_app["NLP service<br/>[app.py]"]
  node_preprocess["Text preprocessing<br/>[preprocess.py]"]
  node_training["Model training<br/>[train.py]"]
end

node_citizens(("Citizens"))
node_personnel(("Personnel"))

node_citizens -->|"send requests"| node_http
node_personnel -->|"send requests"| node_http
node_http -->|"dispatches to"| node_routes
node_routes -->|"routes to"| node_citizen_auth
node_routes -->|"routes to"| node_registration
node_routes -->|"routes to"| node_personnel_auth
node_routes -.->|"guards routes"| node_role
node_citizen_auth -.->|"authenticates"| node_user
node_registration -->|"creates account"| node_user
node_personnel_auth -.->|"authenticates"| node_user
node_routes -->|"renders"| node_submit
node_routes -->|"renders"| node_citizen_dash
node_routes -->|"renders"| node_tracking
node_routes -->|"renders"| node_history
node_routes -->|"renders"| node_staff_dash
node_routes -->|"renders"| node_requests
node_routes -->|"renders"| node_details
node_routes -->|"renders"| node_reports
node_submit -.->|"classifies concern"| node_nlp_app
node_nlp_app -.->|"preprocesses text"| node_preprocess
node_training -.->|"provides classifier"| node_nlp_app

click node_http "https://github.com/moonshibo/internet-barangay-system/blob/main/public/index.php"
click node_routes "https://github.com/moonshibo/internet-barangay-system/blob/main/routes/web.php"
click node_role "https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Middleware/RoleMiddleware.php"
click node_citizen_auth "https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Controllers/Auth/CitizenLoginController.php"
click node_registration "https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Controllers/Auth/CitizenRegistrationController.php"
click node_personnel_auth "https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Controllers/Auth/PersonnelLoginController.php"
click node_user "https://github.com/moonshibo/internet-barangay-system/blob/main/app/Models/User.php"
click node_submit "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/submit-request.blade.php"
click node_citizen_dash "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/dashboard.blade.php"
click node_tracking "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/track-request.blade.php"
click node_history "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/history.blade.php"
click node_staff_dash "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/dashboard.blade.php"
click node_requests "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/requests.blade.php"
click node_details "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/request-details.blade.php"
click node_reports "https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/reports.blade.php"
click node_nlp_app "https://github.com/moonshibo/internet-barangay-system/blob/main/nlp-service/app.py"
click node_preprocess "https://github.com/moonshibo/internet-barangay-system/blob/main/nlp-service/preprocess.py"
click node_training "https://github.com/moonshibo/internet-barangay-system/blob/main/nlp-service/train.py"

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_http,node_routes toneBlue
class node_role,node_citizen_auth,node_registration,node_personnel_auth,node_user toneAmber
class node_submit,node_citizen_dash,node_tracking,node_history toneMint
class node_staff_dash,node_requests,node_details,node_reports toneRose
class node_nlp_app,node_preprocess,node_training,node_citizens,node_personnel toneIndigo
```

## Components

### Web entry and routing

- [HTTP entry](https://github.com/moonshibo/internet-barangay-system/blob/main/public/index.php): `public/index.php`
- [Web routes](https://github.com/moonshibo/internet-barangay-system/blob/main/routes/web.php): `routes/web.php`

### Identity and access

- [Role guard](https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Middleware/RoleMiddleware.php): `app/Http/Middleware/RoleMiddleware.php`
- [Citizen authentication](https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Controllers/Auth/CitizenLoginController.php): `app/Http/Controllers/Auth/CitizenLoginController.php`
- [Citizen registration](https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Controllers/Auth/CitizenRegistrationController.php): `app/Http/Controllers/Auth/CitizenRegistrationController.php`
- [Personnel authentication](https://github.com/moonshibo/internet-barangay-system/blob/main/app/Http/Controllers/Auth/PersonnelLoginController.php): `app/Http/Controllers/Auth/PersonnelLoginController.php`
- [User account model](https://github.com/moonshibo/internet-barangay-system/blob/main/app/Models/User.php): `app/Models/User.php`

### Citizen services

- [Submit concern](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/submit-request.blade.php): `resources/views/citizen/submit-request.blade.php`
- [Citizen dashboard](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/dashboard.blade.php): `resources/views/citizen/dashboard.blade.php`
- [Track concern](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/track-request.blade.php): `resources/views/citizen/track-request.blade.php`
- [Concern history](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/citizen/history.blade.php): `resources/views/citizen/history.blade.php`

### Personnel operations

- [Staff dashboard](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/dashboard.blade.php): `resources/views/personnel/dashboard.blade.php`
- [Request management](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/requests.blade.php): `resources/views/personnel/requests.blade.php`
- [Request details](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/request-details.blade.php): `resources/views/personnel/request-details.blade.php`
- [Service reports](https://github.com/moonshibo/internet-barangay-system/blob/main/resources/views/personnel/reports.blade.php): `resources/views/personnel/reports.blade.php`

### Concern classification

- [NLP service](https://github.com/moonshibo/internet-barangay-system/blob/main/nlp-service/app.py): `nlp-service/app.py`
- [Text preprocessing](https://github.com/moonshibo/internet-barangay-system/blob/main/nlp-service/preprocess.py): `nlp-service/preprocess.py`
- [Model training](https://github.com/moonshibo/internet-barangay-system/blob/main/nlp-service/train.py): `nlp-service/train.py`

### Other components

- **Citizens**
- **Personnel**

## Connections

- Citizens → HTTP entry: send requests (evidence: `public/index.php`)
- Personnel → HTTP entry: send requests (evidence: `public/index.php`)
- HTTP entry → Web routes: dispatches to (evidence: `public/index.php`)
- Web routes → Citizen authentication: routes to (evidence: `routes/web.php`)
- Web routes → Citizen registration: routes to (evidence: `routes/web.php`)
- Web routes → Personnel authentication: routes to (evidence: `routes/web.php`)
- Web routes → Role guard: guards routes
- Citizen authentication → User account model: authenticates
- Citizen registration → User account model: creates account (evidence: `app/Http/Controllers/Auth/CitizenRegistrationController.php`)
- Personnel authentication → User account model: authenticates
- Web routes → Submit concern: renders (evidence: `routes/web.php`)
- Web routes → Citizen dashboard: renders (evidence: `routes/web.php`)
- Web routes → Track concern: renders (evidence: `routes/web.php`)
- Web routes → Concern history: renders (evidence: `routes/web.php`)
- Web routes → Staff dashboard: renders (evidence: `routes/web.php`)
- Web routes → Request management: renders (evidence: `routes/web.php`)
- Web routes → Request details: renders (evidence: `routes/web.php`)
- Web routes → Service reports: renders (evidence: `routes/web.php`)
- Submit concern → NLP service: classifies concern
- NLP service → Text preprocessing: preprocesses text
- Model training → NLP service: provides classifier
