# teenssoftwaresolutionsllp-lang/admin-teens architecture

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

- Interactive diagram: https://gitdiagram.com/teenssoftwaresolutionsllp-lang/admin-teens
- Repository: https://github.com/teenssoftwaresolutionsllp-lang/admin-teens

## Overview

This is a role-based HRMS and employee self-service portal. Employees use the portal to manage profile changes, attendance, leave, and payslips; HR manages employees, approvals, attendance, leave policy, payroll, and projects, while executives view workforce and financial telemetry. Server-rendered pages and interactive components invoke API routes or load shared data; the data store handles domain records and salary calculations, backed by Supabase. README-documented features are retained, but links to unsampled implementations are omitted where their caller is not evidenced.

Main entry points: [`lib/data-store.ts`](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/lib/data-store.ts) (HR Data Store), [`components/admin/ApprovalsHub.tsx`](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/ApprovalsHub.tsx) (Approvals Hub), [`components/admin/PayrollManager.tsx`](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/PayrollManager.tsx) (Payroll Manager), [`app/login/page.tsx`](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/login/page.tsx) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Workforce"]
  node_login["Login<br/>[page.tsx]"]
  node_login_form["Login Form<br/>[LoginForm.tsx]"]
  node_auth_api["Login API<br/>[route.ts]"]
  node_employee_directory["Employee Directory<br/>[page.tsx]"]
  node_employee_table["Employee Table<br/>[EmployeeTable.tsx]"]
  node_employee_form["Employee Form<br/>[EmployeeForm.tsx]"]
  node_employee_api["Employee API<br/>[route.ts]"]
end

subgraph group_employee["Employee Self-Service"]
  node_portal_home["Portal Home<br/>[page.tsx]"]
  node_profile["Profile Self-Service"]
  node_profile_progress["Profile Progress"]
  node_profile_requests_api["Profile Requests API<br/>[route.ts]"]
  node_attendance_view["Attendance View"]
  node_clock_widget["Clock Widget<br/>[ClockInWidget.tsx]"]
  node_punch_api["Punch API<br/>[route.ts]"]
  node_leave_view["Leave Self-Service"]
  node_payslips["Payslip View"]
end

subgraph group_operations["HR Operations"]
  node_regularization_api["Regularization API<br/>[route.ts]"]
  node_leave_api["Leave API<br/>[route.ts]"]
  node_approvals["Approvals Hub<br/>[ApprovalsHub.tsx]"]
  node_attendance_admin["Attendance Manager"]
  node_leave_admin["Leave Manager<br/>[LeaveManager.tsx]"]
  node_projects["Projects &amp; Shifts"]
end

subgraph group_payroll["Payroll &amp; Insights"]
  node_dashboard["Executive Dashboard<br/>[page.tsx]"]
  node_dashboard_stats["Dashboard Stats<br/>[DashboardStats.tsx]"]
  node_payroll_manager["Payroll Manager<br/>[PayrollManager.tsx]"]
  node_payroll_api["Payroll Run API<br/>[route.ts]"]
  node_components_api["Salary Components API<br/>[route.ts]"]
end

subgraph group_platform["Shared Services"]
  node_calculations["Salary Calculations<br/>[calculations.ts]"]
  node_data_store["HR Data Store<br/>[data-store.ts]"]
  node_supabase_server["Supabase Client<br/>[supabase-server.ts]"]
  node_supabase[("Supabase")]
end

node_employee_actor(("Employee"))
node_hr_actor(("HR Admin"))
node_ceo_actor(("CEO"))

node_employee_actor -->|"opens"| node_login
node_hr_actor -->|"opens"| node_login
node_ceo_actor -->|"opens"| node_login
node_login -->|"renders"| node_login_form
node_login_form -.->|"authenticates"| node_auth_api
node_employee_actor -->|"uses"| node_portal_home
node_hr_actor -->|"manages"| node_employee_directory
node_employee_directory -->|"renders"| node_employee_table
node_employee_directory -->|"loads employees"| node_employee_api
node_employee_form -.->|"saves employee"| node_employee_api
node_portal_home -->|"renders"| node_profile_progress
node_profile -->|"uses"| node_profile_progress
node_profile -.->|"submits changes"| node_profile_requests_api
node_portal_home -->|"renders"| node_clock_widget
node_attendance_view -->|"renders"| node_clock_widget
node_clock_widget -.->|"records punch"| node_punch_api
node_employee_actor -->|"requests correction"| node_regularization_api
node_leave_view -.->|"loads and applies"| node_leave_api
node_payslips -.->|"presents payslips"| node_employee_actor
node_hr_actor -->|"reviews requests"| node_approvals
node_approvals -->|"reviews changes"| node_profile_requests_api
node_approvals -->|"reviews leave"| node_leave_api
node_approvals -->|"reviews punches"| node_regularization_api
node_hr_actor -->|"monitors"| node_attendance_admin
node_hr_actor -->|"configures leave"| node_leave_admin
node_hr_actor -->|"configures shifts"| node_projects
node_ceo_actor -->|"views telemetry"| node_dashboard
node_dashboard -->|"renders"| node_dashboard_stats
node_hr_actor -->|"runs payroll"| node_payroll_manager
node_payroll_manager -.->|"generates payroll"| node_payroll_api
node_payroll_manager -->|"configures components"| node_components_api
node_payroll_manager -->|"calculates salary"| node_calculations
node_payroll_api -.->|"generates payroll"| node_data_store
node_components_api -->|"updates components"| node_data_store
node_leave_api -->|"reads and writes"| node_data_store
node_profile_requests_api -->|"reads and writes"| node_data_store
node_punch_api -->|"records attendance"| node_data_store
node_regularization_api -->|"reads and writes"| node_data_store
node_employee_api -->|"reads and writes"| node_data_store
node_data_store -->|"creates admin client"| node_supabase_server
node_data_store -->|"calculates breakdown"| node_calculations
node_supabase_server -->|"connects"| node_supabase

click node_login "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/login/page.tsx"
click node_login_form "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/LoginForm.tsx"
click node_auth_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/auth/login/route.ts"
click node_employee_directory "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/dashboard/employees/page.tsx"
click node_employee_table "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/EmployeeTable.tsx"
click node_employee_form "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/EmployeeForm.tsx"
click node_employee_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/employees/route.ts"
click node_portal_home "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/portal/page.tsx"
click node_profile "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeeProfileView.tsx"
click node_profile_progress "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/ProfileProgressBar.tsx"
click node_profile_requests_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/profile-change-requests/route.ts"
click node_attendance_view "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeeAttendanceView.tsx"
click node_clock_widget "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/ClockInWidget.tsx"
click node_punch_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/attendance/punch/route.ts"
click node_regularization_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/attendance/regularization/route.ts"
click node_leave_view "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeeLeavesView.tsx"
click node_leave_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/leaves/route.ts"
click node_payslips "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeePayslipsView.tsx"
click node_approvals "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/ApprovalsHub.tsx"
click node_attendance_admin "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/AttendanceManager.tsx"
click node_leave_admin "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/LeaveManager.tsx"
click node_projects "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/ProjectsManager.tsx"
click node_dashboard "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/dashboard/page.tsx"
click node_dashboard_stats "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/DashboardStats.tsx"
click node_payroll_manager "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/PayrollManager.tsx"
click node_payroll_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/payroll/run/route.ts"
click node_components_api "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/payroll/components/route.ts"
click node_calculations "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/lib/calculations.ts"
click node_data_store "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/lib/data-store.ts"
click node_supabase_server "https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/lib/supabase-server.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_login,node_login_form,node_auth_api,node_employee_directory,node_employee_table,node_employee_form,node_employee_api toneBlue
class node_portal_home,node_profile,node_profile_progress,node_profile_requests_api,node_attendance_view,node_clock_widget,node_punch_api,node_leave_view,node_payslips toneAmber
class node_regularization_api,node_leave_api,node_approvals,node_attendance_admin,node_leave_admin,node_projects toneMint
class node_dashboard,node_dashboard_stats,node_payroll_manager,node_payroll_api,node_components_api toneRose
class node_calculations,node_data_store,node_supabase_server,node_supabase,node_employee_actor,node_hr_actor,node_ceo_actor toneIndigo
```

## Components

### Access & Workforce

- [Login](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Login Form](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/LoginForm.tsx): `components/LoginForm.tsx`
- [Login API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Employee Directory](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/dashboard/employees/page.tsx): `app/dashboard/employees/page.tsx`
- [Employee Table](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/EmployeeTable.tsx): `components/EmployeeTable.tsx`
- [Employee Form](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/EmployeeForm.tsx): `components/EmployeeForm.tsx`
- [Employee API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/employees/route.ts): `app/api/employees/route.ts`

### Employee Self-Service

- [Portal Home](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/portal/page.tsx): `app/portal/page.tsx`
- [Profile Self-Service](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeeProfileView.tsx): `components/portal/EmployeeProfileView.tsx`
- [Profile Progress](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/ProfileProgressBar.tsx): `components/portal/ProfileProgressBar.tsx`
- [Profile Requests API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/profile-change-requests/route.ts): `app/api/profile-change-requests/route.ts`
- [Attendance View](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeeAttendanceView.tsx): `components/portal/EmployeeAttendanceView.tsx`
- [Clock Widget](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/ClockInWidget.tsx): `components/portal/ClockInWidget.tsx`
- [Punch API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/attendance/punch/route.ts): `app/api/attendance/punch/route.ts`
- [Leave Self-Service](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeeLeavesView.tsx): `components/portal/EmployeeLeavesView.tsx`
- [Payslip View](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/portal/EmployeePayslipsView.tsx): `components/portal/EmployeePayslipsView.tsx`

### HR Operations

- [Regularization API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/attendance/regularization/route.ts): `app/api/attendance/regularization/route.ts`
- [Leave API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/leaves/route.ts): `app/api/leaves/route.ts`
- [Approvals Hub](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/ApprovalsHub.tsx): `components/admin/ApprovalsHub.tsx`
- [Attendance Manager](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/AttendanceManager.tsx): `components/admin/AttendanceManager.tsx`
- [Leave Manager](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/LeaveManager.tsx): `components/admin/LeaveManager.tsx`
- [Projects & Shifts](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/ProjectsManager.tsx): `components/admin/ProjectsManager.tsx`

### Payroll & Insights

- [Executive Dashboard](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Dashboard Stats](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/DashboardStats.tsx): `components/DashboardStats.tsx`
- [Payroll Manager](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/components/admin/PayrollManager.tsx): `components/admin/PayrollManager.tsx`
- [Payroll Run API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/payroll/run/route.ts): `app/api/payroll/run/route.ts`
- [Salary Components API](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/app/api/payroll/components/route.ts): `app/api/payroll/components/route.ts`

### Shared Services

- [Salary Calculations](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/lib/calculations.ts): `lib/calculations.ts`
- [HR Data Store](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/lib/data-store.ts): `lib/data-store.ts`
- [Supabase Client](https://github.com/teenssoftwaresolutionsllp-lang/admin-teens/blob/main/lib/supabase-server.ts): `lib/supabase-server.ts`
- **Supabase**

### Other components

- **Employee**
- **HR Admin**
- **CEO**

## Connections

- Employee → Login: opens
- HR Admin → Login: opens
- CEO → Login: opens
- Login → Login Form: renders (evidence: `app/login/page.tsx`)
- Login Form → Login API: authenticates
- Employee → Portal Home: uses
- HR Admin → Employee Directory: manages
- Employee Directory → Employee Table: renders (evidence: `app/dashboard/employees/page.tsx`)
- Employee Directory → Employee API: loads employees (evidence: `app/dashboard/employees/page.tsx`)
- Employee Form → Employee API: saves employee
- Portal Home → Profile Progress: renders (evidence: `app/portal/page.tsx`)
- Profile Self-Service → Profile Progress: uses (evidence: `components/portal/EmployeeProfileView.tsx`)
- Profile Self-Service → Profile Requests API: submits changes
- Portal Home → Clock Widget: renders (evidence: `app/portal/page.tsx`)
- Attendance View → Clock Widget: renders (evidence: `components/portal/EmployeeAttendanceView.tsx`)
- Clock Widget → Punch API: records punch
- Employee → Regularization API: requests correction
- Leave Self-Service → Leave API: loads and applies
- Payslip View → Employee: presents payslips
- HR Admin → Approvals Hub: reviews requests
- Approvals Hub → Profile Requests API: reviews changes
- Approvals Hub → Leave API: reviews leave
- Approvals Hub → Regularization API: reviews punches
- HR Admin → Attendance Manager: monitors
- HR Admin → Leave Manager: configures leave
- HR Admin → Projects & Shifts: configures shifts
- CEO → Executive Dashboard: views telemetry
- Executive Dashboard → Dashboard Stats: renders (evidence: `app/dashboard/page.tsx`)
- HR Admin → Payroll Manager: runs payroll
- Payroll Manager → Payroll Run API: generates payroll
- Payroll Manager → Salary Components API: configures components (evidence: `components/admin/PayrollManager.tsx`)
- Payroll Manager → Salary Calculations: calculates salary (evidence: `components/admin/PayrollManager.tsx`)
- Payroll Run API → HR Data Store: generates payroll
- Salary Components API → HR Data Store: updates components (evidence: `app/api/payroll/components/route.ts`)
- Leave API → HR Data Store: reads and writes (evidence: `app/api/leaves/route.ts`)
- Profile Requests API → HR Data Store: reads and writes (evidence: `app/api/profile-change-requests/route.ts`)
- Punch API → HR Data Store: records attendance (evidence: `app/api/attendance/punch/route.ts`)
- Regularization API → HR Data Store: reads and writes (evidence: `app/api/attendance/regularization/route.ts`)
- Employee API → HR Data Store: reads and writes (evidence: `app/api/employees/route.ts`)
- HR Data Store → Supabase Client: creates admin client (evidence: `lib/data-store.ts`)
- HR Data Store → Salary Calculations: calculates breakdown (evidence: `lib/data-store.ts`)
- Supabase Client → Supabase: connects (evidence: `lib/supabase-server.ts`)
