# swejal19/stratify architecture

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

- Interactive diagram: https://gitdiagram.com/swejal19/stratify
- Repository: https://github.com/swejal19/stratify

## Overview

Stratify is a role-based goal lifecycle portal: employees submit weighted goal sheets, managers review them, employees record quarterly actuals, and managers/admins monitor results through reports and analytics. Admin capabilities add cycles, onboarding, user governance, shared goals, and audit. The graph follows the documented browser-to-API-to-Supabase boundary and sampled frontend/backend calls; some subsystem wiring is documented but its controller implementation was not sampled, so uncertain links are omitted.

Main entry points: [`backend/src/server.js`](https://github.com/swejal19/stratify/blob/main/backend/src/server.js) (Express API), [`frontend/src/App.jsx`](https://github.com/swejal19/stratify/blob/main/frontend/src/App.jsx) (Role-based SPA), [`backend/src/config/db.js`](https://github.com/swejal19/stratify/blob/main/backend/src/config/db.js) (Supabase database), [`frontend/src/pages/ManagerApproval.jsx`](https://github.com/swejal19/stratify/blob/main/frontend/src/pages/ManagerApproval.jsx) (Manager views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Role Workflows"]
  node_spa["Role-based SPA<br/>[App.jsx]"]
  node_employee_pages["Employee views"]
  node_manager_pages["Manager views"]
  node_admin_pages["Admin views<br/>[AdminDashboard.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_domain["Goal Lifecycle"]
  node_sheets["Goal sheets"]
  node_goals["Goal management"]
  node_achievements["Quarterly check-ins"]
  node_scoring["Score calculation<br/>[scoreCalculator.js]"]
  node_cycles["Cycle management"]
  node_reports["Reports and analytics"]
end

subgraph group_governance["Administration"]
  node_access["Access requests"]
  node_users["User administration"]
  node_audit["Audit logging"]
end

subgraph group_platform["API Platform"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_server["Express API<br/>[server.js]"]
  node_db[("Supabase database<br/>[db.js]")]
  node_supabase_auth["Supabase Auth"]
end

node_employee(("Employee"))
node_manager(("Manager"))
node_admin(("Admin"))
node_requester(("Access requester"))

node_employee -->|"uses"| node_spa
node_manager -->|"uses"| node_spa
node_admin -->|"uses"| node_spa
node_spa -->|"routes"| node_employee_pages
node_spa -->|"routes"| node_manager_pages
node_spa -->|"routes"| node_admin_pages
node_employee_pages -->|"requests"| node_api_client
node_manager_pages -->|"requests"| node_api_client
node_admin_pages -->|"requests"| node_api_client
node_api_client -->|"REST calls"| node_server
node_server -->|"dispatches"| node_auth
node_server -->|"dispatches"| node_sheets
node_server -->|"dispatches"| node_goals
node_server -->|"dispatches"| node_achievements
node_server -->|"dispatches"| node_cycles
node_server -->|"dispatches"| node_reports
node_server -->|"dispatches"| node_access
node_server -->|"dispatches"| node_users
node_server -->|"dispatches"| node_audit
node_sheets -->|"reads/writes"| node_db
node_goals -->|"reads/writes"| node_db
node_achievements -->|"reads/writes"| node_db
node_cycles -->|"reads/writes"| node_db
node_reports -->|"reads"| node_db
node_reports -->|"calculates"| node_scoring
node_access -->|"reads/writes"| node_db
node_access -->|"creates accounts"| node_supabase_auth
node_users -->|"reads/writes"| node_db
node_users -->|"administers accounts"| node_supabase_auth
node_audit -->|"reads"| node_db
node_requester -->|"requests access"| node_spa
node_spa -->|"submits request"| node_access
node_manager_pages -->|"approves/reworks"| node_sheets
node_manager_pages -->|"saves comments"| node_achievements
node_manager_pages -->|"edits goals"| node_goals
node_employee_pages -->|"records actuals"| node_achievements

click node_spa "https://github.com/swejal19/stratify/blob/main/frontend/src/App.jsx"
click node_employee_pages "https://github.com/swejal19/stratify/blob/main/frontend/src/pages/EmployeeDashboard.jsx"
click node_manager_pages "https://github.com/swejal19/stratify/blob/main/frontend/src/pages/ManagerApproval.jsx"
click node_admin_pages "https://github.com/swejal19/stratify/blob/main/frontend/src/pages/admin/AdminDashboard.jsx"
click node_api_client "https://github.com/swejal19/stratify/blob/main/frontend/src/lib/api.js"
click node_sheets "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/sheets.controller.js"
click node_goals "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/goals.controller.js"
click node_achievements "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/achievements.controller.js"
click node_scoring "https://github.com/swejal19/stratify/blob/main/backend/src/utils/scoreCalculator.js"
click node_cycles "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/cycles.controller.js"
click node_reports "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/reports.controller.js"
click node_access "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/accessRequest.controller.js"
click node_users "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/users.controller.js"
click node_audit "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/audit.controller.js"
click node_auth "https://github.com/swejal19/stratify/blob/main/backend/src/controllers/auth.controller.js"
click node_server "https://github.com/swejal19/stratify/blob/main/backend/src/server.js"
click node_db "https://github.com/swejal19/stratify/blob/main/backend/src/config/db.js"

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_spa,node_employee_pages,node_manager_pages,node_admin_pages,node_api_client toneBlue
class node_sheets,node_goals,node_achievements,node_scoring,node_cycles,node_reports toneAmber
class node_access,node_users,node_audit,node_requester toneMint
class node_auth,node_server,node_db,node_supabase_auth toneRose
class node_employee,node_manager,node_admin toneIndigo
```

## Components

### Role Workflows

- [Role-based SPA](https://github.com/swejal19/stratify/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Employee views](https://github.com/swejal19/stratify/blob/main/frontend/src/pages/EmployeeDashboard.jsx): `frontend/src/pages/EmployeeDashboard.jsx`
- [Manager views](https://github.com/swejal19/stratify/blob/main/frontend/src/pages/ManagerApproval.jsx): `frontend/src/pages/ManagerApproval.jsx`
- [Admin views](https://github.com/swejal19/stratify/blob/main/frontend/src/pages/admin/AdminDashboard.jsx): `frontend/src/pages/admin/AdminDashboard.jsx`
- [API client](https://github.com/swejal19/stratify/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`

### Goal Lifecycle

- [Goal sheets](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/sheets.controller.js): `backend/src/controllers/sheets.controller.js`
- [Goal management](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/goals.controller.js): `backend/src/controllers/goals.controller.js`
- [Quarterly check-ins](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/achievements.controller.js): `backend/src/controllers/achievements.controller.js`
- [Score calculation](https://github.com/swejal19/stratify/blob/main/backend/src/utils/scoreCalculator.js): `backend/src/utils/scoreCalculator.js`
- [Cycle management](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/cycles.controller.js): `backend/src/controllers/cycles.controller.js`
- [Reports and analytics](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/reports.controller.js): `backend/src/controllers/reports.controller.js`

### Administration

- [Access requests](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/accessRequest.controller.js): `backend/src/controllers/accessRequest.controller.js`
- [User administration](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/users.controller.js): `backend/src/controllers/users.controller.js`
- [Audit logging](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/audit.controller.js): `backend/src/controllers/audit.controller.js`

### API Platform

- [Authentication](https://github.com/swejal19/stratify/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Express API](https://github.com/swejal19/stratify/blob/main/backend/src/server.js): `backend/src/server.js`
- [Supabase database](https://github.com/swejal19/stratify/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- **Supabase Auth**

### Other components

- **Employee**
- **Manager**
- **Admin**
- **Access requester**

## Connections

- Employee → Role-based SPA: uses
- Manager → Role-based SPA: uses
- Admin → Role-based SPA: uses
- Role-based SPA → Employee views: routes
- Role-based SPA → Manager views: routes
- Role-based SPA → Admin views: routes
- Employee views → API client: requests
- Manager views → API client: requests
- Admin views → API client: requests
- API client → Express API: REST calls
- Express API → Authentication: dispatches
- Express API → Goal sheets: dispatches
- Express API → Goal management: dispatches
- Express API → Quarterly check-ins: dispatches
- Express API → Cycle management: dispatches
- Express API → Reports and analytics: dispatches
- Express API → Access requests: dispatches
- Express API → User administration: dispatches
- Express API → Audit logging: dispatches
- Goal sheets → Supabase database: reads/writes
- Goal management → Supabase database: reads/writes
- Quarterly check-ins → Supabase database: reads/writes
- Cycle management → Supabase database: reads/writes
- Reports and analytics → Supabase database: reads
- Reports and analytics → Score calculation: calculates
- Access requests → Supabase database: reads/writes
- Access requests → Supabase Auth: creates accounts
- User administration → Supabase database: reads/writes
- User administration → Supabase Auth: administers accounts
- Audit logging → Supabase database: reads
- Access requester → Role-based SPA: requests access
- Role-based SPA → Access requests: submits request
- Manager views → Goal sheets: approves/reworks
- Manager views → Quarterly check-ins: saves comments
- Manager views → Goal management: edits goals
- Employee views → Quarterly check-ins: records actuals
