# pranavv-07/factuly-leave-management-system-team- architecture

> Architecture diagram of the GitHub repository pranavv-07/factuly-leave-management-system-team-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pranavv-07/factuly-leave-management-system-team-
- Repository: https://github.com/pranavv-07/factuly-leave-management-system-team-

## Overview

This is a faculty leave-management web application. Employees use the browser interface to apply for leave and review their requests; HODs handle pending approvals, while administrators can manage employee records and view leave-related dashboards. The Express server in app.js exposes the application’s API and reads or writes employee and leave data in MongoDB. The excerpts show some browser-to-API calls and server-side data operations, but not the complete UI wiring or every route interaction.

Main entry points: [`app.js`](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js) (Leave and employee API), [`script.js`](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js) (Leave dashboards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser interface"]
  node_webui["Leave dashboards<br/>[script.js]"]
  node_employee_flows["Employee leave flows<br/>[script.js]"]
  node_hod_flows["HOD approvals<br/>[script.js]"]
  node_admin_flows["Admin tools<br/>[script.js]"]
end

subgraph group_server["Application API"]
  node_api["Leave and employee API<br/>[app.js]"]
  node_auth["Login endpoint<br/>[app.js]"]
  node_leave_ops["Leave requests and summaries<br/>[app.js]"]
  node_approval_ops["Approvals and dashboards<br/>[app.js]"]
  node_employee_ops["Employee management<br/>[app.js]"]
end

subgraph group_data["Persistence and data"]
  node_mongo[("MongoDB")]
  node_employee_seed["Employee seed data<br/>[seed.js]"]
end

node_employee(("Employee"))
node_hod(("HOD"))
node_admin(("Administrator"))
node_automation["Power Automate"]

node_employee -->|"uses"| node_webui
node_hod -->|"uses"| node_webui
node_admin -->|"uses"| node_webui
node_webui -->|"navigates"| node_employee_flows
node_webui -->|"navigates"| node_hod_flows
node_employee_flows -->|"requests balance"| node_api
node_employee_flows -->|"loads leaves"| node_api
node_hod_flows -->|"loads approvals"| node_api
node_employee_flows -.->|"notifies"| node_automation
node_api -->|"routes login"| node_auth
node_api -->|"routes leave requests"| node_leave_ops
node_api -->|"routes approvals"| node_approval_ops
node_api -->|"routes employee records"| node_employee_ops
node_auth -->|"reads employees"| node_mongo
node_leave_ops -->|"reads and writes leaves"| node_mongo
node_approval_ops -->|"queries leaves"| node_mongo
node_employee_ops -->|"reads and writes employees"| node_mongo

click node_webui "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js"
click node_employee_flows "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js"
click node_hod_flows "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js"
click node_admin_flows "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js"
click node_api "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js"
click node_auth "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js"
click node_leave_ops "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js"
click node_approval_ops "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js"
click node_employee_ops "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js"
click node_employee_seed "https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/seed.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_webui,node_employee_flows,node_hod_flows,node_admin_flows toneBlue
class node_api,node_auth,node_leave_ops,node_approval_ops,node_employee_ops toneAmber
class node_mongo,node_employee_seed toneMint
class node_employee,node_hod,node_admin,node_automation toneIndigo
```

## Components

### Browser interface

- [Leave dashboards](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js): `script.js`
- [Employee leave flows](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js): `script.js`
- [HOD approvals](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js): `script.js`
- [Admin tools](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/script.js): `script.js`

### Application API

- [Leave and employee API](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js): `app.js`
- [Login endpoint](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js): `app.js`
- [Leave requests and summaries](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js): `app.js`
- [Approvals and dashboards](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js): `app.js`
- [Employee management](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/app.js): `app.js`

### Persistence and data

- **MongoDB**
- [Employee seed data](https://github.com/pranavv-07/factuly-leave-management-system-team-/blob/main/seed.js): `seed.js`

### Other components

- **Employee**
- **HOD**
- **Administrator**
- **Power Automate**

## Connections

- Employee → Leave dashboards: uses
- HOD → Leave dashboards: uses
- Administrator → Leave dashboards: uses
- Leave dashboards → Employee leave flows: navigates (evidence: `script.js`)
- Leave dashboards → HOD approvals: navigates (evidence: `script.js`)
- Employee leave flows → Leave and employee API: requests balance (evidence: `script.js`)
- Employee leave flows → Leave and employee API: loads leaves (evidence: `script.js`)
- HOD approvals → Leave and employee API: loads approvals (evidence: `script.js`)
- Employee leave flows → Power Automate: notifies
- Leave and employee API → Login endpoint: routes login (evidence: `app.js`)
- Leave and employee API → Leave requests and summaries: routes leave requests (evidence: `app.js`)
- Leave and employee API → Approvals and dashboards: routes approvals (evidence: `app.js`)
- Leave and employee API → Employee management: routes employee records (evidence: `app.js`)
- Login endpoint → MongoDB: reads employees (evidence: `app.js`)
- Leave requests and summaries → MongoDB: reads and writes leaves (evidence: `app.js`)
- Approvals and dashboards → MongoDB: queries leaves (evidence: `app.js`)
- Employee management → MongoDB: reads and writes employees (evidence: `app.js`)
