# mimnets/openhrapp architecture

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

- Interactive diagram: https://gitdiagram.com/mimnets/openhrapp
- Repository: https://github.com/mimnets/openhrapp

## Overview

OpenHRApp is a multi-tenant HRMS for small and mid-sized organizations. Employees and administrators enter through the React app; its authenticated pages support attendance, leave approvals, reviews, organization management, and reporting, with Supabase providing auth and persisted data. The graph retains the documented product areas even where their implementation was not sampled. Edges are limited to relationships visible in excerpts, SOURCE INDEX references, or README statements; unsampled feature links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/mimnets/openhrapp/blob/main/src/App.tsx) (App routing), [`src/services/hrService.ts`](https://github.com/mimnets/openhrapp/blob/main/src/services/hrService.ts) (HR service facade), [`src/services/supabase.ts`](https://github.com/mimnets/openhrapp/blob/main/src/services/supabase.ts) (Supabase client), [`src/context/AuthContext.tsx`](https://github.com/mimnets/openhrapp/blob/main/src/context/AuthContext.tsx) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and identity"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_session["Session lifecycle<br/>[sessionManager.ts]"]
  node_subscription["Subscription access"]
  node_pwa["Offline-ready PWA"]
end

subgraph group_workforce["Workforce operations"]
  node_attendance["Attendance tracking<br/>[Attendance.tsx]"]
  node_leave["Leave workflows"]
  node_reviews["Performance reviews"]
  node_review_hook["Review data flow"]
  node_directory["Employee directory"]
  node_reports["Reports and analytics<br/>[Reports.tsx]"]
end

subgraph group_admin["Organization and oversight"]
  node_organization["Organization setup<br/>[Organization.tsx]"]
  node_announcements["Announcements<br/>[Announcements.tsx]"]
  node_notifications["Notifications"]
  node_superadmin["Superadmin tools<br/>[SuperAdmin.tsx]"]
end

subgraph group_platform["Services and persistence"]
  node_attendance_service["Attendance service"]
  node_review_service["Review service<br/>[review.service.ts]"]
  node_hr_service["HR service facade<br/>[hrService.ts]"]
  node_org_service["Organization service"]
  node_client["API client<br/>[api.client.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

node_user(("Employee or admin"))
node_supabase[("Supabase platform")]

node_user -->|"uses"| node_app
node_app -->|"provides context"| node_auth
node_app -->|"routes to"| node_attendance
node_app -->|"routes to"| node_reviews
node_app -->|"provides context"| node_subscription
node_auth -->|"delegates lifecycle"| node_session
node_session -->|"refreshes auth"| node_supabase_client
node_reviews -->|"uses"| node_review_hook
node_review_hook -->|"fetches review data"| node_hr_service
node_hr_service -->|"delegates reviews"| node_review_service
node_review_service -->|"reads and writes"| node_supabase
node_hr_service -->|"delegates attendance"| node_attendance_service
node_attendance_service -.->|"uses client"| node_supabase_client
node_hr_service -->|"delegates organization"| node_org_service
node_org_service -->|"reads and writes"| node_supabase
node_client -->|"uses client"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_pwa -->|"supports offline use"| node_user

click node_app "https://github.com/mimnets/openhrapp/blob/main/src/App.tsx"
click node_auth "https://github.com/mimnets/openhrapp/blob/main/src/context/AuthContext.tsx"
click node_session "https://github.com/mimnets/openhrapp/blob/main/src/services/session/sessionManager.ts"
click node_attendance "https://github.com/mimnets/openhrapp/blob/main/src/pages/Attendance.tsx"
click node_attendance_service "https://github.com/mimnets/openhrapp/blob/main/src/services/attendance.service.ts"
click node_leave "https://github.com/mimnets/openhrapp/tree/main/src/components/leave"
click node_reviews "https://github.com/mimnets/openhrapp/blob/main/src/pages/PerformanceReview.tsx"
click node_review_hook "https://github.com/mimnets/openhrapp/blob/main/src/hooks/review/usePerformanceReview.ts"
click node_review_service "https://github.com/mimnets/openhrapp/blob/main/src/services/review.service.ts"
click node_directory "https://github.com/mimnets/openhrapp/blob/main/src/pages/EmployeeDirectory.tsx"
click node_reports "https://github.com/mimnets/openhrapp/blob/main/src/pages/Reports.tsx"
click node_organization "https://github.com/mimnets/openhrapp/blob/main/src/pages/Organization.tsx"
click node_announcements "https://github.com/mimnets/openhrapp/blob/main/src/pages/Announcements.tsx"
click node_notifications "https://github.com/mimnets/openhrapp/blob/main/src/services/notification.service.ts"
click node_superadmin "https://github.com/mimnets/openhrapp/blob/main/src/pages/SuperAdmin.tsx"
click node_hr_service "https://github.com/mimnets/openhrapp/blob/main/src/services/hrService.ts"
click node_org_service "https://github.com/mimnets/openhrapp/blob/main/src/services/organization.service.ts"
click node_client "https://github.com/mimnets/openhrapp/blob/main/src/services/api.client.ts"
click node_supabase_client "https://github.com/mimnets/openhrapp/blob/main/src/services/supabase.ts"
click node_subscription "https://github.com/mimnets/openhrapp/blob/main/src/context/SubscriptionContext.tsx"
click node_pwa "https://github.com/mimnets/openhrapp/blob/main/src/hooks/useServiceWorker.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_app,node_auth,node_session,node_subscription,node_pwa toneBlue
class node_attendance,node_leave,node_reviews,node_review_hook,node_directory,node_reports,node_supabase toneAmber
class node_organization,node_announcements,node_notifications,node_superadmin toneMint
class node_attendance_service,node_review_service,node_hr_service,node_org_service,node_client,node_supabase_client toneRose
class node_user toneIndigo
```

## Components

### App and identity

- [App routing](https://github.com/mimnets/openhrapp/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/mimnets/openhrapp/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Session lifecycle](https://github.com/mimnets/openhrapp/blob/main/src/services/session/sessionManager.ts): `src/services/session/sessionManager.ts`
- [Subscription access](https://github.com/mimnets/openhrapp/blob/main/src/context/SubscriptionContext.tsx): `src/context/SubscriptionContext.tsx`
- [Offline-ready PWA](https://github.com/mimnets/openhrapp/blob/main/src/hooks/useServiceWorker.ts): `src/hooks/useServiceWorker.ts`

### Workforce operations

- [Attendance tracking](https://github.com/mimnets/openhrapp/blob/main/src/pages/Attendance.tsx): `src/pages/Attendance.tsx`
- [Leave workflows](https://github.com/mimnets/openhrapp/tree/main/src/components/leave): `src/components/leave`
- [Performance reviews](https://github.com/mimnets/openhrapp/blob/main/src/pages/PerformanceReview.tsx): `src/pages/PerformanceReview.tsx`
- [Review data flow](https://github.com/mimnets/openhrapp/blob/main/src/hooks/review/usePerformanceReview.ts): `src/hooks/review/usePerformanceReview.ts`
- [Employee directory](https://github.com/mimnets/openhrapp/blob/main/src/pages/EmployeeDirectory.tsx): `src/pages/EmployeeDirectory.tsx`
- [Reports and analytics](https://github.com/mimnets/openhrapp/blob/main/src/pages/Reports.tsx): `src/pages/Reports.tsx`

### Organization and oversight

- [Organization setup](https://github.com/mimnets/openhrapp/blob/main/src/pages/Organization.tsx): `src/pages/Organization.tsx`
- [Announcements](https://github.com/mimnets/openhrapp/blob/main/src/pages/Announcements.tsx): `src/pages/Announcements.tsx`
- [Notifications](https://github.com/mimnets/openhrapp/blob/main/src/services/notification.service.ts): `src/services/notification.service.ts`
- [Superadmin tools](https://github.com/mimnets/openhrapp/blob/main/src/pages/SuperAdmin.tsx): `src/pages/SuperAdmin.tsx`

### Services and persistence

- [Attendance service](https://github.com/mimnets/openhrapp/blob/main/src/services/attendance.service.ts): `src/services/attendance.service.ts`
- [Review service](https://github.com/mimnets/openhrapp/blob/main/src/services/review.service.ts): `src/services/review.service.ts`
- [HR service facade](https://github.com/mimnets/openhrapp/blob/main/src/services/hrService.ts): `src/services/hrService.ts`
- [Organization service](https://github.com/mimnets/openhrapp/blob/main/src/services/organization.service.ts): `src/services/organization.service.ts`
- [API client](https://github.com/mimnets/openhrapp/blob/main/src/services/api.client.ts): `src/services/api.client.ts`
- [Supabase client](https://github.com/mimnets/openhrapp/blob/main/src/services/supabase.ts): `src/services/supabase.ts`

### Other components

- **Employee or admin**
- **Supabase platform**

## Connections

- Employee or admin → App routing: uses (evidence: `README.md`)
- App routing → Authentication: provides context (evidence: `src/App.tsx`)
- App routing → Attendance tracking: routes to (evidence: `src/App.tsx`)
- App routing → Performance reviews: routes to (evidence: `src/App.tsx`)
- App routing → Subscription access: provides context (evidence: `src/App.tsx`)
- Authentication → Session lifecycle: delegates lifecycle
- Session lifecycle → Supabase client: refreshes auth (evidence: `src/services/session/sessionManager.ts`)
- Performance reviews → Review data flow: uses (evidence: `src/pages/PerformanceReview.tsx`)
- Review data flow → HR service facade: fetches review data (evidence: `src/hooks/review/usePerformanceReview.ts`)
- HR service facade → Review service: delegates reviews (evidence: `src/services/hrService.ts`)
- Review service → Supabase platform: reads and writes (evidence: `src/services/review.service.ts`)
- HR service facade → Attendance service: delegates attendance (evidence: `src/services/hrService.ts`)
- Attendance service → Supabase client: uses client
- HR service facade → Organization service: delegates organization (evidence: `src/services/hrService.ts`)
- Organization service → Supabase platform: reads and writes (evidence: `src/services/organization.service.ts`)
- API client → Supabase client: uses client (evidence: `src/services/api.client.ts`)
- Supabase client → Supabase platform: connects to (evidence: `src/services/supabase.ts`)
- Offline-ready PWA → Employee or admin: supports offline use (evidence: `README.md`)
