# codewithmaaz-05/civic_connect architecture

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

## Overview

CivicConnect is a civic-issue reporting and tracking portal: citizens can report and follow issues, the public can browse issue status, and authorities can manage and update reports. The visible runtime is a routed React application backed by Supabase, with authentication context and protected dashboard views. The README is empty and the Index page and form internals were not sampled, so their detailed wiring is not inferred; the graph shows only relationships supported by excerpts or the source index.

Main entry points: [`ground-truth-gov-main/src/App.tsx`](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/App.tsx) (App Router), [`ground-truth-gov-main/src/integrations/supabase/client.ts`](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/integrations/supabase/client.ts) (Supabase Client), [`ground-truth-gov-main/src/components/CitizenDashboard.tsx`](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/CitizenDashboard.tsx) (Citizen Dashboard), [`ground-truth-gov-main/src/components/AuthorityDashboard.tsx`](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/AuthorityDashboard.tsx) (Authority Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_runtime["React Entry<br/>[main.tsx]"]
  node_router["App Router<br/>[App.tsx]"]
  node_home["Home Page<br/>[Index.tsx]"]
  node_notfound["Not Found<br/>[NotFound.tsx]"]
end

subgraph group_auth["Identity and Access"]
  node_authpage["Sign In and Signup<br/>[Auth.tsx]"]
  node_authcontext["Auth Context<br/>[AuthContext.tsx]"]
  node_guard["Access Guard"]
end

subgraph group_issues["Issue Workflows"]
  node_reportform["Issue Reporting"]
  node_citizendash["Citizen Dashboard"]
  node_publicdash["Public Issue Board"]
  node_authoritydash["Authority Dashboard"]
  node_issuecard["Issue Display<br/>[IssueCard.tsx]"]
end

subgraph group_data["Data Services"]
  node_supabaseclient["Supabase Client<br/>[client.ts]"]
  node_supabase[("Supabase Backend")]
  node_dbtypes["Database Types<br/>[types.ts]"]
end

node_browser(("Portal User"))

node_browser -->|"opens portal"| node_runtime
node_runtime -->|"renders"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_authpage
node_router -->|"routes to"| node_notfound
node_router -->|"provides context"| node_authcontext
node_guard -->|"reads session"| node_authcontext
node_citizendash -->|"guards view"| node_guard
node_authoritydash -->|"guards view"| node_guard
node_citizendash -->|"renders issues"| node_issuecard
node_authoritydash -->|"renders issues"| node_issuecard
node_publicdash -->|"renders issues"| node_issuecard
node_citizendash -->|"queries reports"| node_supabaseclient
node_publicdash -->|"queries reports"| node_supabaseclient
node_authoritydash -.->|"loads reports"| node_supabaseclient
node_supabaseclient -->|"connects to"| node_supabase
node_supabaseclient -->|"uses schema types"| node_dbtypes

click node_runtime "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/main.tsx"
click node_router "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/App.tsx"
click node_home "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/pages/Index.tsx"
click node_authpage "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/pages/Auth.tsx"
click node_notfound "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/pages/NotFound.tsx"
click node_authcontext "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/contexts/AuthContext.tsx"
click node_guard "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/ProtectedComponent.tsx"
click node_reportform "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/IssueReportForm.tsx"
click node_citizendash "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/CitizenDashboard.tsx"
click node_publicdash "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/PublicDashboard.tsx"
click node_authoritydash "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/AuthorityDashboard.tsx"
click node_issuecard "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/IssueCard.tsx"
click node_supabaseclient "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/integrations/supabase/client.ts"
click node_dbtypes "https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/integrations/supabase/types.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_runtime,node_router,node_home,node_notfound,node_browser toneBlue
class node_authpage,node_authcontext,node_guard toneAmber
class node_reportform,node_citizendash,node_publicdash,node_authoritydash,node_issuecard toneMint
class node_supabaseclient,node_supabase,node_dbtypes toneRose
```

## Components

### Application

- [React Entry](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/main.tsx): `ground-truth-gov-main/src/main.tsx`
- [App Router](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/App.tsx): `ground-truth-gov-main/src/App.tsx`
- [Home Page](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/pages/Index.tsx): `ground-truth-gov-main/src/pages/Index.tsx`
- [Not Found](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/pages/NotFound.tsx): `ground-truth-gov-main/src/pages/NotFound.tsx`

### Identity and Access

- [Sign In and Signup](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/pages/Auth.tsx): `ground-truth-gov-main/src/pages/Auth.tsx`
- [Auth Context](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/contexts/AuthContext.tsx): `ground-truth-gov-main/src/contexts/AuthContext.tsx`
- [Access Guard](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/ProtectedComponent.tsx): `ground-truth-gov-main/src/components/ProtectedComponent.tsx`

### Issue Workflows

- [Issue Reporting](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/IssueReportForm.tsx): `ground-truth-gov-main/src/components/IssueReportForm.tsx`
- [Citizen Dashboard](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/CitizenDashboard.tsx): `ground-truth-gov-main/src/components/CitizenDashboard.tsx`
- [Public Issue Board](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/PublicDashboard.tsx): `ground-truth-gov-main/src/components/PublicDashboard.tsx`
- [Authority Dashboard](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/AuthorityDashboard.tsx): `ground-truth-gov-main/src/components/AuthorityDashboard.tsx`
- [Issue Display](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/components/IssueCard.tsx): `ground-truth-gov-main/src/components/IssueCard.tsx`

### Data Services

- [Supabase Client](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/integrations/supabase/client.ts): `ground-truth-gov-main/src/integrations/supabase/client.ts`
- **Supabase Backend**
- [Database Types](https://github.com/codewithmaaz-05/civic_connect/blob/main/ground-truth-gov-main/src/integrations/supabase/types.ts): `ground-truth-gov-main/src/integrations/supabase/types.ts`

### Other components

- **Portal User**

## Connections

- Portal User → React Entry: opens portal (evidence: `ground-truth-gov-main/src/main.tsx`)
- React Entry → App Router: renders (evidence: `ground-truth-gov-main/src/main.tsx`)
- App Router → Home Page: routes to (evidence: `ground-truth-gov-main/src/App.tsx`)
- App Router → Sign In and Signup: routes to (evidence: `ground-truth-gov-main/src/App.tsx`)
- App Router → Not Found: routes to (evidence: `ground-truth-gov-main/src/App.tsx`)
- App Router → Auth Context: provides context (evidence: `ground-truth-gov-main/src/App.tsx`)
- Access Guard → Auth Context: reads session (evidence: `ground-truth-gov-main/src/components/ProtectedComponent.tsx`)
- Citizen Dashboard → Access Guard: guards view (evidence: `ground-truth-gov-main/src/components/CitizenDashboard.tsx`)
- Authority Dashboard → Access Guard: guards view (evidence: `ground-truth-gov-main/src/components/AuthorityDashboard.tsx`)
- Citizen Dashboard → Issue Display: renders issues (evidence: `ground-truth-gov-main/src/components/CitizenDashboard.tsx`)
- Authority Dashboard → Issue Display: renders issues (evidence: `ground-truth-gov-main/src/components/AuthorityDashboard.tsx`)
- Public Issue Board → Issue Display: renders issues (evidence: `ground-truth-gov-main/src/components/PublicDashboard.tsx`)
- Citizen Dashboard → Supabase Client: queries reports (evidence: `ground-truth-gov-main/src/components/CitizenDashboard.tsx`)
- Public Issue Board → Supabase Client: queries reports (evidence: `ground-truth-gov-main/src/components/PublicDashboard.tsx`)
- Authority Dashboard → Supabase Client: loads reports
- Supabase Client → Supabase Backend: connects to (evidence: `ground-truth-gov-main/src/integrations/supabase/client.ts`)
- Supabase Client → Database Types: uses schema types (evidence: `ground-truth-gov-main/src/integrations/supabase/client.ts`)
