# kaarlosasiang/bettermaticity architecture

> Architecture diagram of the GitHub repository kaarlosasiang/bettermaticity, 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/kaarlosasiang/bettermaticity
- Repository: https://github.com/kaarlosasiang/bettermaticity

## Overview

BetterMati.org is a public civic-information portal for residents: visitors navigate the municipal site to find service guidance, government contacts, public finance and legislation, and city statistics. The React route table selects pages; service-search and category/detail views support service discovery, while separate pages present transparency and civic-information features. The README also describes PWA/offline support, accessibility, multilingual content, analytics, and SEO. The graph maps documented routes and excerpted calls; several capability branches are represented at their page or directory level because their source was not sampled.

Main entry points: [`web/src/routes.tsx`](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/routes.tsx) (Page routes), [`web/src/pages/Services.tsx`](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Services.tsx) (Services directory), [`web/src/pages/ServicesHealth.tsx`](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/ServicesHealth.tsx) (Health services), [`web/src/pages/service-details`](https://github.com/kaarlosasiang/bettermaticity/tree/main/web/src/pages/service-details) (Service detail pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Site experience"]
  node_routes["Page routes<br/>[routes.tsx]"]
  node_home["City homepage<br/>[Home.tsx]"]
  node_news["City news<br/>[News.tsx]"]
end

subgraph group_services["Municipal services"]
  node_services["Services directory<br/>[Services.tsx]"]
  node_categories["Service categories<br/>[categories.tsx]"]
  node_category2["More categories<br/>[categories2.tsx]"]
  node_health["Health services<br/>[ServicesHealth.tsx]"]
  node_guides["Service guides<br/>[ServiceGuide.tsx]"]
  node_servicepages["Service detail pages"]
  node_search["Service search<br/>[ServiceSearch.tsx]"]
  node_servicecatalog["Service catalog data<br/>[services.ts]"]
  node_onlineactions["Online actions"]
end

subgraph group_civic["Civic information"]
  node_government["Government directory<br/>[Government.tsx]"]
  node_officials["Officials"]
  node_budget["Budget transparency<br/>[Budget.tsx]"]
  node_legislative["Legislation<br/>[Legislative.tsx]"]
  node_statistics["City statistics<br/>[Statistics.tsx]"]
  node_contact["Contact and hotlines<br/>[Contact.tsx]"]
  node_hotlinedata["Hotline data<br/>[hotlines.ts]"]
end

subgraph group_platform["Shared capabilities"]
  node_language["Language settings<br/>[i18n.ts]"]
  node_layout["Page layout<br/>[Layout.tsx]"]
  node_pwa["Offline and updates<br/>[sw.js]"]
  node_analytics["Usage analytics<br/>[Analytics.tsx]"]
end

node_resident(("Site visitor"))
node_weather{{"Weather service"}}

node_resident -->|"opens pages"| node_routes
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_services
node_routes -->|"routes to"| node_health
node_routes -->|"routes to"| node_categories
node_routes -->|"routes to"| node_category2
node_routes -->|"routes to"| node_government
node_routes -->|"routes to"| node_officials
node_routes -->|"routes to"| node_budget
node_routes -->|"routes to"| node_legislative
node_routes -->|"routes to"| node_statistics
node_routes -->|"routes to"| node_news
node_routes -->|"routes to"| node_contact
node_routes -->|"wraps pages"| node_layout
node_services -->|"renders"| node_search
node_services -.->|"uses catalog"| node_servicecatalog
node_services -->|"links categories"| node_categories
node_health -->|"uses hotlines"| node_hotlinedata
node_health -->|"links details"| node_servicepages
node_servicepages -->|"renders"| node_guides
node_guides -.->|"uses catalog"| node_servicecatalog
node_servicepages -.->|"uses actions"| node_onlineactions
node_resident -.->|"chooses language"| node_language
node_home -->|"fetches forecast"| node_weather
node_resident -.->|"uses offline site"| node_pwa
node_resident -.->|"visits tracked"| node_analytics

click node_routes "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/routes.tsx"
click node_home "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Home.tsx"
click node_news "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/News.tsx"
click node_services "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Services.tsx"
click node_categories "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/categories.tsx"
click node_category2 "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/categories2.tsx"
click node_health "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/ServicesHealth.tsx"
click node_guides "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/components/ServiceGuide.tsx"
click node_servicepages "https://github.com/kaarlosasiang/bettermaticity/tree/main/web/src/pages/service-details"
click node_search "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/components/ServiceSearch.tsx"
click node_servicecatalog "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/lib/services.ts"
click node_onlineactions "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/lib/serviceOnlineActions.ts"
click node_government "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Government.tsx"
click node_officials "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/GovernmentOfficials.tsx"
click node_budget "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Budget.tsx"
click node_legislative "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Legislative.tsx"
click node_statistics "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Statistics.tsx"
click node_contact "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Contact.tsx"
click node_hotlinedata "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/lib/hotlines.ts"
click node_language "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/i18n.ts"
click node_layout "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/Layout.tsx"
click node_pwa "https://github.com/kaarlosasiang/bettermaticity/blob/main/sw.js"
click node_analytics "https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/components/Analytics.tsx"

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_routes,node_home,node_news toneBlue
class node_services,node_categories,node_category2,node_health,node_guides,node_servicepages,node_search,node_servicecatalog,node_onlineactions toneAmber
class node_government,node_officials,node_budget,node_legislative,node_statistics,node_contact,node_hotlinedata toneMint
class node_language,node_layout,node_pwa,node_analytics toneRose
class node_resident,node_weather toneIndigo
```

## Components

### Site experience

- [Page routes](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/routes.tsx): `web/src/routes.tsx`
- [City homepage](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Home.tsx): `web/src/pages/Home.tsx`
- [City news](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/News.tsx): `web/src/pages/News.tsx`

### Municipal services

- [Services directory](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Services.tsx): `web/src/pages/Services.tsx`
- [Service categories](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/categories.tsx): `web/src/pages/categories.tsx`
- [More categories](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/categories2.tsx): `web/src/pages/categories2.tsx`
- [Health services](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/ServicesHealth.tsx): `web/src/pages/ServicesHealth.tsx`
- [Service guides](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/components/ServiceGuide.tsx): `web/src/components/ServiceGuide.tsx`
- [Service detail pages](https://github.com/kaarlosasiang/bettermaticity/tree/main/web/src/pages/service-details): `web/src/pages/service-details`
- [Service search](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/components/ServiceSearch.tsx): `web/src/components/ServiceSearch.tsx`
- [Service catalog data](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/lib/services.ts): `web/src/lib/services.ts`
- [Online actions](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/lib/serviceOnlineActions.ts): `web/src/lib/serviceOnlineActions.ts`

### Civic information

- [Government directory](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Government.tsx): `web/src/pages/Government.tsx`
- [Officials](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/GovernmentOfficials.tsx): `web/src/pages/GovernmentOfficials.tsx`
- [Budget transparency](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Budget.tsx): `web/src/pages/Budget.tsx`
- [Legislation](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Legislative.tsx): `web/src/pages/Legislative.tsx`
- [City statistics](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Statistics.tsx): `web/src/pages/Statistics.tsx`
- [Contact and hotlines](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/pages/Contact.tsx): `web/src/pages/Contact.tsx`
- [Hotline data](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/lib/hotlines.ts): `web/src/lib/hotlines.ts`

### Shared capabilities

- [Language settings](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/i18n.ts): `web/src/i18n.ts`
- [Page layout](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/Layout.tsx): `web/src/Layout.tsx`
- [Offline and updates](https://github.com/kaarlosasiang/bettermaticity/blob/main/sw.js): `sw.js`
- [Usage analytics](https://github.com/kaarlosasiang/bettermaticity/blob/main/web/src/components/Analytics.tsx): `web/src/components/Analytics.tsx`

### Other components

- **Site visitor**
- **Weather service**

## Connections

- Site visitor → Page routes: opens pages (evidence: `web/src/routes.tsx`)
- Page routes → City homepage: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Services directory: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Health services: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Service categories: routes to (evidence: `web/src/routes.tsx`)
- Page routes → More categories: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Government directory: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Officials: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Budget transparency: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Legislation: routes to (evidence: `web/src/routes.tsx`)
- Page routes → City statistics: routes to (evidence: `web/src/routes.tsx`)
- Page routes → City news: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Contact and hotlines: routes to (evidence: `web/src/routes.tsx`)
- Page routes → Page layout: wraps pages (evidence: `web/src/routes.tsx`)
- Services directory → Service search: renders (evidence: `web/src/pages/Services.tsx`)
- Services directory → Service catalog data: uses catalog
- Services directory → Service categories: links categories (evidence: `web/src/pages/Services.tsx`)
- Health services → Hotline data: uses hotlines (evidence: `web/src/pages/ServicesHealth.tsx`)
- Health services → Service detail pages: links details (evidence: `web/src/pages/ServicesHealth.tsx`)
- Service detail pages → Service guides: renders (evidence: `web/src/pages/service-details/MunicipalEngineering.tsx`)
- Service guides → Service catalog data: uses catalog
- Service detail pages → Online actions: uses actions
- Site visitor → Language settings: chooses language
- City homepage → Weather service: fetches forecast (evidence: `web/src/pages/Home.tsx`)
- Site visitor → Offline and updates: uses offline site
- Site visitor → Usage analytics: visits tracked
