# hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n architecture

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

- Interactive diagram: https://gitdiagram.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n
- Repository: https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n

## Overview

FaceAttend is presented as an employee face-attendance management UI, alongside a separate legacy Python face-matching tool. The main user workflow is dashboard navigation to attendance, employee, device, and reporting views; the kiosk screen currently simulates scan outcomes rather than invoking recognition. The legacy workflow records webcam sightings into a file-backed dataset, then lets users upload an image to search that dataset. The newer pages are mock-data-oriented; the excerpts do not establish backend connections for them.

Main entry points: [`file làm dự án cũ/app_user.py`](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/app_user.py) (Image search API), [`face-attend/components/dashboard/sidebar.tsx`](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/sidebar.tsx) (Sidebar navigation), [`file làm dự án cũ/record_admin.py`](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/record_admin.py) (Webcam recorder), [`face-attend/components/dashboard/shell.tsx`](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/shell.tsx) (Dashboard shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Management UI"]
  node_employee_list["Employees<br/>[page.tsx]"]
  node_employee_detail["Employee detail<br/>[page.tsx]"]
  node_face_admin["Face management<br/>[page.tsx]"]
  node_org_units["Departments<br/>[page.tsx]"]
  node_branches["Branches<br/>[page.tsx]"]
  node_roles["Roles<br/>[page.tsx]"]
  node_settings["Settings<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_reports["Reports<br/>[page.tsx]"]
end

subgraph group_attendance["Attendance"]
  node_shifts["Shift management<br/>[page.tsx]"]
  node_attendance_history["Attendance history<br/>[page.tsx]"]
  node_devices["Devices<br/>[page.tsx]"]
  node_kiosk["Kiosk screen<br/>[page.tsx]"]
end

subgraph group_legacy["Legacy face tool"]
  node_web_user(("Image-search user"))
  node_recorder["Webcam recorder<br/>[record_admin.py]"]
  node_user_app["Image search API<br/>[app_user.py]"]
  node_face_engine["Face detection and embeddings<br/>[face_engine.py]"]
  node_matcher["Matching and dataset files<br/>[matcher.py]"]
end

subgraph group_shared["Shared UI"]
  node_shell["Dashboard shell<br/>[shell.tsx]"]
  node_sidebar["Sidebar navigation<br/>[sidebar.tsx]"]
  node_nav_items["Navigation items<br/>[nav-items.ts]"]
  node_logo["Brand logo<br/>[logo.tsx]"]
  node_topbar["Top bar<br/>[topbar.tsx]"]
end

node_shell -->|"renders"| node_sidebar
node_shell -->|"renders"| node_topbar
node_sidebar -->|"uses links"| node_nav_items
node_sidebar -->|"renders"| node_logo
node_topbar -->|"links to"| node_kiosk
node_web_user -->|"uploads image"| node_user_app
node_user_app -->|"extracts embeddings"| node_face_engine
node_user_app -->|"loads and matches"| node_matcher
node_recorder -->|"extracts embeddings"| node_face_engine
node_recorder -->|"loads, matches, saves"| node_matcher

click node_employee_list "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/employees/page.tsx"
click node_employee_detail "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/employees/%5Bid%5D/page.tsx"
click node_face_admin "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/faces/page.tsx"
click node_org_units "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/departments/page.tsx"
click node_branches "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/branches/page.tsx"
click node_roles "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/roles/page.tsx"
click node_settings "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/settings/page.tsx"
click node_dashboard "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/dashboard/page.tsx"
click node_reports "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/reports/page.tsx"
click node_shifts "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/shifts/page.tsx"
click node_attendance_history "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/attendance/history/page.tsx"
click node_devices "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/devices/page.tsx"
click node_kiosk "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/attendance/page.tsx"
click node_shell "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/shell.tsx"
click node_sidebar "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/sidebar.tsx"
click node_nav_items "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/nav-items.ts"
click node_logo "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/logo.tsx"
click node_topbar "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/topbar.tsx"
click node_recorder "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/record_admin.py"
click node_user_app "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/app_user.py"
click node_face_engine "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/face_engine.py"
click node_matcher "https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/matcher.py"

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_employee_list,node_employee_detail,node_face_admin,node_org_units,node_branches,node_roles,node_settings,node_dashboard,node_reports toneBlue
class node_shifts,node_attendance_history,node_devices,node_kiosk toneAmber
class node_web_user,node_recorder,node_user_app,node_face_engine,node_matcher toneMint
class node_shell,node_sidebar,node_nav_items,node_logo,node_topbar toneRose
```

## Components

### Management UI

- [Employees](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/employees/page.tsx): `face-attend/app/(dashboard)/employees/page.tsx`
- [Employee detail](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/employees/%5Bid%5D/page.tsx): `face-attend/app/(dashboard)/employees/[id]/page.tsx`
- [Face management](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/faces/page.tsx): `face-attend/app/(dashboard)/faces/page.tsx`
- [Departments](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/departments/page.tsx): `face-attend/app/(dashboard)/departments/page.tsx`
- [Branches](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/branches/page.tsx): `face-attend/app/(dashboard)/branches/page.tsx`
- [Roles](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/roles/page.tsx): `face-attend/app/(dashboard)/roles/page.tsx`
- [Settings](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/settings/page.tsx): `face-attend/app/(dashboard)/settings/page.tsx`
- [Dashboard](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/dashboard/page.tsx): `face-attend/app/(dashboard)/dashboard/page.tsx`
- [Reports](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/reports/page.tsx): `face-attend/app/(dashboard)/reports/page.tsx`

### Attendance

- [Shift management](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/shifts/page.tsx): `face-attend/app/(dashboard)/shifts/page.tsx`
- [Attendance history](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/attendance/history/page.tsx): `face-attend/app/(dashboard)/attendance/history/page.tsx`
- [Devices](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/(dashboard)/devices/page.tsx): `face-attend/app/(dashboard)/devices/page.tsx`
- [Kiosk screen](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/app/attendance/page.tsx): `face-attend/app/attendance/page.tsx`

### Legacy face tool

- **Image-search user**
- [Webcam recorder](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/record_admin.py): `file làm dự án cũ/record_admin.py`
- [Image search API](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/app_user.py): `file làm dự án cũ/app_user.py`
- [Face detection and embeddings](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/face_engine.py): `file làm dự án cũ/face_engine.py`
- [Matching and dataset files](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/file%20l%C3%A0m%20d%E1%BB%B1%20%C3%A1n%20c%C5%A9/matcher.py): `file làm dự án cũ/matcher.py`

### Shared UI

- [Dashboard shell](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/shell.tsx): `face-attend/components/dashboard/shell.tsx`
- [Sidebar navigation](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/sidebar.tsx): `face-attend/components/dashboard/sidebar.tsx`
- [Navigation items](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/nav-items.ts): `face-attend/components/dashboard/nav-items.ts`
- [Brand logo](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/logo.tsx): `face-attend/components/dashboard/logo.tsx`
- [Top bar](https://github.com/hquan1403/cnpm_24ct1_ch-mc-ng_ho-ngnh-tqu-n/blob/main/face-attend/components/dashboard/topbar.tsx): `face-attend/components/dashboard/topbar.tsx`

## Connections

- Dashboard shell → Sidebar navigation: renders (evidence: `face-attend/components/dashboard/shell.tsx`)
- Dashboard shell → Top bar: renders (evidence: `face-attend/components/dashboard/shell.tsx`)
- Sidebar navigation → Navigation items: uses links (evidence: `face-attend/components/dashboard/sidebar.tsx`)
- Sidebar navigation → Brand logo: renders (evidence: `face-attend/components/dashboard/sidebar.tsx`)
- Top bar → Kiosk screen: links to (evidence: `face-attend/components/dashboard/topbar.tsx`)
- Image-search user → Image search API: uploads image (evidence: `file làm dự án cũ/app_user.py`)
- Image search API → Face detection and embeddings: extracts embeddings (evidence: `file làm dự án cũ/app_user.py`)
- Image search API → Matching and dataset files: loads and matches (evidence: `file làm dự án cũ/app_user.py`)
- Webcam recorder → Face detection and embeddings: extracts embeddings (evidence: `file làm dự án cũ/record_admin.py`)
- Webcam recorder → Matching and dataset files: loads, matches, saves (evidence: `file làm dự án cũ/record_admin.py`)
