# longnv2004/coffeechain-hrm architecture

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

## Overview

Coffee HRM is a web-based workforce management system for coffee-store staff, managers, and administrators. Users sign in and work through role-specific dashboards to manage schedules, availability, attendance, recruitment, training, stores, and notifications. The source tree shows a Spring MVC application with controllers, services, repositories, and database-backed entities; the supplied excerpts do not show most server-side calls or page routing, so those relationships are left unverified. The sampled training script explicitly consults the Vietnam-time helper when validating class times.

Main entry points: [`src/main/java/com/example/coffee_hrm/controller`](https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/controller) (Web controllers), [`src/main/java/com/example/coffee_hrm/repository`](https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/repository) (Repositories), [`src/main/resources/templates`](https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/resources/templates) (Role pages), [`src/main/java/com/example/coffee_hrm/service/impl/TrainingServiceImpl.java`](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/TrainingServiceImpl.java) (Training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webpages["Role pages"]
  node_landing["Login form<br/>[LandingPage.js]"]
  node_dashboards["Dashboards<br/>[AdminDashboard.js]"]
  node_notifui["Notification popup"]
  node_timehelper["Vietnam time helper<br/>[vietnam-time.js]"]
end

subgraph group_workforce["Workforce operations"]
  node_schedule["Scheduling"]
  node_availability["Availability"]
  node_attendance["Attendance history"]
  node_employee["Employee management"]
  node_stores["Store management"]
end

subgraph group_learning["Training and hiring"]
  node_training["Training"]
  node_trainingui["Training interactions<br/>[Training.js]"]
  node_recruitment["Recruitment requests"]
end

subgraph group_platform["Application services"]
  node_auth["Authentication"]
  node_notifications["Notification service"]
  node_controllers["Web controllers"]
  node_repositories["Repositories"]
  node_database[("Application database")]
end

node_staff(("Staff"))
node_manager(("Manager"))
node_admin(("Administrator"))

node_staff -.->|"uses"| node_webpages
node_manager -.->|"uses"| node_webpages
node_admin -.->|"uses"| node_webpages
node_landing -.->|"submits login"| node_auth
node_webpages -.->|"routes to"| node_controllers
node_dashboards -.->|"supports views"| node_webpages
node_trainingui -->|"checks time"| node_timehelper
node_trainingui -.->|"submits changes"| node_training
node_notifui -.->|"loads and updates"| node_notifications
node_controllers -.->|"dispatches requests"| node_schedule
node_controllers -.->|"dispatches requests"| node_availability
node_controllers -.->|"dispatches requests"| node_attendance
node_controllers -.->|"dispatches requests"| node_employee
node_controllers -.->|"dispatches requests"| node_stores
node_controllers -.->|"dispatches requests"| node_training
node_controllers -.->|"dispatches requests"| node_recruitment
node_controllers -.->|"dispatches requests"| node_auth
node_schedule -.->|"persists data"| node_repositories
node_availability -.->|"persists data"| node_repositories
node_attendance -.->|"reads data"| node_repositories
node_employee -.->|"persists data"| node_repositories
node_stores -.->|"persists data"| node_repositories
node_training -.->|"persists data"| node_repositories
node_recruitment -.->|"persists data"| node_repositories
node_auth -.->|"reads data"| node_repositories
node_notifications -.->|"persists data"| node_repositories
node_repositories -.->|"accesses"| node_database

click node_webpages "https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/resources/templates"
click node_landing "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/LandingPage.js"
click node_dashboards "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/AdminDashboard.js"
click node_notifui "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/notifications-popup.js"
click node_timehelper "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/vietnam-time.js"
click node_schedule "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/ScheduleServiceImpl.java"
click node_availability "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/StaffAvailabilityServiceImpl.java"
click node_attendance "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/AttendanceHistoryServiceImpl.java"
click node_employee "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/EmployeeServiceImpl.java"
click node_stores "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/StoreServiceImpl.java"
click node_training "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/TrainingServiceImpl.java"
click node_trainingui "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/Training.js"
click node_recruitment "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/RecruitmentRequestServiceImpl.java"
click node_auth "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/AuthServiceImpl.java"
click node_notifications "https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/NotificationServiceImpl.java"
click node_controllers "https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/controller"
click node_repositories "https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/repository"
click node_database "https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/entity"

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_webpages,node_landing,node_dashboards,node_notifui,node_timehelper toneBlue
class node_schedule,node_availability,node_attendance,node_employee,node_stores toneAmber
class node_training,node_trainingui,node_recruitment toneMint
class node_auth,node_notifications,node_controllers,node_repositories,node_database toneRose
class node_staff,node_manager,node_admin toneIndigo
```

## Components

### Web experience

- [Role pages](https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/resources/templates): `src/main/resources/templates`
- [Login form](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/LandingPage.js): `src/main/resources/static/js/LandingPage.js`
- [Dashboards](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/AdminDashboard.js): `src/main/resources/static/js/AdminDashboard.js`
- [Notification popup](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/notifications-popup.js): `src/main/resources/static/js/notifications-popup.js`
- [Vietnam time helper](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/vietnam-time.js): `src/main/resources/static/js/vietnam-time.js`

### Workforce operations

- [Scheduling](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/ScheduleServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/ScheduleServiceImpl.java`
- [Availability](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/StaffAvailabilityServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/StaffAvailabilityServiceImpl.java`
- [Attendance history](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/AttendanceHistoryServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/AttendanceHistoryServiceImpl.java`
- [Employee management](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/EmployeeServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/EmployeeServiceImpl.java`
- [Store management](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/StoreServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/StoreServiceImpl.java`

### Training and hiring

- [Training](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/TrainingServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/TrainingServiceImpl.java`
- [Training interactions](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/resources/static/js/Training.js): `src/main/resources/static/js/Training.js`
- [Recruitment requests](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/RecruitmentRequestServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/RecruitmentRequestServiceImpl.java`

### Application services

- [Authentication](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/AuthServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/AuthServiceImpl.java`
- [Notification service](https://github.com/longnv2004/coffeechain-hrm/blob/main/src/main/java/com/example/coffee_hrm/service/impl/NotificationServiceImpl.java): `src/main/java/com/example/coffee_hrm/service/impl/NotificationServiceImpl.java`
- [Web controllers](https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/controller): `src/main/java/com/example/coffee_hrm/controller`
- [Repositories](https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/repository): `src/main/java/com/example/coffee_hrm/repository`
- [Application database](https://github.com/longnv2004/coffeechain-hrm/tree/main/src/main/java/com/example/coffee_hrm/entity): `src/main/java/com/example/coffee_hrm/entity`

### Other components

- **Staff**
- **Manager**
- **Administrator**

## Connections

- Staff → Role pages: uses
- Manager → Role pages: uses
- Administrator → Role pages: uses
- Login form → Authentication: submits login
- Role pages → Web controllers: routes to
- Dashboards → Role pages: supports views
- Training interactions → Vietnam time helper: checks time (evidence: `src/main/resources/static/js/Training.js`)
- Training interactions → Training: submits changes
- Notification popup → Notification service: loads and updates
- Web controllers → Scheduling: dispatches requests
- Web controllers → Availability: dispatches requests
- Web controllers → Attendance history: dispatches requests
- Web controllers → Employee management: dispatches requests
- Web controllers → Store management: dispatches requests
- Web controllers → Training: dispatches requests
- Web controllers → Recruitment requests: dispatches requests
- Web controllers → Authentication: dispatches requests
- Scheduling → Repositories: persists data
- Availability → Repositories: persists data
- Attendance history → Repositories: reads data
- Employee management → Repositories: persists data
- Store management → Repositories: persists data
- Training → Repositories: persists data
- Recruitment requests → Repositories: persists data
- Authentication → Repositories: reads data
- Notification service → Repositories: persists data
- Repositories → Application database: accesses
