# juliocua/hrconnect architecture

> Architecture diagram of the GitHub repository juliocua/hrconnect, 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/juliocua/hrconnect
- Repository: https://github.com/juliocua/hrconnect

## Overview

HRConnect is a Philippine-focused HR information system with an HR portal, employee self-service hub, and client approval/billing workflows. Users enter through the React app; its API client connects to Express routes, which implement domain operations against PostgreSQL. The README documents the broader employee, attendance, leave, payroll, and statutory-reporting capabilities; sampled source confirms app routing, API calls, server route mounting, and database access in client-management routes. Some domain wiring is documented but not shown in sampled route source.

Main entry points: [`client/src/lib/api.ts`](https://github.com/juliocua/hrconnect/blob/main/client/src/lib/api.ts) (API client), [`server/src/lib/prisma.ts`](https://github.com/juliocua/hrconnect/blob/main/server/src/lib/prisma.ts) (PostgreSQL data), [`client/src/App.tsx`](https://github.com/juliocua/hrconnect/blob/main/client/src/App.tsx) (Portal routing), [`server/src/routes/billing.ts`](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/billing.ts) (Client billing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web portals"]
  node_app["Portal routing<br/>[App.tsx]"]
  node_authui["Sign-in<br/>[Login.tsx]"]
  node_employeehub["Employee hub"]
  node_clienthub["Client hub"]
  node_hrpages["HR workspace"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_people["People operations"]
  node_employees["Employee records<br/>[employees.ts]"]
  node_attendance["Attendance<br/>[attendance.ts]"]
  node_leave["Leave management<br/>[leave.ts]"]
  node_overtime["Overtime<br/>[overtime.ts]"]
end

subgraph group_pay["Payroll and compliance"]
  node_payroll["Payroll runs<br/>[payroll.ts]"]
  node_deductions["Statutory deductions<br/>[payroll.ts]"]
  node_bir["BIR reporting<br/>[bir.ts]"]
end

subgraph group_clients["Client operations"]
  node_clients["Client records<br/>[clients.ts]"]
  node_billing["Client billing<br/>[billing.ts]"]
  node_clientapprovals["Client approvals<br/>[client-hub.ts]"]
end

subgraph group_platform["API and persistence"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_database[("PostgreSQL data<br/>[prisma.ts]")]
  node_email["Email service<br/>[email.ts]"]
  node_invoice["Invoice PDF<br/>[invoice-pdf.ts]"]
end

node_hr(("HR staff"))
node_employee(("Employees"))
node_clientuser(("Client users"))

node_hr -->|"uses"| node_app
node_employee -->|"uses"| node_app
node_clientuser -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_employeehub
node_app -->|"routes to"| node_clienthub
node_app -->|"routes to"| node_hrpages
node_authui -->|"requests"| node_apiclient
node_employeehub -->|"requests"| node_apiclient
node_clienthub -->|"requests"| node_apiclient
node_hrpages -->|"requests"| node_apiclient
node_apiclient -->|"calls"| node_auth
node_apiclient -->|"calls"| node_employees
node_apiclient -->|"calls"| node_attendance
node_apiclient -->|"calls"| node_leave
node_apiclient -->|"calls"| node_overtime
node_apiclient -->|"calls"| node_payroll
node_apiclient -->|"calls"| node_bir
node_apiclient -->|"calls"| node_clients
node_apiclient -->|"calls"| node_billing
node_apiclient -->|"calls"| node_clientapprovals
node_employees -->|"reads/writes"| node_database
node_attendance -->|"reads/writes"| node_database
node_leave -->|"reads/writes"| node_database
node_overtime -->|"reads/writes"| node_database
node_payroll -->|"reads/writes"| node_database
node_clients -->|"reads/writes"| node_database
node_billing -->|"reads/writes"| node_database
node_clientapprovals -->|"reads/writes"| node_database
node_payroll -.->|"computes with"| node_deductions
node_billing -.->|"generates"| node_invoice
node_billing -.->|"sends invoice"| node_email

click node_app "https://github.com/juliocua/hrconnect/blob/main/client/src/App.tsx"
click node_authui "https://github.com/juliocua/hrconnect/blob/main/client/src/pages/Login.tsx"
click node_employeehub "https://github.com/juliocua/hrconnect/tree/main/client/src/pages/hub"
click node_clienthub "https://github.com/juliocua/hrconnect/tree/main/client/src/pages/client-hub"
click node_hrpages "https://github.com/juliocua/hrconnect/tree/main/client/src/pages"
click node_apiclient "https://github.com/juliocua/hrconnect/blob/main/client/src/lib/api.ts"
click node_auth "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/auth.ts"
click node_employees "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/employees.ts"
click node_attendance "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/attendance.ts"
click node_leave "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/leave.ts"
click node_overtime "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/overtime.ts"
click node_payroll "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/payroll.ts"
click node_deductions "https://github.com/juliocua/hrconnect/blob/main/server/src/lib/payroll.ts"
click node_bir "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/bir.ts"
click node_clients "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/clients.ts"
click node_billing "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/billing.ts"
click node_clientapprovals "https://github.com/juliocua/hrconnect/blob/main/server/src/routes/client-hub.ts"
click node_database "https://github.com/juliocua/hrconnect/blob/main/server/src/lib/prisma.ts"
click node_email "https://github.com/juliocua/hrconnect/blob/main/server/src/lib/email.ts"
click node_invoice "https://github.com/juliocua/hrconnect/blob/main/server/src/lib/invoice-pdf.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_authui,node_employeehub,node_clienthub,node_hrpages,node_apiclient,node_clientuser toneBlue
class node_employees,node_attendance,node_leave,node_overtime toneAmber
class node_payroll,node_deductions,node_bir toneMint
class node_clients,node_billing,node_clientapprovals toneRose
class node_auth,node_database,node_email,node_invoice,node_hr,node_employee toneIndigo
```

## Components

### Web portals

- [Portal routing](https://github.com/juliocua/hrconnect/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Sign-in](https://github.com/juliocua/hrconnect/blob/main/client/src/pages/Login.tsx): `client/src/pages/Login.tsx`
- [Employee hub](https://github.com/juliocua/hrconnect/tree/main/client/src/pages/hub): `client/src/pages/hub`
- [Client hub](https://github.com/juliocua/hrconnect/tree/main/client/src/pages/client-hub): `client/src/pages/client-hub`
- [HR workspace](https://github.com/juliocua/hrconnect/tree/main/client/src/pages): `client/src/pages`
- [API client](https://github.com/juliocua/hrconnect/blob/main/client/src/lib/api.ts): `client/src/lib/api.ts`

### People operations

- [Employee records](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/employees.ts): `server/src/routes/employees.ts`
- [Attendance](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/attendance.ts): `server/src/routes/attendance.ts`
- [Leave management](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/leave.ts): `server/src/routes/leave.ts`
- [Overtime](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/overtime.ts): `server/src/routes/overtime.ts`

### Payroll and compliance

- [Payroll runs](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/payroll.ts): `server/src/routes/payroll.ts`
- [Statutory deductions](https://github.com/juliocua/hrconnect/blob/main/server/src/lib/payroll.ts): `server/src/lib/payroll.ts`
- [BIR reporting](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/bir.ts): `server/src/routes/bir.ts`

### Client operations

- [Client records](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/clients.ts): `server/src/routes/clients.ts`
- [Client billing](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/billing.ts): `server/src/routes/billing.ts`
- [Client approvals](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/client-hub.ts): `server/src/routes/client-hub.ts`

### API and persistence

- [Authentication](https://github.com/juliocua/hrconnect/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [PostgreSQL data](https://github.com/juliocua/hrconnect/blob/main/server/src/lib/prisma.ts): `server/src/lib/prisma.ts`
- [Email service](https://github.com/juliocua/hrconnect/blob/main/server/src/lib/email.ts): `server/src/lib/email.ts`
- [Invoice PDF](https://github.com/juliocua/hrconnect/blob/main/server/src/lib/invoice-pdf.ts): `server/src/lib/invoice-pdf.ts`

### Other components

- **HR staff**
- **Employees**
- **Client users**

## Connections

- HR staff → Portal routing: uses
- Employees → Portal routing: uses
- Client users → Portal routing: uses
- Portal routing → Sign-in: routes to
- Portal routing → Employee hub: routes to
- Portal routing → Client hub: routes to
- Portal routing → HR workspace: routes to
- Sign-in → API client: requests
- Employee hub → API client: requests
- Client hub → API client: requests
- HR workspace → API client: requests
- API client → Authentication: calls
- API client → Employee records: calls
- API client → Attendance: calls
- API client → Leave management: calls
- API client → Overtime: calls
- API client → Payroll runs: calls
- API client → BIR reporting: calls
- API client → Client records: calls
- API client → Client billing: calls
- API client → Client approvals: calls
- Employee records → PostgreSQL data: reads/writes
- Attendance → PostgreSQL data: reads/writes
- Leave management → PostgreSQL data: reads/writes
- Overtime → PostgreSQL data: reads/writes
- Payroll runs → PostgreSQL data: reads/writes
- Client records → PostgreSQL data: reads/writes
- Client billing → PostgreSQL data: reads/writes
- Client approvals → PostgreSQL data: reads/writes
- Payroll runs → Statutory deductions: computes with
- Client billing → Invoice PDF: generates
- Client billing → Email service: sends invoice
