# shubhsingh13jann/employee-management-system architecture

> Architecture diagram of the GitHub repository shubhsingh13jann/employee-management-system, 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/shubhsingh13jann/employee-management-system
- Repository: https://github.com/shubhsingh13jann/employee-management-system

## Overview

Enterprise EMS is a role-based employee and resource management system. Users enter through the landing and authentication experience, then protected role portals support HR administration, manager project and escalated-leave work, supervisor team/task/leave workflows, and employee task, leave, and profile work. The frontend sends API requests to the Express service, whose role-specific routes dispatch to controllers that access MySQL. Authentication also sends security and account emails. The README documents capabilities beyond the sampled implementations; those branches are represented at their listed module paths, with uncertain wiring omitted.

Main entry points: [`Employee-MS/src/App.tsx`](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/App.tsx) (Route shell), [`Server/index.js`](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/index.js) (HTTP service), [`Employee-MS/src/api/axios.js`](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/api/axios.js) (API client), [`Employee-MS/src/pages/Login.tsx`](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/Login.tsx) (Sign-in and signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route shell<br/>[App.tsx]"]
  node_authui["Sign-in and signup<br/>[Login.tsx]"]
  node_authctx["Session context<br/>[AuthContext.tsx]"]
  node_adminui["Admin workspace<br/>[Departments.tsx]"]
  node_managerui["Manager projects"]
  node_managerleaveui["Manager leave review<br/>[ManagerLeaves.tsx]"]
  node_supervisorui["Supervisor tasks"]
  node_employeeui["Employee portal<br/>[EmployeeTasks.tsx]"]
  node_http["API client<br/>[axios.js]"]
end

subgraph group_api["API and access"]
  node_server["HTTP service<br/>[index.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_adminroutes["Admin routes<br/>[adminRoutes.js]"]
  node_managerroutes["Manager routes<br/>[managerRoutes.js]"]
  node_supervisorroutes["Supervisor routes"]
  node_employeeroutes["Employee routes<br/>[employeeRoutes.js]"]
  node_taskroutes["Task discussion routes<br/>[taskRoutes.js]"]
  node_access["Token and role checks<br/>[authMiddleware.js]"]
  node_authctl["Authentication workflows<br/>[authController.js]"]
end

subgraph group_governance["Workforce governance"]
  node_adminctl["Organization administration<br/>[adminController.js]"]
end

subgraph group_operations["Team operations"]
  node_managerctl["Manager workflows"]
  node_supervisorctl["Supervisor workflows"]
  node_employeectl["Employee workflows"]
  node_taskctl["Task discussions<br/>[taskController.js]"]
end

subgraph group_platform["Persistence and messaging"]
  node_mysql[("MySQL database<br/>[db.js]")]
  node_email["Email delivery<br/>[emailService.js]"]
end

node_user(("Portal user"))

node_user -->|"opens portal"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"protects routes"| node_adminui
node_app -->|"protects routes"| node_managerui
node_app -->|"protects routes"| node_managerleaveui
node_app -->|"protects routes"| node_supervisorui
node_app -->|"protects routes"| node_employeeui
node_authui -->|"uses session"| node_authctx
node_authui -->|"sends requests"| node_http
node_adminui -->|"sends requests"| node_http
node_managerui -->|"sends requests"| node_http
node_managerleaveui -->|"sends requests"| node_http
node_supervisorui -->|"sends requests"| node_http
node_employeeui -->|"sends requests"| node_http
node_http -->|"API requests"| node_server
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_adminroutes
node_server -->|"mounts routes"| node_managerroutes
node_server -->|"mounts routes"| node_supervisorroutes
node_server -->|"mounts routes"| node_employeeroutes
node_server -->|"mounts routes"| node_taskroutes
node_authroutes -->|"checks token"| node_access
node_adminroutes -->|"checks role"| node_access
node_authroutes -->|"dispatches"| node_authctl
node_adminroutes -->|"dispatches"| node_adminctl
node_managerroutes -->|"dispatches"| node_managerctl
node_supervisorroutes -->|"dispatches"| node_supervisorctl
node_employeeroutes -->|"dispatches"| node_employeectl
node_taskroutes -->|"dispatches"| node_taskctl
node_authctl -->|"reads and writes"| node_mysql
node_adminctl -->|"reads and writes"| node_mysql
node_employeectl -->|"reads and writes"| node_mysql
node_authctl -.->|"sends security mail"| node_email

click node_app "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/App.tsx"
click node_authui "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/Login.tsx"
click node_authctx "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/context/AuthContext.tsx"
click node_adminui "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/admin/Departments.tsx"
click node_managerui "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/manager/ProjectsManager.tsx"
click node_managerleaveui "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/manager/ManagerLeaves.tsx"
click node_supervisorui "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/supervisor/SupervisorTasks.tsx"
click node_employeeui "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/employee/EmployeeTasks.tsx"
click node_http "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/api/axios.js"
click node_server "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/index.js"
click node_authroutes "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/authRoutes.js"
click node_adminroutes "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/adminRoutes.js"
click node_managerroutes "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/managerRoutes.js"
click node_supervisorroutes "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/supervisorRoutes.js"
click node_employeeroutes "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/employeeRoutes.js"
click node_taskroutes "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/taskRoutes.js"
click node_access "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/middleware/authMiddleware.js"
click node_authctl "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/authController.js"
click node_adminctl "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/adminController.js"
click node_managerctl "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/managerController.js"
click node_supervisorctl "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/supervisorController.js"
click node_employeectl "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/employeeController.js"
click node_taskctl "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/taskController.js"
click node_mysql "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/config/db.js"
click node_email "https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/utils/emailService.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_authui,node_authctx,node_adminui,node_managerui,node_managerleaveui,node_supervisorui,node_employeeui,node_http,node_user toneBlue
class node_server,node_authroutes,node_adminroutes,node_managerroutes,node_supervisorroutes,node_employeeroutes,node_taskroutes,node_access,node_authctl toneAmber
class node_adminctl toneMint
class node_managerctl,node_supervisorctl,node_employeectl,node_taskctl toneRose
class node_mysql,node_email toneIndigo
```

## Components

### Web client

- [Route shell](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/App.tsx): `Employee-MS/src/App.tsx`
- [Sign-in and signup](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/Login.tsx): `Employee-MS/src/pages/Login.tsx`
- [Session context](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/context/AuthContext.tsx): `Employee-MS/src/context/AuthContext.tsx`
- [Admin workspace](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/admin/Departments.tsx): `Employee-MS/src/pages/admin/Departments.tsx`
- [Manager projects](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/manager/ProjectsManager.tsx): `Employee-MS/src/pages/manager/ProjectsManager.tsx`
- [Manager leave review](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/manager/ManagerLeaves.tsx): `Employee-MS/src/pages/manager/ManagerLeaves.tsx`
- [Supervisor tasks](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/supervisor/SupervisorTasks.tsx): `Employee-MS/src/pages/supervisor/SupervisorTasks.tsx`
- [Employee portal](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/pages/employee/EmployeeTasks.tsx): `Employee-MS/src/pages/employee/EmployeeTasks.tsx`
- [API client](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Employee-MS/src/api/axios.js): `Employee-MS/src/api/axios.js`

### API and access

- [HTTP service](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/index.js): `Server/index.js`
- [Authentication routes](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/authRoutes.js): `Server/Routes/authRoutes.js`
- [Admin routes](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/adminRoutes.js): `Server/Routes/adminRoutes.js`
- [Manager routes](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/managerRoutes.js): `Server/Routes/managerRoutes.js`
- [Supervisor routes](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/supervisorRoutes.js): `Server/Routes/supervisorRoutes.js`
- [Employee routes](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/employeeRoutes.js): `Server/Routes/employeeRoutes.js`
- [Task discussion routes](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/Routes/taskRoutes.js): `Server/Routes/taskRoutes.js`
- [Token and role checks](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/middleware/authMiddleware.js): `Server/middleware/authMiddleware.js`
- [Authentication workflows](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/authController.js): `Server/controllers/authController.js`

### Workforce governance

- [Organization administration](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/adminController.js): `Server/controllers/adminController.js`

### Team operations

- [Manager workflows](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/managerController.js): `Server/controllers/managerController.js`
- [Supervisor workflows](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/supervisorController.js): `Server/controllers/supervisorController.js`
- [Employee workflows](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/employeeController.js): `Server/controllers/employeeController.js`
- [Task discussions](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/controllers/taskController.js): `Server/controllers/taskController.js`

### Persistence and messaging

- [MySQL database](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/config/db.js): `Server/config/db.js`
- [Email delivery](https://github.com/shubhsingh13jann/employee-management-system/blob/main/Server/utils/emailService.js): `Server/utils/emailService.js`

### Other components

- **Portal user**

## Connections

- Portal user → Route shell: opens portal
- Route shell → Sign-in and signup: routes to
- Route shell → Admin workspace: protects routes
- Route shell → Manager projects: protects routes
- Route shell → Manager leave review: protects routes
- Route shell → Supervisor tasks: protects routes
- Route shell → Employee portal: protects routes
- Sign-in and signup → Session context: uses session
- Sign-in and signup → API client: sends requests
- Admin workspace → API client: sends requests
- Manager projects → API client: sends requests
- Manager leave review → API client: sends requests
- Supervisor tasks → API client: sends requests
- Employee portal → API client: sends requests
- API client → HTTP service: API requests
- HTTP service → Authentication routes: mounts routes
- HTTP service → Admin routes: mounts routes
- HTTP service → Manager routes: mounts routes
- HTTP service → Supervisor routes: mounts routes
- HTTP service → Employee routes: mounts routes
- HTTP service → Task discussion routes: mounts routes
- Authentication routes → Token and role checks: checks token
- Admin routes → Token and role checks: checks role
- Authentication routes → Authentication workflows: dispatches
- Admin routes → Organization administration: dispatches
- Manager routes → Manager workflows: dispatches
- Supervisor routes → Supervisor workflows: dispatches
- Employee routes → Employee workflows: dispatches
- Task discussion routes → Task discussions: dispatches
- Authentication workflows → MySQL database: reads and writes
- Organization administration → MySQL database: reads and writes
- Employee workflows → MySQL database: reads and writes
- Authentication workflows → Email delivery: sends security mail
