# my-project-team-2026/barangaylink-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/my-project-team-2026/barangaylink-frontend
- Repository: https://github.com/my-project-team-2026/barangaylink-frontend

## Overview

BarangayLink is a React frontend for barangay staff, administrators, and residents. Users enter through the shared web or Electron interface, authenticate or register, then use role-specific dashboard, resident, and document-request screens; staff can also access household, announcement, and report screens. The API client sends requests to the separately supplied backend and stores the login session in browser local storage. README capabilities are included, but it notes several proposal features are unavailable through the supplied backend. Some screen-to-API call sites were not excerpted, so those relationships are not asserted.

Main entry points: [`src/App.tsx`](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx) (Workspace and routing), [`src/shared.tsx`](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/shared.tsx) (Shared UI helpers), [`src/main.tsx`](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/main.tsx) (Renderer entry), [`desktop/main.cjs`](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/desktop/main.cjs) (Electron window host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_web_entry["Renderer entry<br/>[main.tsx]"]
  node_workspace["Workspace and routing<br/>[App.tsx]"]
  node_auth["Sign in and registration<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[App.tsx]"]
  node_shared["Shared UI helpers<br/>[shared.tsx]"]
end

subgraph group_domains["Community services"]
  node_residents["Resident search<br/>[App.tsx]"]
  node_requests["Document requests<br/>[App.tsx]"]
  node_households["Household management<br/>[modules.tsx]"]
  node_announcements["Announcements<br/>[modules.tsx]"]
  node_reports["Reports and analytics<br/>[modules.tsx]"]
end

subgraph group_integration["API integration"]
  node_api["API client and session<br/>[api.ts]"]
  node_backend["BarangayLink backend"]
end

subgraph group_desktop["Desktop wrapper"]
  node_electron["Electron window host<br/>[main.cjs]"]
  node_preload["Minimal preload<br/>[preload.cjs]"]
end

node_user(("Resident or staff"))

node_user -->|"opens"| node_web_entry
node_web_entry -->|"renders"| node_workspace
node_workspace -->|"routes"| node_auth
node_workspace -->|"routes"| node_dashboard
node_workspace -->|"routes"| node_residents
node_workspace -->|"routes"| node_requests
node_workspace -->|"routes"| node_households
node_workspace -->|"routes"| node_announcements
node_workspace -->|"routes"| node_reports
node_workspace -->|"uses"| node_shared
node_households -->|"uses"| node_shared
node_announcements -->|"uses"| node_shared
node_reports -->|"uses"| node_shared
node_workspace -->|"reads session"| node_api
node_api -->|"sends API requests"| node_backend
node_electron -->|"loads interface"| node_web_entry
node_electron -->|"configures"| node_preload

click node_web_entry "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/main.tsx"
click node_workspace "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx"
click node_auth "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx"
click node_dashboard "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx"
click node_residents "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx"
click node_requests "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx"
click node_households "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/modules.tsx"
click node_announcements "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/modules.tsx"
click node_reports "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/modules.tsx"
click node_shared "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/shared.tsx"
click node_api "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/api.ts"
click node_electron "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/desktop/main.cjs"
click node_preload "https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/desktop/preload.cjs"

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_web_entry,node_workspace,node_auth,node_dashboard,node_shared toneBlue
class node_residents,node_requests,node_households,node_announcements,node_reports toneAmber
class node_api,node_backend toneMint
class node_electron,node_preload toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Renderer entry](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/main.tsx): `src/main.tsx`
- [Workspace and routing](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx): `src/App.tsx`
- [Sign in and registration](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx): `src/App.tsx`
- [Shared UI helpers](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/shared.tsx): `src/shared.tsx`

### Community services

- [Resident search](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx): `src/App.tsx`
- [Document requests](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/App.tsx): `src/App.tsx`
- [Household management](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/modules.tsx): `src/modules.tsx`
- [Announcements](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/modules.tsx): `src/modules.tsx`
- [Reports and analytics](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/modules.tsx): `src/modules.tsx`

### API integration

- [API client and session](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/src/api.ts): `src/api.ts`
- **BarangayLink backend**

### Desktop wrapper

- [Electron window host](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/desktop/main.cjs): `desktop/main.cjs`
- [Minimal preload](https://github.com/my-project-team-2026/barangaylink-frontend/blob/main/desktop/preload.cjs): `desktop/preload.cjs`

### Other components

- **Resident or staff**

## Connections

- Resident or staff → Renderer entry: opens (evidence: `README.md`)
- Renderer entry → Workspace and routing: renders (evidence: `src/main.tsx`)
- Workspace and routing → Sign in and registration: routes (evidence: `src/App.tsx`)
- Workspace and routing → Dashboard: routes (evidence: `src/App.tsx`)
- Workspace and routing → Resident search: routes (evidence: `src/App.tsx`)
- Workspace and routing → Document requests: routes (evidence: `src/App.tsx`)
- Workspace and routing → Household management: routes (evidence: `src/App.tsx`)
- Workspace and routing → Announcements: routes (evidence: `src/App.tsx`)
- Workspace and routing → Reports and analytics: routes (evidence: `src/App.tsx`)
- Workspace and routing → Shared UI helpers: uses (evidence: `src/App.tsx`)
- Household management → Shared UI helpers: uses (evidence: `src/modules.tsx`)
- Announcements → Shared UI helpers: uses (evidence: `src/modules.tsx`)
- Reports and analytics → Shared UI helpers: uses (evidence: `src/modules.tsx`)
- Workspace and routing → API client and session: reads session (evidence: `src/App.tsx`)
- API client and session → BarangayLink backend: sends API requests (evidence: `src/api.ts`)
- Electron window host → Renderer entry: loads interface (evidence: `desktop/main.cjs`)
- Electron window host → Minimal preload: configures (evidence: `desktop/main.cjs`)
