# raunitkumar30/governscale architecture

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

- Interactive diagram: https://gitdiagram.com/raunitkumar30/governscale
- Repository: https://github.com/raunitkumar30/governscale

## Overview

GovernScale is a client-side governance productivity app: administrators create and cascade missions through five administrative tiers, frontline staff submit deliverables and evidence, and supervisors verify work. Scores and roll-ups support tier dashboards, reports, analytics, and decision support. The graph preserves those documented capabilities while distinguishing route/auth, domain data, and scoring layers. Some feature pages were not sampled; their presence and mission cascade are documented in the README, so those relationships are cited there rather than presented as inspected implementation calls.

Main entry points: [`client/src/App.jsx`](https://github.com/raunitkumar30/governscale/blob/main/client/src/App.jsx) (Application routes), [`client/src/pages/government`](https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/government) (Government tier), [`client/src/pages/department`](https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/department) (Department tier), [`client/src/pages/team`](https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/team) (Team tier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_routes["Application routes<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_auth["Authentication context<br/>[AuthContext.jsx]"]
  node_guard["Role route guard<br/>[ProtectedRoute.jsx]"]
  node_layout["Dashboard shell"]
end

subgraph group_directives["Governance structure"]
  node_government["Government tier"]
  node_department["Department tier"]
  node_organization["Organization tier"]
  node_hierarchy["Organization hierarchy<br/>[hierarchy.js]"]
end

subgraph group_work["Work execution"]
  node_team["Team tier"]
  node_employee["Employee tasks<br/>[EmployeeTasks.jsx]"]
end

subgraph group_insights["Performance insights"]
  node_analytics["Tier analytics"]
  node_reports["Tier reports"]
  node_decision["Decision support"]
  node_audit["Audit trail<br/>[AuditLog.jsx]"]
end

subgraph group_platform["Client data and logic"]
  node_storage[("Local data store<br/>[localStorage.js]")]
  node_scoring["Scoring engine<br/>[scoringEngine.js]"]
end

node_user(("Government users"))

node_user -->|"opens app"| node_routes
node_routes -->|"routes login"| node_login
node_login -->|"authenticates"| node_auth
node_routes -->|"protects routes"| node_guard
node_guard -->|"checks identity"| node_auth
node_routes -->|"routes tier pages"| node_government
node_routes -->|"routes tier pages"| node_department
node_routes -->|"routes tier pages"| node_organization
node_routes -->|"routes tier pages"| node_team
node_routes -->|"routes task page"| node_employee
node_government -->|"cascades missions"| node_department
node_department -->|"cascades directives"| node_organization
node_organization -->|"allocates work"| node_team
node_team -->|"assigns tasks"| node_employee
node_government -->|"manages structure"| node_hierarchy
node_government -->|"reads and writes"| node_storage
node_department -->|"reads and writes"| node_storage
node_employee -->|"updates task data"| node_storage
node_team -.->|"persists work"| node_storage
node_government -->|"calculates scores"| node_scoring
node_department -->|"calculates scores"| node_scoring
node_employee -->|"evaluates performance"| node_scoring
node_government -.->|"presents metrics"| node_analytics
node_department -->|"presents reports"| node_reports
node_government -.->|"reviews bottlenecks"| node_decision
node_government -.->|"reviews activity"| node_audit

click node_routes "https://github.com/raunitkumar30/governscale/blob/main/client/src/App.jsx"
click node_login "https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/auth/Login.jsx"
click node_auth "https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/auth/AuthContext.jsx"
click node_guard "https://github.com/raunitkumar30/governscale/blob/main/client/src/components/auth/ProtectedRoute.jsx"
click node_layout "https://github.com/raunitkumar30/governscale/blob/main/client/src/components/layout/DashboardLayout.jsx"
click node_government "https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/government"
click node_department "https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/department"
click node_organization "https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/organization"
click node_team "https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/team"
click node_employee "https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/employee/EmployeeTasks.jsx"
click node_hierarchy "https://github.com/raunitkumar30/governscale/blob/main/client/src/data/hierarchy.js"
click node_storage "https://github.com/raunitkumar30/governscale/blob/main/client/src/utils/localStorage.js"
click node_scoring "https://github.com/raunitkumar30/governscale/blob/main/client/src/utils/scoringEngine.js"
click node_analytics "https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/government/GovernmentAnalytics.jsx"
click node_reports "https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/department/DepartmentReports.jsx"
click node_decision "https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/government/DecisionSupport.jsx"
click node_audit "https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/government/AuditLog.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_routes,node_login,node_auth,node_guard,node_layout,node_user toneBlue
class node_government,node_department,node_organization,node_hierarchy toneAmber
class node_team,node_employee toneMint
class node_analytics,node_reports,node_decision,node_audit toneRose
class node_storage,node_scoring toneIndigo
```

## Components

### Access and navigation

- [Application routes](https://github.com/raunitkumar30/governscale/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Login](https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/auth/Login.jsx): `client/src/pages/auth/Login.jsx`
- [Authentication context](https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/auth/AuthContext.jsx): `client/src/pages/auth/AuthContext.jsx`
- [Role route guard](https://github.com/raunitkumar30/governscale/blob/main/client/src/components/auth/ProtectedRoute.jsx): `client/src/components/auth/ProtectedRoute.jsx`
- [Dashboard shell](https://github.com/raunitkumar30/governscale/blob/main/client/src/components/layout/DashboardLayout.jsx): `client/src/components/layout/DashboardLayout.jsx`

### Governance structure

- [Government tier](https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/government): `client/src/pages/government`
- [Department tier](https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/department): `client/src/pages/department`
- [Organization tier](https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/organization): `client/src/pages/organization`
- [Organization hierarchy](https://github.com/raunitkumar30/governscale/blob/main/client/src/data/hierarchy.js): `client/src/data/hierarchy.js`

### Work execution

- [Team tier](https://github.com/raunitkumar30/governscale/tree/main/client/src/pages/team): `client/src/pages/team`
- [Employee tasks](https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/employee/EmployeeTasks.jsx): `client/src/pages/employee/EmployeeTasks.jsx`

### Performance insights

- [Tier analytics](https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/government/GovernmentAnalytics.jsx): `client/src/pages/government/GovernmentAnalytics.jsx`
- [Tier reports](https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/department/DepartmentReports.jsx): `client/src/pages/department/DepartmentReports.jsx`
- [Decision support](https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/government/DecisionSupport.jsx): `client/src/pages/government/DecisionSupport.jsx`
- [Audit trail](https://github.com/raunitkumar30/governscale/blob/main/client/src/pages/government/AuditLog.jsx): `client/src/pages/government/AuditLog.jsx`

### Client data and logic

- [Local data store](https://github.com/raunitkumar30/governscale/blob/main/client/src/utils/localStorage.js): `client/src/utils/localStorage.js`
- [Scoring engine](https://github.com/raunitkumar30/governscale/blob/main/client/src/utils/scoringEngine.js): `client/src/utils/scoringEngine.js`

### Other components

- **Government users**

## Connections

- Government users → Application routes: opens app (evidence: `client/src/App.jsx`)
- Application routes → Login: routes login (evidence: `client/src/App.jsx`)
- Login → Authentication context: authenticates (evidence: `client/src/pages/auth/Login.jsx`)
- Application routes → Role route guard: protects routes (evidence: `client/src/App.jsx`)
- Role route guard → Authentication context: checks identity (evidence: `client/src/components/auth/ProtectedRoute.jsx`)
- Application routes → Government tier: routes tier pages (evidence: `client/src/App.jsx`)
- Application routes → Department tier: routes tier pages (evidence: `client/src/App.jsx`)
- Application routes → Organization tier: routes tier pages (evidence: `client/src/App.jsx`)
- Application routes → Team tier: routes tier pages (evidence: `client/src/App.jsx`)
- Application routes → Employee tasks: routes task page (evidence: `client/src/App.jsx`)
- Government tier → Department tier: cascades missions (evidence: `README.md`)
- Department tier → Organization tier: cascades directives (evidence: `README.md`)
- Organization tier → Team tier: allocates work (evidence: `README.md`)
- Team tier → Employee tasks: assigns tasks (evidence: `README.md`)
- Government tier → Organization hierarchy: manages structure (evidence: `client/src/pages/government/OrganizationHierarchy.jsx`)
- Government tier → Local data store: reads and writes (evidence: `client/src/pages/government/GovernmentDashboard.jsx`)
- Department tier → Local data store: reads and writes (evidence: `client/src/pages/department/DepartmentDashboard.jsx`)
- Employee tasks → Local data store: updates task data (evidence: `README.md`)
- Team tier → Local data store: persists work (evidence: `client/src/pages/team/TeamDashboard.jsx`)
- Government tier → Scoring engine: calculates scores (evidence: `client/src/pages/government/GovernmentDashboard.jsx`)
- Department tier → Scoring engine: calculates scores (evidence: `client/src/pages/department/DepartmentDashboard.jsx`)
- Employee tasks → Scoring engine: evaluates performance (evidence: `client/src/pages/employee/EmployeeTasks.jsx`)
- Government tier → Tier analytics: presents metrics (evidence: `README.md`)
- Department tier → Tier reports: presents reports (evidence: `client/src/pages/department/DepartmentReports.jsx`)
- Government tier → Decision support: reviews bottlenecks (evidence: `README.md`)
- Government tier → Audit trail: reviews activity (evidence: `README.md`)
