# samanthapaual-cpu/ems-final architecture

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

- Interactive diagram: https://gitdiagram.com/samanthapaual-cpu/ems-final
- Repository: https://github.com/samanthapaual-cpu/ems-final

## Overview

This is a role-based employee management system: administrators manage staff and organization settings, while employees use dashboards, time-clock, and leave-request features. The principal workflow runs from sign-in through role-specific screens to API operations and PostgreSQL-backed records. The graph keeps the documented domain areas distinct. Some frontend API-client and backend implementation details were not excerpted, so only documented or directly visible relationships are asserted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/App.jsx) (Application routes), [`frontend/src/assets/api.js`](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/assets/api.js) (API request client), [`frontend/src/pages/Dashboard.jsx`](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Dashboard.jsx) (Dashboard view), [`frontend/src/components/LoginForm.jsx`](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/LoginForm.jsx) (Sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Application routes<br/>[App.jsx]"]
  node_login["Sign-in<br/>[LoginForm.jsx]"]
  node_navigation["Navigation and session<br/>[Sidebar.jsx]"]
  node_dashboard["Dashboard view<br/>[Dashboard.jsx]"]
  node_admin_summary["Administrator summary<br/>[AdminDashboard.jsx]"]
  node_employee_summary["Employee summary"]
  node_employees["Employee management<br/>[Employees.jsx]"]
  node_attendance["Attendance and time clock<br/>[Attendance.jsx]"]
  node_leave["Leave requests and review<br/>[Leave.jsx]"]
  node_settings["Account and organization settings<br/>[Settings.jsx]"]
  node_api_client["API request client<br/>[api.js]"]
end

subgraph group_service["API services"]
  node_api["HTTP API and authorization<br/>[server.js]"]
end

subgraph group_data["Persistence"]
  node_pool["PostgreSQL connection pool<br/>[db.js]"]
  node_postgres[("PostgreSQL database")]
end

node_user(("Admin or employee"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_employees
node_app -->|"routes to"| node_attendance
node_app -->|"routes to"| node_leave
node_app -->|"routes to"| node_settings
node_app -->|"renders via"| node_navigation
node_dashboard -->|"requests summary"| node_api_client
node_dashboard -->|"renders"| node_admin_summary
node_dashboard -->|"renders"| node_employee_summary
node_login -->|"submits credentials"| node_api_client
node_employees -->|"requests employee data"| node_api_client
node_attendance -->|"requests time records"| node_api_client
node_leave -->|"requests leave data"| node_api_client
node_settings -->|"requests settings"| node_api_client
node_api_client -.->|"sends API requests"| node_api
node_api -->|"queries through"| node_pool
node_pool -->|"connects to"| node_postgres

click node_app "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/LoginForm.jsx"
click node_navigation "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/Sidebar.jsx"
click node_dashboard "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Dashboard.jsx"
click node_admin_summary "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/AdminDashboard.jsx"
click node_employee_summary "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/EmployeeDashboard.jsx"
click node_employees "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Employees.jsx"
click node_attendance "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Attendance.jsx"
click node_leave "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Leave.jsx"
click node_settings "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Settings.jsx"
click node_api_client "https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/assets/api.js"
click node_api "https://github.com/samanthapaual-cpu/ems-final/blob/main/backend/src/server.js"
click node_pool "https://github.com/samanthapaual-cpu/ems-final/blob/main/backend/src/db.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_login,node_navigation,node_dashboard,node_admin_summary,node_employee_summary,node_employees,node_attendance,node_leave,node_settings,node_api_client toneBlue
class node_api toneAmber
class node_pool,node_postgres toneMint
class node_user toneIndigo
```

## Components

### Web application

- [Application routes](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/LoginForm.jsx): `frontend/src/components/LoginForm.jsx`
- [Navigation and session](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Dashboard view](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Administrator summary](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/AdminDashboard.jsx): `frontend/src/components/AdminDashboard.jsx`
- [Employee summary](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/components/EmployeeDashboard.jsx): `frontend/src/components/EmployeeDashboard.jsx`
- [Employee management](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Employees.jsx): `frontend/src/pages/Employees.jsx`
- [Attendance and time clock](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Attendance.jsx): `frontend/src/pages/Attendance.jsx`
- [Leave requests and review](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Leave.jsx): `frontend/src/pages/Leave.jsx`
- [Account and organization settings](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/pages/Settings.jsx): `frontend/src/pages/Settings.jsx`
- [API request client](https://github.com/samanthapaual-cpu/ems-final/blob/main/frontend/src/assets/api.js): `frontend/src/assets/api.js`

### API services

- [HTTP API and authorization](https://github.com/samanthapaual-cpu/ems-final/blob/main/backend/src/server.js): `backend/src/server.js`

### Persistence

- [PostgreSQL connection pool](https://github.com/samanthapaual-cpu/ems-final/blob/main/backend/src/db.js): `backend/src/db.js`
- **PostgreSQL database**

### Other components

- **Admin or employee**

## Connections

- Admin or employee → Application routes: uses
- Application routes → Sign-in: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Dashboard view: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Employee management: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Attendance and time clock: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Leave requests and review: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Account and organization settings: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Navigation and session: renders via
- Dashboard view → API request client: requests summary (evidence: `frontend/src/pages/Dashboard.jsx`)
- Dashboard view → Administrator summary: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Dashboard view → Employee summary: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Sign-in → API request client: submits credentials (evidence: `frontend/src/components/LoginForm.jsx`)
- Employee management → API request client: requests employee data (evidence: `frontend/src/pages/Employees.jsx`)
- Attendance and time clock → API request client: requests time records (evidence: `frontend/src/pages/Attendance.jsx`)
- Leave requests and review → API request client: requests leave data (evidence: `frontend/src/pages/Leave.jsx`)
- Account and organization settings → API request client: requests settings (evidence: `frontend/src/pages/Settings.jsx`)
- API request client → HTTP API and authorization: sends API requests
- HTTP API and authorization → PostgreSQL connection pool: queries through (evidence: `backend/src/server.js`)
- PostgreSQL connection pool → PostgreSQL database: connects to (evidence: `backend/src/db.js`)
