# superworgurn/ladee architecture

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

- Interactive diagram: https://gitdiagram.com/superworgurn/ladee
- Repository: https://github.com/superworgurn/ladee

## Overview

This is a Thai HR time-and-leave web app for employees, managers, and HR. Its core workflow is leave submission, approver review, and recording the decision; approval deducts leave balance and writes an audit log. The app also provides attendance actions, leave history, staffing views, and a “working today” view. Runtime state is held in browser localStorage, initialized from sample employee and leave data. The README is empty; unsampled page behavior is represented only where the file tree and sampled routing support it.

Main entry points: [`src/context/AppContext.tsx`](https://github.com/superworgurn/ladee/blob/main/src/context/AppContext.tsx) (App state), [`src/App.tsx`](https://github.com/superworgurn/ladee/blob/main/src/App.tsx) (App routing), [`src/pages/ManagerDashboard.tsx`](https://github.com/superworgurn/ladee/blob/main/src/pages/ManagerDashboard.tsx) (Manager dashboard), [`src/pages/Login.tsx`](https://github.com/superworgurn/ladee/blob/main/src/pages/Login.tsx) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App routing<br/>[App.tsx]"]
  node_context["App state<br/>[AppContext.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_employee["Employee dashboard"]
end

subgraph group_leave["Leave workflow"]
  node_leaveform["Leave request<br/>[LeaveForm.tsx]"]
  node_history["Leave history<br/>[LeaveHistory.tsx]"]
  node_approvals["Approval list<br/>[ApprovalList.tsx]"]
end

subgraph group_workforce["Workforce tools"]
  node_manager["Manager dashboard"]
  node_hr["HR dashboard"]
  node_today["Working today<br/>[WorkingToday.tsx]"]
  node_staffing["Staffing calculations<br/>[staffing.ts]"]
end

subgraph group_state["State and rules"]
  node_approvalrules["Approval rules<br/>[approval.ts]"]
  node_dates["Date utilities<br/>[date.ts]"]
  node_storage[("Local storage<br/>[storage.ts]")]
  node_employees["Employee seed data<br/>[employees.ts]"]
  node_leaveseed["Leave seed data<br/>[leaveRequests.ts]"]
  node_departments["Departments<br/>[departments.ts]"]
  node_types["HR data types<br/>[index.ts]"]
  node_attendance["Attendance records<br/>[AppContext.tsx]"]
end

node_people(("HR users"))

node_people -->|"use app"| node_app
node_app -->|"provides state"| node_context
node_app -->|"routes"| node_login
node_app -->|"routes"| node_employee
node_app -->|"routes"| node_leaveform
node_app -->|"routes"| node_history
node_app -->|"routes"| node_approvals
node_app -->|"routes"| node_manager
node_app -->|"routes"| node_hr
node_app -->|"routes"| node_today
node_login -->|"authenticates"| node_context
node_leaveform -->|"submits request"| node_context
node_manager -->|"calculates staffing"| node_staffing
node_manager -->|"formats dates"| node_dates
node_context -->|"guards decisions"| node_approvalrules
node_context -->|"counts leave days"| node_dates
node_context -->|"reads and writes"| node_storage
node_context -->|"loads defaults"| node_employees
node_context -->|"loads defaults"| node_leaveseed
node_context -->|"provides departments"| node_departments
node_context -->|"manages attendance"| node_attendance
node_context -->|"uses data types"| node_types

click node_app "https://github.com/superworgurn/ladee/blob/main/src/App.tsx"
click node_context "https://github.com/superworgurn/ladee/blob/main/src/context/AppContext.tsx"
click node_login "https://github.com/superworgurn/ladee/blob/main/src/pages/Login.tsx"
click node_employee "https://github.com/superworgurn/ladee/blob/main/src/pages/EmployeeDashboard.tsx"
click node_leaveform "https://github.com/superworgurn/ladee/blob/main/src/pages/LeaveForm.tsx"
click node_history "https://github.com/superworgurn/ladee/blob/main/src/pages/LeaveHistory.tsx"
click node_approvals "https://github.com/superworgurn/ladee/blob/main/src/pages/ApprovalList.tsx"
click node_manager "https://github.com/superworgurn/ladee/blob/main/src/pages/ManagerDashboard.tsx"
click node_hr "https://github.com/superworgurn/ladee/blob/main/src/pages/HRAdminDashboard.tsx"
click node_today "https://github.com/superworgurn/ladee/blob/main/src/pages/WorkingToday.tsx"
click node_approvalrules "https://github.com/superworgurn/ladee/blob/main/src/utils/approval.ts"
click node_staffing "https://github.com/superworgurn/ladee/blob/main/src/utils/staffing.ts"
click node_dates "https://github.com/superworgurn/ladee/blob/main/src/utils/date.ts"
click node_storage "https://github.com/superworgurn/ladee/blob/main/src/utils/storage.ts"
click node_employees "https://github.com/superworgurn/ladee/blob/main/src/data/employees.ts"
click node_leaveseed "https://github.com/superworgurn/ladee/blob/main/src/data/leaveRequests.ts"
click node_departments "https://github.com/superworgurn/ladee/blob/main/src/data/departments.ts"
click node_types "https://github.com/superworgurn/ladee/blob/main/src/types/index.ts"
click node_attendance "https://github.com/superworgurn/ladee/blob/main/src/context/AppContext.tsx"

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_context,node_login,node_employee,node_people toneBlue
class node_leaveform,node_history,node_approvals toneAmber
class node_manager,node_hr,node_today,node_staffing toneMint
class node_approvalrules,node_dates,node_storage,node_employees,node_leaveseed,node_departments,node_types,node_attendance toneRose
```

## Components

### Application

- [App routing](https://github.com/superworgurn/ladee/blob/main/src/App.tsx): `src/App.tsx`
- [App state](https://github.com/superworgurn/ladee/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [Login](https://github.com/superworgurn/ladee/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Employee dashboard](https://github.com/superworgurn/ladee/blob/main/src/pages/EmployeeDashboard.tsx): `src/pages/EmployeeDashboard.tsx`

### Leave workflow

- [Leave request](https://github.com/superworgurn/ladee/blob/main/src/pages/LeaveForm.tsx): `src/pages/LeaveForm.tsx`
- [Leave history](https://github.com/superworgurn/ladee/blob/main/src/pages/LeaveHistory.tsx): `src/pages/LeaveHistory.tsx`
- [Approval list](https://github.com/superworgurn/ladee/blob/main/src/pages/ApprovalList.tsx): `src/pages/ApprovalList.tsx`

### Workforce tools

- [Manager dashboard](https://github.com/superworgurn/ladee/blob/main/src/pages/ManagerDashboard.tsx): `src/pages/ManagerDashboard.tsx`
- [HR dashboard](https://github.com/superworgurn/ladee/blob/main/src/pages/HRAdminDashboard.tsx): `src/pages/HRAdminDashboard.tsx`
- [Working today](https://github.com/superworgurn/ladee/blob/main/src/pages/WorkingToday.tsx): `src/pages/WorkingToday.tsx`
- [Staffing calculations](https://github.com/superworgurn/ladee/blob/main/src/utils/staffing.ts): `src/utils/staffing.ts`

### State and rules

- [Approval rules](https://github.com/superworgurn/ladee/blob/main/src/utils/approval.ts): `src/utils/approval.ts`
- [Date utilities](https://github.com/superworgurn/ladee/blob/main/src/utils/date.ts): `src/utils/date.ts`
- [Local storage](https://github.com/superworgurn/ladee/blob/main/src/utils/storage.ts): `src/utils/storage.ts`
- [Employee seed data](https://github.com/superworgurn/ladee/blob/main/src/data/employees.ts): `src/data/employees.ts`
- [Leave seed data](https://github.com/superworgurn/ladee/blob/main/src/data/leaveRequests.ts): `src/data/leaveRequests.ts`
- [Departments](https://github.com/superworgurn/ladee/blob/main/src/data/departments.ts): `src/data/departments.ts`
- [HR data types](https://github.com/superworgurn/ladee/blob/main/src/types/index.ts): `src/types/index.ts`
- [Attendance records](https://github.com/superworgurn/ladee/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`

### Other components

- **HR users**

## Connections

- HR users → App routing: use app
- App routing → App state: provides state
- App routing → Login: routes
- App routing → Employee dashboard: routes
- App routing → Leave request: routes
- App routing → Leave history: routes
- App routing → Approval list: routes
- App routing → Manager dashboard: routes
- App routing → HR dashboard: routes
- App routing → Working today: routes
- Login → App state: authenticates
- Leave request → App state: submits request
- Manager dashboard → Staffing calculations: calculates staffing
- Manager dashboard → Date utilities: formats dates
- App state → Approval rules: guards decisions
- App state → Date utilities: counts leave days
- App state → Local storage: reads and writes
- App state → Employee seed data: loads defaults
- App state → Leave seed data: loads defaults
- App state → Departments: provides departments
- App state → Attendance records: manages attendance
- App state → HR data types: uses data types
