# hriday21223/voluntrack architecture

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

- Interactive diagram: https://gitdiagram.com/hriday21223/voluntrack
- Repository: https://github.com/hriday21223/voluntrack

## Overview

VolunTrack is a volunteer-hour tracking product with local-first use and optional server-backed accounts and institutional features. The main workflow is volunteers logging hours, tracking progress, and producing reports or verification; schools, organizations, parents, and administrators have separate management views. The graph combines README-documented capabilities with sampled source relationships. Some feature routes were not sampled, so their nodes reflect documented subsystems and their links cite the README rather than implying inspected implementation details.

Main entry points: [`server/db.js`](https://github.com/hriday21223/voluntrack/blob/main/server/db.js) (PostgreSQL data), [`src/App.jsx`](https://github.com/hriday21223/voluntrack/blob/main/src/App.jsx) (App routing), [`src/pages/LogHours.jsx`](https://github.com/hriday21223/voluntrack/blob/main/src/pages/LogHours.jsx) (Hour tracking), [`server.js`](https://github.com/hriday21223/voluntrack/blob/main/server.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Volunteer app"]
  node_app["App routing<br/>[App.jsx]"]
  node_hour_tracking["Hour tracking<br/>[LogHours.jsx]"]
  node_progress["Goals and badges<br/>[useData.jsx]"]
  node_local_data[("Local persistence<br/>[storage.js]")]
  node_reports["Reports and exports<br/>[export.js]"]
  node_calendar["Calendar view<br/>[CalendarView.jsx]"]
  node_opportunities["Volunteer opportunities<br/>[Opportunities.jsx]"]
  node_reminders["Reminders<br/>[useReminders.js]"]
  node_auth_ui["Session management<br/>[useAuth.jsx]"]
end

subgraph group_server["Accounts and services"]
  node_backend["HTTP server<br/>[server.js]"]
  node_auth_service["Authentication<br/>[auth.js]"]
  node_accounts_route["Account routes<br/>[auth.js]"]
  node_database[("PostgreSQL data<br/>[db.js]")]
  node_audit["Access audit trail<br/>[audit.js]"]
  node_email["Email delivery<br/>[email.js]"]
end

subgraph group_institutions["Institutional workflows"]
  node_school_admin["School management<br/>[school.js]"]
  node_org_admin["Organization management<br/>[organization.js]"]
  node_task_makers["Task management<br/>[MyTasks.jsx]"]
  node_parent_view["Parent dashboard<br/>[parent.js]"]
  node_tenant_storage["School proof storage<br/>[storage.js]"]
  node_admin["Admin console<br/>[Admin.jsx]"]
end

subgraph group_shared["Shared capabilities"]
  node_sync["Cross-device sync<br/>[logSync.js]"]
  node_api["Client API<br/>[index.js]"]
  node_verification["Hour verification<br/>[logs.js]"]
end

node_volunteers(("Volunteers"))

node_volunteers -->|"use"| node_app
node_app -->|"routes to"| node_hour_tracking
node_hour_tracking -.->|"save hours"| node_local_data
node_hour_tracking -.->|"submit for review"| node_verification
node_progress -.->|"persist progress"| node_local_data
node_app -.->|"routes to"| node_calendar
node_app -.->|"routes to"| node_opportunities
node_app -.->|"routes to"| node_reports
node_app -.->|"routes to"| node_reminders
node_hour_tracking -.->|"updates"| node_progress
node_auth_ui -->|"pull logs"| node_sync
node_sync -->|"read local data"| node_api
node_api -->|"read and write"| node_local_data
node_auth_ui -.->|"authenticate"| node_backend
node_backend -->|"register routes"| node_accounts_route
node_accounts_route -->|"sign tokens"| node_auth_service
node_auth_service -->|"query accounts"| node_database
node_backend -->|"query data"| node_database
node_school_admin -.->|"manage records"| node_database
node_org_admin -.->|"manage records"| node_database
node_task_makers -.->|"manage tasks"| node_database
node_parent_view -.->|"read linked hours"| node_database
node_verification -.->|"record status"| node_database
node_tenant_storage -->|"configure bucket"| node_database
node_tenant_storage -.->|"audit access"| node_audit
node_backend -.->|"send messages"| node_email
node_admin -.->|"manage platform"| node_database

click node_app "https://github.com/hriday21223/voluntrack/blob/main/src/App.jsx"
click node_hour_tracking "https://github.com/hriday21223/voluntrack/blob/main/src/pages/LogHours.jsx"
click node_progress "https://github.com/hriday21223/voluntrack/blob/main/src/hooks/useData.jsx"
click node_local_data "https://github.com/hriday21223/voluntrack/blob/main/src/lib/storage.js"
click node_reports "https://github.com/hriday21223/voluntrack/blob/main/src/lib/export.js"
click node_calendar "https://github.com/hriday21223/voluntrack/blob/main/src/pages/CalendarView.jsx"
click node_opportunities "https://github.com/hriday21223/voluntrack/blob/main/src/pages/Opportunities.jsx"
click node_reminders "https://github.com/hriday21223/voluntrack/blob/main/src/hooks/useReminders.js"
click node_auth_ui "https://github.com/hriday21223/voluntrack/blob/main/src/hooks/useAuth.jsx"
click node_sync "https://github.com/hriday21223/voluntrack/blob/main/src/lib/logSync.js"
click node_api "https://github.com/hriday21223/voluntrack/blob/main/src/api/index.js"
click node_backend "https://github.com/hriday21223/voluntrack/blob/main/server.js"
click node_auth_service "https://github.com/hriday21223/voluntrack/blob/main/server/auth.js"
click node_accounts_route "https://github.com/hriday21223/voluntrack/blob/main/server/routes/auth.js"
click node_database "https://github.com/hriday21223/voluntrack/blob/main/server/db.js"
click node_school_admin "https://github.com/hriday21223/voluntrack/blob/main/server/routes/school.js"
click node_org_admin "https://github.com/hriday21223/voluntrack/blob/main/server/routes/organization.js"
click node_task_makers "https://github.com/hriday21223/voluntrack/blob/main/src/pages/MyTasks.jsx"
click node_parent_view "https://github.com/hriday21223/voluntrack/blob/main/server/routes/parent.js"
click node_verification "https://github.com/hriday21223/voluntrack/blob/main/server/routes/logs.js"
click node_tenant_storage "https://github.com/hriday21223/voluntrack/blob/main/server/routes/storage.js"
click node_audit "https://github.com/hriday21223/voluntrack/blob/main/server/audit.js"
click node_email "https://github.com/hriday21223/voluntrack/blob/main/server/email.js"
click node_admin "https://github.com/hriday21223/voluntrack/blob/main/src/pages/Admin.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_app,node_hour_tracking,node_progress,node_local_data,node_reports,node_calendar,node_opportunities,node_reminders,node_auth_ui toneBlue
class node_backend,node_auth_service,node_accounts_route,node_database,node_audit,node_email toneAmber
class node_school_admin,node_org_admin,node_task_makers,node_parent_view,node_tenant_storage,node_admin toneMint
class node_sync,node_api,node_verification toneRose
class node_volunteers toneIndigo
```

## Components

### Volunteer app

- [App routing](https://github.com/hriday21223/voluntrack/blob/main/src/App.jsx): `src/App.jsx`
- [Hour tracking](https://github.com/hriday21223/voluntrack/blob/main/src/pages/LogHours.jsx): `src/pages/LogHours.jsx`
- [Goals and badges](https://github.com/hriday21223/voluntrack/blob/main/src/hooks/useData.jsx): `src/hooks/useData.jsx`
- [Local persistence](https://github.com/hriday21223/voluntrack/blob/main/src/lib/storage.js): `src/lib/storage.js`
- [Reports and exports](https://github.com/hriday21223/voluntrack/blob/main/src/lib/export.js): `src/lib/export.js`
- [Calendar view](https://github.com/hriday21223/voluntrack/blob/main/src/pages/CalendarView.jsx): `src/pages/CalendarView.jsx`
- [Volunteer opportunities](https://github.com/hriday21223/voluntrack/blob/main/src/pages/Opportunities.jsx): `src/pages/Opportunities.jsx`
- [Reminders](https://github.com/hriday21223/voluntrack/blob/main/src/hooks/useReminders.js): `src/hooks/useReminders.js`
- [Session management](https://github.com/hriday21223/voluntrack/blob/main/src/hooks/useAuth.jsx): `src/hooks/useAuth.jsx`

### Accounts and services

- [HTTP server](https://github.com/hriday21223/voluntrack/blob/main/server.js): `server.js`
- [Authentication](https://github.com/hriday21223/voluntrack/blob/main/server/auth.js): `server/auth.js`
- [Account routes](https://github.com/hriday21223/voluntrack/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [PostgreSQL data](https://github.com/hriday21223/voluntrack/blob/main/server/db.js): `server/db.js`
- [Access audit trail](https://github.com/hriday21223/voluntrack/blob/main/server/audit.js): `server/audit.js`
- [Email delivery](https://github.com/hriday21223/voluntrack/blob/main/server/email.js): `server/email.js`

### Institutional workflows

- [School management](https://github.com/hriday21223/voluntrack/blob/main/server/routes/school.js): `server/routes/school.js`
- [Organization management](https://github.com/hriday21223/voluntrack/blob/main/server/routes/organization.js): `server/routes/organization.js`
- [Task management](https://github.com/hriday21223/voluntrack/blob/main/src/pages/MyTasks.jsx): `src/pages/MyTasks.jsx`
- [Parent dashboard](https://github.com/hriday21223/voluntrack/blob/main/server/routes/parent.js): `server/routes/parent.js`
- [School proof storage](https://github.com/hriday21223/voluntrack/blob/main/server/routes/storage.js): `server/routes/storage.js`
- [Admin console](https://github.com/hriday21223/voluntrack/blob/main/src/pages/Admin.jsx): `src/pages/Admin.jsx`

### Shared capabilities

- [Cross-device sync](https://github.com/hriday21223/voluntrack/blob/main/src/lib/logSync.js): `src/lib/logSync.js`
- [Client API](https://github.com/hriday21223/voluntrack/blob/main/src/api/index.js): `src/api/index.js`
- [Hour verification](https://github.com/hriday21223/voluntrack/blob/main/server/routes/logs.js): `server/routes/logs.js`

### Other components

- **Volunteers**

## Connections

- Volunteers → App routing: use (evidence: `README.md`)
- App routing → Hour tracking: routes to (evidence: `src/App.jsx`)
- Hour tracking → Local persistence: save hours
- Hour tracking → Hour verification: submit for review (evidence: `README.md`)
- Goals and badges → Local persistence: persist progress (evidence: `README.md`)
- App routing → Calendar view: routes to (evidence: `README.md`)
- App routing → Volunteer opportunities: routes to (evidence: `README.md`)
- App routing → Reports and exports: routes to (evidence: `README.md`)
- App routing → Reminders: routes to (evidence: `README.md`)
- Hour tracking → Goals and badges: updates (evidence: `README.md`)
- Session management → Cross-device sync: pull logs (evidence: `src/hooks/useAuth.jsx`)
- Cross-device sync → Client API: read local data (evidence: `src/lib/logSync.js`)
- Client API → Local persistence: read and write (evidence: `src/api/index.js`)
- Session management → HTTP server: authenticate (evidence: `README.md`)
- HTTP server → Account routes: register routes (evidence: `server.js`)
- Account routes → Authentication: sign tokens (evidence: `server/routes/auth.js`)
- Authentication → PostgreSQL data: query accounts (evidence: `server/auth.js`)
- HTTP server → PostgreSQL data: query data (evidence: `server.js`)
- School management → PostgreSQL data: manage records (evidence: `README.md`)
- Organization management → PostgreSQL data: manage records (evidence: `README.md`)
- Task management → PostgreSQL data: manage tasks (evidence: `README.md`)
- Parent dashboard → PostgreSQL data: read linked hours (evidence: `README.md`)
- Hour verification → PostgreSQL data: record status (evidence: `README.md`)
- School proof storage → PostgreSQL data: configure bucket (evidence: `server/routes/storage.js`)
- School proof storage → Access audit trail: audit access (evidence: `README.md`)
- HTTP server → Email delivery: send messages (evidence: `README.md`)
- Admin console → PostgreSQL data: manage platform (evidence: `README.md`)
