# shubhamshubham66/dayflow_human_resource_ms architecture

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

- Interactive diagram: https://gitdiagram.com/shubhamshubham66/dayflow_human_resource_ms
- Repository: https://github.com/shubhamshubham66/dayflow_human_resource_ms

## Overview

Dayflow is a full-stack HR management system for employee and administrator workflows. Users enter through role-aware React routes, authenticate, and use dashboards and domain pages to manage profiles, attendance, leave, payroll, reports, and settings. The client API layer communicates with an Express API, whose route handlers operate on MongoDB-backed domain records. The README documents the major modules; detailed wiring is shown only where the supplied source supports it, so some unsampled page-to-service and route-to-controller links are omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/App.jsx) (Route and role access), [`server/models/Attendance.js`](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/models/Attendance.js) (HR records), [`server/index.js`](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/index.js) (Express API), [`server/controllers/authController.js`](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/authController.js) (Auth handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Route and role access<br/>[App.jsx]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_authpages["Sign-in and enrollment<br/>[SignIn.jsx]"]
  node_dashboards["Role dashboards"]
  node_attendanceui["Attendance pages<br/>[Attendance.jsx]"]
  node_leaveui["Leave pages<br/>[Leave.jsx]"]
  node_payrollui["Payroll pages<br/>[Payroll.jsx]"]
  node_adminui["Admin operations"]
  node_reportsui["Reports and settings<br/>[Reports.jsx]"]
  node_clientapi["API client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_server["Express API<br/>[index.js]"]
  node_authroutes["Auth endpoints<br/>[authRoutes.js]"]
  node_authcontroller["Auth handling<br/>[authController.js]"]
  node_authservice["Auth client service<br/>[authService.js]"]
end

subgraph group_operations["HR operations"]
  node_employeecontroller["Employee handling"]
  node_attendancecontroller["Attendance handling"]
  node_leaveroutes["Leave endpoints<br/>[leaveRoutes.js]"]
  node_leavecontroller["Leave handling<br/>[leaveController.js]"]
  node_payrollcontroller["Payroll handling"]
  node_records[("HR records<br/>[Attendance.js]")]
end

subgraph group_insights["Insights and support"]
  node_analytics["Analytics handling"]
  node_activity["Activity handling"]
  node_notifications["Notification handling"]
  node_email["Email delivery<br/>[sendEmail.js]"]
end

node_employee(("Employee / admin"))

node_employee -->|"uses"| node_app
node_app -->|"checks identity"| node_authctx
node_app -->|"routes"| node_authpages
node_app -->|"routes by role"| node_dashboards
node_app -->|"routes"| node_attendanceui
node_app -->|"routes"| node_leaveui
node_app -->|"routes"| node_payrollui
node_app -->|"routes"| node_adminui
node_app -->|"routes"| node_reportsui
node_authpages -->|"auth actions"| node_authservice
node_authservice -->|"sends requests"| node_clientapi
node_clientapi -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_authroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads/writes users"| node_records
node_authcontroller -.->|"sends email"| node_email
node_server -->|"mounts"| node_leaveroutes
node_leaveroutes -->|"dispatches"| node_leavecontroller
node_leavecontroller -->|"reads/writes HR data"| node_records
node_attendancecontroller -->|"reads/writes attendance"| node_records
node_attendancecontroller -->|"creates activity"| node_activity
node_leavecontroller -->|"creates activity"| node_activity
node_employeecontroller -->|"reads/writes employee data"| node_records
node_payrollcontroller -->|"reads/writes payroll data"| node_records
node_analytics -->|"reads for analytics"| node_records

click node_app "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/App.jsx"
click node_authctx "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/context/AuthContext.jsx"
click node_authpages "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/SignIn.jsx"
click node_dashboards "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/EmployeeDashboard.jsx"
click node_attendanceui "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Attendance.jsx"
click node_leaveui "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Leave.jsx"
click node_payrollui "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Payroll.jsx"
click node_adminui "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/AttendanceManage.jsx"
click node_reportsui "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Reports.jsx"
click node_clientapi "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/services/api.js"
click node_server "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/index.js"
click node_authroutes "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/routes/authRoutes.js"
click node_authcontroller "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/authController.js"
click node_authservice "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/services/authService.js"
click node_employeecontroller "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/employeeController.js"
click node_attendancecontroller "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/attendanceController.js"
click node_leaveroutes "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/routes/leaveRoutes.js"
click node_leavecontroller "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/leaveController.js"
click node_payrollcontroller "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/payrollController.js"
click node_records "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/models/Attendance.js"
click node_analytics "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/analyticsController.js"
click node_activity "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/activityController.js"
click node_notifications "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/notificationController.js"
click node_email "https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/utils/sendEmail.js"

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_authctx,node_authpages,node_dashboards,node_attendanceui,node_leaveui,node_payrollui,node_adminui,node_reportsui,node_clientapi toneBlue
class node_server,node_authroutes,node_authcontroller,node_authservice toneAmber
class node_employeecontroller,node_attendancecontroller,node_leaveroutes,node_leavecontroller,node_payrollcontroller,node_records toneMint
class node_analytics,node_activity,node_notifications,node_email toneRose
class node_employee toneIndigo
```

## Components

### Web application

- [Route and role access](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/App.jsx): `client/src/App.jsx`
- [Auth context](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Sign-in and enrollment](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/SignIn.jsx): `client/src/pages/SignIn.jsx`
- [Role dashboards](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/EmployeeDashboard.jsx): `client/src/pages/EmployeeDashboard.jsx`
- [Attendance pages](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Attendance.jsx): `client/src/pages/Attendance.jsx`
- [Leave pages](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Leave.jsx): `client/src/pages/Leave.jsx`
- [Payroll pages](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Payroll.jsx): `client/src/pages/Payroll.jsx`
- [Admin operations](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/AttendanceManage.jsx): `client/src/pages/AttendanceManage.jsx`
- [Reports and settings](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/pages/Reports.jsx): `client/src/pages/Reports.jsx`
- [API client](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/services/api.js): `client/src/services/api.js`

### API and identity

- [Express API](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/index.js): `server/index.js`
- [Auth endpoints](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Auth handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/authController.js): `server/controllers/authController.js`
- [Auth client service](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/client/src/services/authService.js): `client/src/services/authService.js`

### HR operations

- [Employee handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/employeeController.js): `server/controllers/employeeController.js`
- [Attendance handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/attendanceController.js): `server/controllers/attendanceController.js`
- [Leave endpoints](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/routes/leaveRoutes.js): `server/routes/leaveRoutes.js`
- [Leave handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/leaveController.js): `server/controllers/leaveController.js`
- [Payroll handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/payrollController.js): `server/controllers/payrollController.js`
- [HR records](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/models/Attendance.js): `server/models/Attendance.js`

### Insights and support

- [Analytics handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/analyticsController.js): `server/controllers/analyticsController.js`
- [Activity handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/activityController.js): `server/controllers/activityController.js`
- [Notification handling](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/controllers/notificationController.js): `server/controllers/notificationController.js`
- [Email delivery](https://github.com/shubhamshubham66/dayflow_human_resource_ms/blob/phase1-foundation-auth/server/utils/sendEmail.js): `server/utils/sendEmail.js`

### Other components

- **Employee / admin**

## Connections

- Employee / admin → Route and role access: uses
- Route and role access → Auth context: checks identity
- Route and role access → Sign-in and enrollment: routes
- Route and role access → Role dashboards: routes by role
- Route and role access → Attendance pages: routes
- Route and role access → Leave pages: routes
- Route and role access → Payroll pages: routes
- Route and role access → Admin operations: routes
- Route and role access → Reports and settings: routes
- Sign-in and enrollment → Auth client service: auth actions
- Auth client service → API client: sends requests
- API client → Express API: HTTP requests
- Express API → Auth endpoints: mounts
- Auth endpoints → Auth handling: dispatches
- Auth handling → HR records: reads/writes users
- Auth handling → Email delivery: sends email
- Express API → Leave endpoints: mounts
- Leave endpoints → Leave handling: dispatches
- Leave handling → HR records: reads/writes HR data
- Attendance handling → HR records: reads/writes attendance
- Attendance handling → Activity handling: creates activity
- Leave handling → Activity handling: creates activity
- Employee handling → HR records: reads/writes employee data
- Payroll handling → HR records: reads/writes payroll data
- Analytics handling → HR records: reads for analytics
