# organization-deal/hr-line architecture

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

- Interactive diagram: https://gitdiagram.com/organization-deal/hr-line
- Repository: https://github.com/organization-deal/hr-line

## Overview

Nakna HR is a multi-company HR SaaS spanning employee self-service, HR administration, payroll, documents, learning, performance, engagement, analytics, and trial/billing. A documented new-customer path starts in LINE, continues through web Business Setup and Workspace integrations, and ends at the Dashboard. Employee-facing web flows use tokenized links and call public API endpoints, as shown in sampled clients. Backend internals and most domain implementations were not sampled, so the graph preserves documented capabilities without asserting unverified calls between them.

Main entry points: [`src/index.js`](https://github.com/organization-deal/hr-line/blob/main/src/index.js) (Application API), [`public/invite.js`](https://github.com/organization-deal/hr-line/blob/main/public/invite.js) (Business Setup), [`public/attendance.js`](https://github.com/organization-deal/hr-line/blob/main/public/attendance.js) (Attendance and face check), [`public/leave.js`](https://github.com/organization-deal/hr-line/blob/main/public/leave.js) (Leave requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Workspace entry"]
  node_setup["Business Setup<br/>[invite.js]"]
  node_dashboard["HR Dashboard<br/>[app.js]"]
end

subgraph group_people["People operations"]
  node_attendance["Attendance and face check<br/>[attendance.js]"]
  node_leave["Leave requests<br/>[leave.js]"]
  node_hrcase["Confidential HR cases<br/>[hr-case.js]"]
  node_invite["Employee onboarding<br/>[invite.js]"]
  node_wellness["Wellness routines<br/>[wellness.js]"]
  node_recruitment["Recruitment and benefits"]
end

subgraph group_pay["Payroll and documents"]
  node_payroll["Payroll engine<br/>[index.js]"]
  node_documents["Employee documents<br/>[documents.js]"]
  node_doc_admin["Document workflows"]
end

subgraph group_growth["Learning and engagement"]
  node_learning["Learning portal<br/>[learn.js]"]
  node_performance["KPI and performance"]
  node_engagement["Points and rewards"]
  node_analytics["People analytics"]
end

subgraph group_platform["Platform services"]
  node_api["Application API<br/>[index.js]"]
  node_d1[("HR transaction store")]
  node_google["Google Workspace"]
  node_line["LINE OA"]
  node_billing["Trial and seat billing"]
end

node_line_user(("LINE customer or employee"))

node_line_user -->|"opens setup"| node_setup
node_setup -->|"continues to"| node_dashboard
node_line_user -.->|"opens link"| node_attendance
node_line_user -.->|"opens link"| node_leave
node_line_user -.->|"opens link"| node_hrcase
node_line_user -->|"opens portal"| node_learning
node_line_user -->|"opens center"| node_documents
node_line_user -.->|"opens routine"| node_wellness
node_setup -.->|"submits onboarding"| node_api
node_attendance -->|"requests attendance"| node_api
node_leave -->|"requests leave"| node_api
node_hrcase -->|"submits case"| node_api
node_invite -->|"submits profile"| node_api
node_wellness -->|"loads routine"| node_api
node_learning -->|"loads portal"| node_api
node_documents -->|"loads documents"| node_api
node_api -->|"persists state"| node_d1
node_api -.->|"syncs HR data"| node_google
node_api -.->|"sends employee alerts"| node_line
node_api -.->|"serves payroll"| node_payroll
node_payroll -->|"uploads payslips"| node_google
node_payroll -->|"notifies employees"| node_line
node_api -.->|"supports workflows"| node_doc_admin

click node_setup "https://github.com/organization-deal/hr-line/blob/main/public/invite.js"
click node_dashboard "https://github.com/organization-deal/hr-line/blob/main/public/app.js"
click node_api "https://github.com/organization-deal/hr-line/blob/main/src/index.js"
click node_d1 "https://github.com/organization-deal/hr-line/tree/main/migrations"
click node_attendance "https://github.com/organization-deal/hr-line/blob/main/public/attendance.js"
click node_leave "https://github.com/organization-deal/hr-line/blob/main/public/leave.js"
click node_hrcase "https://github.com/organization-deal/hr-line/blob/main/public/hr-case.js"
click node_invite "https://github.com/organization-deal/hr-line/blob/main/public/invite.js"
click node_wellness "https://github.com/organization-deal/hr-line/blob/main/public/wellness.js"
click node_payroll "https://github.com/organization-deal/hr-line/blob/main/src/index.js"
click node_documents "https://github.com/organization-deal/hr-line/blob/main/public/documents.js"
click node_doc_admin "https://github.com/organization-deal/hr-line/tree/main/src"
click node_learning "https://github.com/organization-deal/hr-line/blob/main/public/learn.js"
click node_performance "https://github.com/organization-deal/hr-line/tree/main/src"
click node_engagement "https://github.com/organization-deal/hr-line/tree/main/src"
click node_analytics "https://github.com/organization-deal/hr-line/tree/main/src"
click node_recruitment "https://github.com/organization-deal/hr-line/tree/main/src"
click node_billing "https://github.com/organization-deal/hr-line/tree/main/src"

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_setup,node_dashboard toneBlue
class node_attendance,node_leave,node_hrcase,node_invite,node_wellness,node_recruitment toneAmber
class node_payroll,node_documents,node_doc_admin toneMint
class node_learning,node_performance,node_engagement,node_analytics toneRose
class node_api,node_d1,node_google,node_line,node_billing,node_line_user toneIndigo
```

## Components

### Workspace entry

- [Business Setup](https://github.com/organization-deal/hr-line/blob/main/public/invite.js): `public/invite.js`
- [HR Dashboard](https://github.com/organization-deal/hr-line/blob/main/public/app.js): `public/app.js`

### People operations

- [Attendance and face check](https://github.com/organization-deal/hr-line/blob/main/public/attendance.js): `public/attendance.js`
- [Leave requests](https://github.com/organization-deal/hr-line/blob/main/public/leave.js): `public/leave.js`
- [Confidential HR cases](https://github.com/organization-deal/hr-line/blob/main/public/hr-case.js): `public/hr-case.js`
- [Employee onboarding](https://github.com/organization-deal/hr-line/blob/main/public/invite.js): `public/invite.js`
- [Wellness routines](https://github.com/organization-deal/hr-line/blob/main/public/wellness.js): `public/wellness.js`
- [Recruitment and benefits](https://github.com/organization-deal/hr-line/tree/main/src): `src`

### Payroll and documents

- [Payroll engine](https://github.com/organization-deal/hr-line/blob/main/src/index.js): `src/index.js`
- [Employee documents](https://github.com/organization-deal/hr-line/blob/main/public/documents.js): `public/documents.js`
- [Document workflows](https://github.com/organization-deal/hr-line/tree/main/src): `src`

### Learning and engagement

- [Learning portal](https://github.com/organization-deal/hr-line/blob/main/public/learn.js): `public/learn.js`
- [KPI and performance](https://github.com/organization-deal/hr-line/tree/main/src): `src`
- [Points and rewards](https://github.com/organization-deal/hr-line/tree/main/src): `src`
- [People analytics](https://github.com/organization-deal/hr-line/tree/main/src): `src`

### Platform services

- [Application API](https://github.com/organization-deal/hr-line/blob/main/src/index.js): `src/index.js`
- [HR transaction store](https://github.com/organization-deal/hr-line/tree/main/migrations): `migrations`
- **Google Workspace**
- **LINE OA**
- [Trial and seat billing](https://github.com/organization-deal/hr-line/tree/main/src): `src`

### Other components

- **LINE customer or employee**

## Connections

- LINE customer or employee → Business Setup: opens setup (evidence: `README.md`)
- Business Setup → HR Dashboard: continues to (evidence: `README.md`)
- LINE customer or employee → Attendance and face check: opens link
- LINE customer or employee → Leave requests: opens link
- LINE customer or employee → Confidential HR cases: opens link
- LINE customer or employee → Learning portal: opens portal (evidence: `README.md`)
- LINE customer or employee → Employee documents: opens center (evidence: `README.md`)
- LINE customer or employee → Wellness routines: opens routine
- Business Setup → Application API: submits onboarding
- Attendance and face check → Application API: requests attendance (evidence: `public/attendance.js`)
- Leave requests → Application API: requests leave (evidence: `public/leave.js`)
- Confidential HR cases → Application API: submits case
- Employee onboarding → Application API: submits profile (evidence: `public/invite.js`)
- Wellness routines → Application API: loads routine (evidence: `public/wellness.js`)
- Learning portal → Application API: loads portal (evidence: `public/learn.js`)
- Employee documents → Application API: loads documents (evidence: `public/documents.js`)
- Application API → HR transaction store: persists state (evidence: `README.md`)
- Application API → Google Workspace: syncs HR data (evidence: `README.md`)
- Application API → LINE OA: sends employee alerts (evidence: `README.md`)
- Application API → Payroll engine: serves payroll (evidence: `README.md`)
- Payroll engine → Google Workspace: uploads payslips (evidence: `README.md`)
- Payroll engine → LINE OA: notifies employees (evidence: `README.md`)
- Application API → Document workflows: supports workflows (evidence: `README.md`)
