# azaeeeiiii/gcare architecture

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

- Interactive diagram: https://gitdiagram.com/azaeeeiiii/gcare
- Repository: https://github.com/azaeeeiiii/gcare

## Overview

GCare is a community safety web app. Residents authenticate, view alerts/news, submit location-and-photo incident reports, and track them; admins review, assign, and resolve reports, while volunteers claim assignments and provide proof. Separate capabilities cover ID verification, events, contact, and the hotline-backed assistant. The README documents Express APIs and Supabase services; sampled source confirms several frontend calls and report flows, but not all server routes or persistence details, so unshown links are omitted.

Main entry points: [`server/index.js`](https://github.com/azaeeeiiii/gcare/blob/main/server/index.js) (Express API), [`src/lib/reports.js`](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/reports.js) (Report records and workflow), [`src/lib/http.js`](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/http.js) (API transport), [`src/App.jsx`](https://github.com/azaeeeiiii/gcare/blob/main/src/App.jsx) (Route shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_resident["Resident experience"]
  node_landing["Alerts and landing<br/>[Landing.jsx]"]
  node_reportform["Incident submission<br/>[Report.jsx]"]
  node_map["Map and area boundary<br/>[ReportMap.jsx]"]
  node_area["Service area rules<br/>[serviceArea.js]"]
  node_assistant["Assistant widget<br/>[ChatWidget.jsx]"]
  node_hotlines["Hotlines and guidance<br/>[hotlines.js]"]
  node_profile["Resident profile<br/>[Profile.jsx]"]
end

subgraph group_operations["Safety operations"]
  node_reports["Report records and workflow<br/>[reports.js]"]
  node_admin["Admin dashboard<br/>[Admin.jsx]"]
  node_verification["ID verification<br/>[verification.js]"]
  node_verificationadmin["Verification review"]
  node_alertadmin["Alert administration<br/>[AdminAlerts.jsx]"]
  node_voladmin["Volunteer administration"]
end

subgraph group_community["Community services"]
  node_news["Community news<br/>[news.js]"]
  node_volunteer["Volunteer assignments<br/>[Volunteer.jsx]"]
  node_volunteerlib["Volunteer services<br/>[volunteer.js]"]
  node_events["Volunteer events<br/>[AdminEvents.jsx]"]
  node_contact["Contact messages<br/>[Contact.jsx]"]
  node_newsadmin["News administration<br/>[AdminNews.jsx]"]
end

subgraph group_platform["Application services"]
  node_app["Route shell<br/>[App.jsx]"]
  node_auth["Sign-in and identity<br/>[auth.js]"]
  node_supaclient["Supabase client<br/>[supabase.js]"]
  node_http["API transport<br/>[http.js]"]
  node_backend["Express API<br/>[index.js]"]
  node_database[("Supabase data and storage")]
  node_chatserver["Chat service<br/>[chat.js]"]
end

node_resident(("Residents"))

node_resident -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_reportform
node_app -->|"routes to"| node_news
node_auth -->|"authenticates with"| node_supaclient
node_auth -->|"requests profile"| node_http
node_http -->|"gets session"| node_supaclient
node_http -->|"sends API requests"| node_backend
node_backend -->|"reads and writes"| node_database
node_landing -->|"uses identity"| node_auth
node_landing -->|"loads status"| node_reports
node_news -->|"fetches stories"| node_http
node_reportform -->|"submits report"| node_reports
node_reportform -->|"selects location"| node_map
node_map -->|"checks boundary"| node_area
node_reports -->|"calls endpoints"| node_http
node_admin -->|"reviews reports"| node_reports
node_reports -->|"requests report actions"| node_backend
node_volunteer -->|"manages participation"| node_volunteerlib
node_volunteer -->|"submits proof"| node_reports
node_volunteerlib -->|"calls endpoints"| node_http
node_verificationadmin -->|"reviews submissions"| node_verification
node_profile -->|"updates account"| node_auth
node_newsadmin -->|"publishes stories"| node_news
node_alertadmin -.->|"manages alerts"| node_backend
node_voladmin -.->|"manages volunteers"| node_volunteerlib
node_events -.->|"approves signups"| node_volunteerlib
node_contact -.->|"sends inquiry"| node_backend
node_assistant -->|"answers locally"| node_hotlines
node_assistant -.->|"asks assistant"| node_backend
node_backend -->|"delegates chat"| node_chatserver
node_chatserver -.->|"uses chat service"| node_database

click node_app "https://github.com/azaeeeiiii/gcare/blob/main/src/App.jsx"
click node_auth "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/auth.js"
click node_supaclient "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/supabase.js"
click node_http "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/http.js"
click node_backend "https://github.com/azaeeeiiii/gcare/blob/main/server/index.js"
click node_landing "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Landing.jsx"
click node_news "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/news.js"
click node_reportform "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Report.jsx"
click node_reports "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/reports.js"
click node_map "https://github.com/azaeeeiiii/gcare/blob/main/src/components/ReportMap.jsx"
click node_area "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/serviceArea.js"
click node_admin "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Admin.jsx"
click node_volunteer "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Volunteer.jsx"
click node_volunteerlib "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/volunteer.js"
click node_verification "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/verification.js"
click node_events "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminEvents.jsx"
click node_contact "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Contact.jsx"
click node_assistant "https://github.com/azaeeeiiii/gcare/blob/main/src/components/ChatWidget.jsx"
click node_chatserver "https://github.com/azaeeeiiii/gcare/blob/main/server/chat.js"
click node_hotlines "https://github.com/azaeeeiiii/gcare/blob/main/src/lib/hotlines.js"
click node_profile "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Profile.jsx"
click node_verificationadmin "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminVerifications.jsx"
click node_newsadmin "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminNews.jsx"
click node_alertadmin "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminAlerts.jsx"
click node_voladmin "https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminVolunteers.jsx"

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_landing,node_reportform,node_map,node_area,node_assistant,node_hotlines,node_profile toneBlue
class node_reports,node_admin,node_verification,node_verificationadmin,node_alertadmin,node_voladmin toneAmber
class node_news,node_volunteer,node_volunteerlib,node_events,node_contact,node_newsadmin toneMint
class node_app,node_auth,node_supaclient,node_http,node_backend,node_database,node_chatserver toneRose
class node_resident toneIndigo
```

## Components

### Resident experience

- [Alerts and landing](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Landing.jsx): `src/pages/Landing.jsx`
- [Incident submission](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Report.jsx): `src/pages/Report.jsx`
- [Map and area boundary](https://github.com/azaeeeiiii/gcare/blob/main/src/components/ReportMap.jsx): `src/components/ReportMap.jsx`
- [Service area rules](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/serviceArea.js): `src/lib/serviceArea.js`
- [Assistant widget](https://github.com/azaeeeiiii/gcare/blob/main/src/components/ChatWidget.jsx): `src/components/ChatWidget.jsx`
- [Hotlines and guidance](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/hotlines.js): `src/lib/hotlines.js`
- [Resident profile](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`

### Safety operations

- [Report records and workflow](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/reports.js): `src/lib/reports.js`
- [Admin dashboard](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Admin.jsx): `src/pages/Admin.jsx`
- [ID verification](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/verification.js): `src/lib/verification.js`
- [Verification review](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminVerifications.jsx): `src/pages/AdminVerifications.jsx`
- [Alert administration](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminAlerts.jsx): `src/pages/AdminAlerts.jsx`
- [Volunteer administration](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminVolunteers.jsx): `src/pages/AdminVolunteers.jsx`

### Community services

- [Community news](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/news.js): `src/lib/news.js`
- [Volunteer assignments](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Volunteer.jsx): `src/pages/Volunteer.jsx`
- [Volunteer services](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/volunteer.js): `src/lib/volunteer.js`
- [Volunteer events](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminEvents.jsx): `src/pages/AdminEvents.jsx`
- [Contact messages](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/Contact.jsx): `src/pages/Contact.jsx`
- [News administration](https://github.com/azaeeeiiii/gcare/blob/main/src/pages/AdminNews.jsx): `src/pages/AdminNews.jsx`

### Application services

- [Route shell](https://github.com/azaeeeiiii/gcare/blob/main/src/App.jsx): `src/App.jsx`
- [Sign-in and identity](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/auth.js): `src/lib/auth.js`
- [Supabase client](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [API transport](https://github.com/azaeeeiiii/gcare/blob/main/src/lib/http.js): `src/lib/http.js`
- [Express API](https://github.com/azaeeeiiii/gcare/blob/main/server/index.js): `server/index.js`
- **Supabase data and storage**
- [Chat service](https://github.com/azaeeeiiii/gcare/blob/main/server/chat.js): `server/chat.js`

### Other components

- **Residents**

## Connections

- Residents → Route shell: opens (evidence: `README.md`)
- Route shell → Alerts and landing: routes to (evidence: `src/App.jsx`)
- Route shell → Incident submission: routes to (evidence: `src/App.jsx`)
- Route shell → Community news: routes to (evidence: `src/App.jsx`)
- Sign-in and identity → Supabase client: authenticates with (evidence: `src/lib/auth.js`)
- Sign-in and identity → API transport: requests profile (evidence: `src/lib/auth.js`)
- API transport → Supabase client: gets session (evidence: `src/lib/http.js`)
- API transport → Express API: sends API requests (evidence: `src/lib/http.js`)
- Express API → Supabase data and storage: reads and writes (evidence: `README.md`)
- Alerts and landing → Sign-in and identity: uses identity (evidence: `src/pages/Landing.jsx`)
- Alerts and landing → Report records and workflow: loads status (evidence: `src/pages/Landing.jsx`)
- Community news → API transport: fetches stories (evidence: `src/lib/news.js`)
- Incident submission → Report records and workflow: submits report (evidence: `src/pages/Report.jsx`)
- Incident submission → Map and area boundary: selects location (evidence: `src/pages/Report.jsx`)
- Map and area boundary → Service area rules: checks boundary (evidence: `src/components/ReportMap.jsx`)
- Report records and workflow → API transport: calls endpoints (evidence: `src/lib/reports.js`)
- Admin dashboard → Report records and workflow: reviews reports (evidence: `src/pages/Admin.jsx`)
- Report records and workflow → Express API: requests report actions (evidence: `src/lib/reports.js`)
- Volunteer assignments → Volunteer services: manages participation (evidence: `src/pages/Volunteer.jsx`)
- Volunteer assignments → Report records and workflow: submits proof (evidence: `README.md`)
- Volunteer services → API transport: calls endpoints (evidence: `src/lib/volunteer.js`)
- Verification review → ID verification: reviews submissions (evidence: `src/pages/AdminVerifications.jsx`)
- Resident profile → Sign-in and identity: updates account (evidence: `src/pages/Profile.jsx`)
- News administration → Community news: publishes stories (evidence: `src/pages/AdminNews.jsx`)
- Alert administration → Express API: manages alerts (evidence: `README.md`)
- Volunteer administration → Volunteer services: manages volunteers (evidence: `README.md`)
- Volunteer events → Volunteer services: approves signups (evidence: `README.md`)
- Contact messages → Express API: sends inquiry (evidence: `README.md`)
- Assistant widget → Hotlines and guidance: answers locally (evidence: `src/components/ChatWidget.jsx`)
- Assistant widget → Express API: asks assistant (evidence: `README.md`)
- Express API → Chat service: delegates chat (evidence: `server/index.js`)
- Chat service → Supabase data and storage: uses chat service (evidence: `README.md`)
