# webfamily-06/masterhrms architecture

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

- Interactive diagram: https://gitdiagram.com/webfamily-06/masterhrms
- Repository: https://github.com/webfamily-06/masterhrms

## Overview

The repository appears to combine a multi-tenant HRMS with a React client and an Express API, alongside a Laravel HRMS application and a small task-demo package. A typical user flow is to sign in, enter the authenticated workspace, and use domain screens that call tenant-aware API routes; those routes apply authentication and access policy, then use Prisma-backed services and data. The tree also shows payroll, accounting, biometric attendance, and storage capabilities. The README is empty, and unsampled route wiring is not inferred.

Main entry points: [`src/lib/api.ts`](https://github.com/webfamily-06/masterhrms/blob/main/src/lib/api.ts) (API client), [`server/src/routes/biometric.routes.ts`](https://github.com/webfamily-06/masterhrms/blob/main/server/src/routes/biometric.routes.ts) (Biometric routes), [`hrms-flow/app/Models/User.php`](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Models/User.php) (HR domain models), [`src/lib/session.ts`](https://github.com/webfamily-06/masterhrms/blob/main/src/lib/session.ts) (Session client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React workspace"]
  node_session["Session client<br/>[session.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_app_shell["Workspace shell<br/>[route.tsx]"]
  node_pipeline["CRM pipeline<br/>[pipeline.tsx]"]
  node_bank_accounts["Bank accounts"]
  node_super_admin["Super admin<br/>[route.tsx]"]
end

subgraph group_api["Tenant API"]
  node_auth_middleware["API authentication<br/>[auth.ts]"]
  node_biometric_routes["Biometric routes"]
  node_accounting_routes["Accounting routes"]
  node_workspace_policy["Workspace policy"]
  node_payroll_engine["Payroll engine"]
  node_encrypted_storage["Encrypted storage"]
  node_zk_protocol["ZK device protocol<br/>[zk-protocol.ts]"]
  node_storage_types["Storage types<br/>[storage.types.ts]"]
end

subgraph group_hr["Laravel HRMS"]
  node_laravel_boot["Laravel middleware setup<br/>[app.php]"]
  node_laravel_auth["Laravel sign-in"]
  node_employee_reviews["Employee reviews"]
  node_review_cycles["Review cycles"]
  node_payment_settings["Payment settings"]
  node_dynamic_storage["Dynamic storage"]
  node_storage_settings["Storage settings UI"]
  node_frontend_app["Inertia client entry<br/>[app.tsx]"]
  node_storage_config["Storage config service"]
end

subgraph group_shared["Domain and persistence"]
  node_prisma["Prisma access<br/>[prisma.ts]"]
  node_hr_models[("HR domain models<br/>[User.php]")]
  node_permissions[("Permission model<br/>[Permission.php]")]
end

node_user(("HRMS user"))

node_user -->|"signs in"| node_session
node_session -->|"uses"| node_api_client
node_user -.->|"opens workspace"| node_app_shell
node_app_shell -->|"checks session"| node_session
node_pipeline -->|"requests data"| node_api_client
node_bank_accounts -.->|"requests data"| node_api_client
node_super_admin -->|"uses API"| node_api_client
node_api_client -.->|"sends bearer token"| node_auth_middleware
node_auth_middleware -->|"guards routes"| node_biometric_routes
node_biometric_routes -->|"checks capacity"| node_workspace_policy
node_biometric_routes -->|"pulls device logs"| node_zk_protocol
node_biometric_routes -->|"stores punches"| node_prisma
node_accounting_routes -->|"queries data"| node_prisma
node_accounting_routes -->|"uses authentication"| node_auth_middleware
node_encrypted_storage -->|"uses database"| node_prisma
node_encrypted_storage -->|"uses storage types"| node_storage_types
node_laravel_boot -.->|"configures routing"| node_laravel_auth
node_laravel_auth -->|"loads user"| node_hr_models
node_employee_reviews -->|"uses employees"| node_hr_models
node_employee_reviews -->|"uses review cycle"| node_review_cycles
node_hr_models -->|"references permissions"| node_permissions
node_dynamic_storage -->|"loads storage config"| node_storage_config
node_frontend_app -.->|"loads pages"| node_storage_settings
node_payment_settings -->|"uses user model"| node_hr_models

click node_session "https://github.com/webfamily-06/masterhrms/blob/main/src/lib/session.ts"
click node_api_client "https://github.com/webfamily-06/masterhrms/blob/main/src/lib/api.ts"
click node_app_shell "https://github.com/webfamily-06/masterhrms/blob/main/src/routes/_authenticated/_app/route.tsx"
click node_pipeline "https://github.com/webfamily-06/masterhrms/blob/main/src/routes/_authenticated/_app/pipeline.tsx"
click node_bank_accounts "https://github.com/webfamily-06/masterhrms/blob/main/src/components/accounting/bank-accounts-manager.tsx"
click node_super_admin "https://github.com/webfamily-06/masterhrms/blob/main/src/routes/_authenticated/super/route.tsx"
click node_auth_middleware "https://github.com/webfamily-06/masterhrms/blob/main/server/src/middleware/auth.ts"
click node_biometric_routes "https://github.com/webfamily-06/masterhrms/blob/main/server/src/routes/biometric.routes.ts"
click node_accounting_routes "https://github.com/webfamily-06/masterhrms/blob/main/server/src/routes/accounting.routes.ts"
click node_workspace_policy "https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/workspace-policy.service.ts"
click node_payroll_engine "https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/payroll-engine.service.ts"
click node_encrypted_storage "https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/storage/local-encrypted-storage.service.ts"
click node_zk_protocol "https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/zk-protocol.ts"
click node_prisma "https://github.com/webfamily-06/masterhrms/blob/main/server/src/prisma.ts"
click node_hr_models "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Models/User.php"
click node_permissions "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Models/Permission.php"
click node_laravel_boot "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/bootstrap/app.php"
click node_laravel_auth "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_employee_reviews "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/EmployeeReviewController.php"
click node_review_cycles "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/ReviewCycleController.php"
click node_payment_settings "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/Settings/PaymentSettingController.php"
click node_dynamic_storage "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Services/DynamicStorageService.php"
click node_storage_settings "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/resources/js/pages/settings/components/storage-settings.tsx"
click node_frontend_app "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/resources/js/app.tsx"
click node_storage_types "https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/storage/storage.types.ts"
click node_storage_config "https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Services/StorageConfigService.php"

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_session,node_api_client,node_app_shell,node_pipeline,node_bank_accounts,node_super_admin,node_user toneBlue
class node_auth_middleware,node_biometric_routes,node_accounting_routes,node_workspace_policy,node_payroll_engine,node_encrypted_storage,node_zk_protocol,node_storage_types toneAmber
class node_laravel_boot,node_laravel_auth,node_employee_reviews,node_review_cycles,node_payment_settings,node_dynamic_storage,node_storage_settings,node_frontend_app,node_storage_config toneMint
class node_prisma,node_hr_models,node_permissions toneRose
```

## Components

### React workspace

- [Session client](https://github.com/webfamily-06/masterhrms/blob/main/src/lib/session.ts): `src/lib/session.ts`
- [API client](https://github.com/webfamily-06/masterhrms/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Workspace shell](https://github.com/webfamily-06/masterhrms/blob/main/src/routes/_authenticated/_app/route.tsx): `src/routes/_authenticated/_app/route.tsx`
- [CRM pipeline](https://github.com/webfamily-06/masterhrms/blob/main/src/routes/_authenticated/_app/pipeline.tsx): `src/routes/_authenticated/_app/pipeline.tsx`
- [Bank accounts](https://github.com/webfamily-06/masterhrms/blob/main/src/components/accounting/bank-accounts-manager.tsx): `src/components/accounting/bank-accounts-manager.tsx`
- [Super admin](https://github.com/webfamily-06/masterhrms/blob/main/src/routes/_authenticated/super/route.tsx): `src/routes/_authenticated/super/route.tsx`

### Tenant API

- [API authentication](https://github.com/webfamily-06/masterhrms/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`
- [Biometric routes](https://github.com/webfamily-06/masterhrms/blob/main/server/src/routes/biometric.routes.ts): `server/src/routes/biometric.routes.ts`
- [Accounting routes](https://github.com/webfamily-06/masterhrms/blob/main/server/src/routes/accounting.routes.ts): `server/src/routes/accounting.routes.ts`
- [Workspace policy](https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/workspace-policy.service.ts): `server/src/services/workspace-policy.service.ts`
- [Payroll engine](https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/payroll-engine.service.ts): `server/src/services/payroll-engine.service.ts`
- [Encrypted storage](https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/storage/local-encrypted-storage.service.ts): `server/src/services/storage/local-encrypted-storage.service.ts`
- [ZK device protocol](https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/zk-protocol.ts): `server/src/services/zk-protocol.ts`
- [Storage types](https://github.com/webfamily-06/masterhrms/blob/main/server/src/services/storage/storage.types.ts): `server/src/services/storage/storage.types.ts`

### Laravel HRMS

- [Laravel middleware setup](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/bootstrap/app.php): `hrms-flow/bootstrap/app.php`
- [Laravel sign-in](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `hrms-flow/app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Employee reviews](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/EmployeeReviewController.php): `hrms-flow/app/Http/Controllers/EmployeeReviewController.php`
- [Review cycles](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/ReviewCycleController.php): `hrms-flow/app/Http/Controllers/ReviewCycleController.php`
- [Payment settings](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Http/Controllers/Settings/PaymentSettingController.php): `hrms-flow/app/Http/Controllers/Settings/PaymentSettingController.php`
- [Dynamic storage](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Services/DynamicStorageService.php): `hrms-flow/app/Services/DynamicStorageService.php`
- [Storage settings UI](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/resources/js/pages/settings/components/storage-settings.tsx): `hrms-flow/resources/js/pages/settings/components/storage-settings.tsx`
- [Inertia client entry](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/resources/js/app.tsx): `hrms-flow/resources/js/app.tsx`
- [Storage config service](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Services/StorageConfigService.php): `hrms-flow/app/Services/StorageConfigService.php`

### Domain and persistence

- [Prisma access](https://github.com/webfamily-06/masterhrms/blob/main/server/src/prisma.ts): `server/src/prisma.ts`
- [HR domain models](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Models/User.php): `hrms-flow/app/Models/User.php`
- [Permission model](https://github.com/webfamily-06/masterhrms/blob/main/hrms-flow/app/Models/Permission.php): `hrms-flow/app/Models/Permission.php`

### Other components

- **HRMS user**

## Connections

- HRMS user → Session client: signs in
- Session client → API client: uses (evidence: `src/lib/session.ts`)
- HRMS user → Workspace shell: opens workspace
- Workspace shell → Session client: checks session (evidence: `src/routes/_authenticated/_app/route.tsx`)
- CRM pipeline → API client: requests data (evidence: `src/routes/_authenticated/_app/pipeline.tsx`)
- Bank accounts → API client: requests data
- Super admin → API client: uses API (evidence: `src/routes/_authenticated/super/route.tsx`)
- API client → API authentication: sends bearer token
- API authentication → Biometric routes: guards routes (evidence: `server/src/routes/biometric.routes.ts`)
- Biometric routes → Workspace policy: checks capacity (evidence: `server/src/routes/biometric.routes.ts`)
- Biometric routes → ZK device protocol: pulls device logs (evidence: `server/src/routes/biometric.routes.ts`)
- Biometric routes → Prisma access: stores punches (evidence: `server/src/routes/biometric.routes.ts`)
- Accounting routes → Prisma access: queries data (evidence: `server/src/routes/accounting.routes.ts`)
- Accounting routes → API authentication: uses authentication (evidence: `server/src/routes/accounting.routes.ts`)
- Encrypted storage → Prisma access: uses database (evidence: `server/src/services/storage/local-encrypted-storage.service.ts`)
- Encrypted storage → Storage types: uses storage types (evidence: `server/src/services/storage/local-encrypted-storage.service.ts`)
- Laravel middleware setup → Laravel sign-in: configures routing
- Laravel sign-in → HR domain models: loads user (evidence: `hrms-flow/app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Employee reviews → HR domain models: uses employees (evidence: `hrms-flow/app/Http/Controllers/EmployeeReviewController.php`)
- Employee reviews → Review cycles: uses review cycle (evidence: `hrms-flow/app/Http/Controllers/EmployeeReviewController.php`)
- HR domain models → Permission model: references permissions (evidence: `hrms-flow/app/Models/User.php`)
- Dynamic storage → Storage config service: loads storage config (evidence: `hrms-flow/app/Services/DynamicStorageService.php`)
- Inertia client entry → Storage settings UI: loads pages
- Payment settings → HR domain models: uses user model (evidence: `hrms-flow/app/Http/Controllers/Settings/PaymentSettingController.php`)
