# rishabrebala-03/naxrita-hrms architecture

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

- Interactive diagram: https://gitdiagram.com/rishabrebala-03/naxrita-hrms
- Repository: https://github.com/rishabrebala-03/naxrita-hrms

## Overview

Naxrita is a full-stack HR management platform for employees, managers, and administrators. Users enter through the React portal, which selects role-appropriate workspaces; Flask exposes the HR APIs and MongoDB stores operational data. The domain spans employee administration, leave approvals and accrual, timesheets and expenses, payroll, projects, governance, and office services. Mail is a separate asynchronous subsystem. The README documents the broad product capabilities; unsampled feature implementations are represented at their exact route or component paths, with only documented or indexed relationships shown.

Main entry points: [`backend/app.py`](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/app.py) (Flask API), [`frontend/src/App.js`](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/App.js) (Role-based portal), [`backend/config/db.py`](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/config/db.py) (MongoDB), [`backend/routes/leave_routes.py`](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/leave_routes.py) (Leave workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["User portal"]
  node_portal_app["Role-based portal<br/>[App.js]"]
end

subgraph group_workforce["Workforce workflows"]
  node_employee_admin["Employee directory<br/>[EmployeeList.js]"]
  node_access["Access management"]
  node_user_api["User APIs<br/>[user_routes.py]"]
  node_leave_ui["Leave workspaces<br/>[EmployeeLeaves.js]"]
  node_manager_leave_ui["Manager approvals<br/>[ManagerLeaves.js]"]
  node_admin_leave_ui["Admin leave desk<br/>[AdminLeaves.js]"]
  node_leave_api["Leave workflows<br/>[leave_routes.py]"]
  node_leave_accrual["Leave accrual<br/>[leave_accrual.py]"]
end

subgraph group_operations["Business operations"]
  node_timesheet_ui["Timesheet workspace<br/>[Timesheets.js]"]
  node_timesheet_api["Timesheet workflows"]
  node_expense_api["Expense claims<br/>[expense_routes.py]"]
  node_payslips["Payroll documents<br/>[Payslips.js]"]
  node_payslip_api["Payslip distribution<br/>[payslip_routes.py]"]
  node_projects["Project tracking<br/>[project_routes.py]"]
  node_governance["Audit and policy<br/>[log_routes.py]"]
  node_office_services["Tea and coffee<br/>[TeaCoffee.js]"]
  node_office_api["Office service API"]
end

subgraph group_platform["API and data"]
  node_api_app["Flask API<br/>[app.py]"]
  node_database[("MongoDB<br/>[db.py]")]
end

subgraph group_messaging["Mail delivery"]
  node_mail_service["Mail orchestration<br/>[mail_service.py]"]
  node_mail_queue["Mail queue<br/>[queue_service.py]"]
  node_mail_worker["Mail worker<br/>[mail_worker.py]"]
  node_smtp["SMTP delivery<br/>[smtp_service.py]"]
  node_mail_settings["Mail settings<br/>[mail_settings.py]"]
  node_email_logs["Email logs<br/>[email_logs.py]"]
end

node_employee(("Employee"))
node_manager(("Manager"))
node_administrator(("Administrator"))
node_smtp_provider(("SMTP server"))

node_employee -->|"uses"| node_portal_app
node_manager -->|"uses"| node_portal_app
node_administrator -->|"uses"| node_portal_app
node_portal_app -->|"selects workspace"| node_leave_ui
node_portal_app -->|"selects workspace"| node_manager_leave_ui
node_portal_app -->|"selects workspace"| node_admin_leave_ui
node_portal_app -->|"renders"| node_payslips
node_portal_app -->|"renders"| node_employee_admin
node_portal_app -->|"renders"| node_access
node_portal_app -->|"renders"| node_timesheet_ui
node_portal_app -->|"renders"| node_office_services
node_portal_app -->|"calls APIs"| node_api_app
node_api_app -->|"registers"| node_user_api
node_api_app -->|"registers"| node_leave_api
node_api_app -->|"registers"| node_timesheet_api
node_api_app -->|"registers"| node_expense_api
node_api_app -->|"registers"| node_payslip_api
node_api_app -->|"registers"| node_projects
node_api_app -->|"registers"| node_governance
node_api_app -->|"registers"| node_office_api
node_user_api -->|"reads and writes"| node_database
node_leave_api -->|"reads and writes"| node_database
node_leave_api -->|"uses accrual"| node_leave_accrual
node_timesheet_api -->|"reads and writes"| node_database
node_expense_api -->|"reads and writes"| node_database
node_leave_ui -->|"calls APIs"| node_api_app
node_manager_leave_ui -->|"calls APIs"| node_api_app
node_timesheet_ui -->|"calls APIs"| node_api_app
node_payslips -->|"calls APIs"| node_api_app
node_office_services -->|"calls APIs"| node_api_app
node_leave_api -->|"queues notices"| node_mail_service
node_mail_service -->|"enqueues"| node_mail_queue
node_mail_queue -->|"stores queue"| node_database
node_mail_worker -->|"claims and updates"| node_mail_queue
node_mail_worker -->|"sends mail"| node_smtp
node_smtp -->|"loads settings"| node_mail_settings
node_smtp -->|"delivers"| node_smtp_provider
node_mail_queue -->|"records status"| node_email_logs

click node_portal_app "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/App.js"
click node_employee_admin "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/EmployeeList.js"
click node_access "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/AccessManagement.js"
click node_user_api "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/user_routes.py"
click node_leave_ui "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/EmployeeLeaves.js"
click node_manager_leave_ui "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/ManagerLeaves.js"
click node_admin_leave_ui "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/AdminLeaves.js"
click node_leave_api "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/leave_routes.py"
click node_leave_accrual "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/utils/leave_accrual.py"
click node_timesheet_ui "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/Timesheets.js"
click node_timesheet_api "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/timesheet_routes.py"
click node_expense_api "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/expense_routes.py"
click node_payslips "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/Payslips.js"
click node_payslip_api "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/payslip_routes.py"
click node_projects "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/project_routes.py"
click node_governance "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/log_routes.py"
click node_office_services "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/TeaCoffee.js"
click node_office_api "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/tea_coffee_routes.py"
click node_api_app "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/app.py"
click node_database "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/config/db.py"
click node_mail_service "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/services/mail_service.py"
click node_mail_queue "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/services/queue_service.py"
click node_mail_worker "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/workers/mail_worker.py"
click node_smtp "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/services/smtp_service.py"
click node_mail_settings "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/models/mail_settings.py"
click node_email_logs "https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/models/email_logs.py"

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_portal_app toneBlue
class node_employee_admin,node_access,node_user_api,node_leave_ui,node_manager_leave_ui,node_admin_leave_ui,node_leave_api,node_leave_accrual toneAmber
class node_timesheet_ui,node_timesheet_api,node_expense_api,node_payslips,node_payslip_api,node_projects,node_governance,node_office_services,node_office_api,node_smtp_provider toneMint
class node_api_app,node_database toneRose
class node_mail_service,node_mail_queue,node_mail_worker,node_smtp,node_mail_settings,node_email_logs,node_employee,node_manager,node_administrator toneIndigo
```

## Components

### User portal

- [Role-based portal](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/App.js): `frontend/src/App.js`

### Workforce workflows

- [Employee directory](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/EmployeeList.js): `frontend/src/components/EmployeeList.js`
- [Access management](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/AccessManagement.js): `frontend/src/components/AccessManagement.js`
- [User APIs](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/user_routes.py): `backend/routes/user_routes.py`
- [Leave workspaces](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/EmployeeLeaves.js): `frontend/src/components/EmployeeLeaves.js`
- [Manager approvals](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/ManagerLeaves.js): `frontend/src/components/ManagerLeaves.js`
- [Admin leave desk](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/AdminLeaves.js): `frontend/src/components/AdminLeaves.js`
- [Leave workflows](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/leave_routes.py): `backend/routes/leave_routes.py`
- [Leave accrual](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/utils/leave_accrual.py): `backend/utils/leave_accrual.py`

### Business operations

- [Timesheet workspace](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/Timesheets.js): `frontend/src/components/Timesheets.js`
- [Timesheet workflows](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/timesheet_routes.py): `backend/routes/timesheet_routes.py`
- [Expense claims](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/expense_routes.py): `backend/routes/expense_routes.py`
- [Payroll documents](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/Payslips.js): `frontend/src/components/Payslips.js`
- [Payslip distribution](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/payslip_routes.py): `backend/routes/payslip_routes.py`
- [Project tracking](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/project_routes.py): `backend/routes/project_routes.py`
- [Audit and policy](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/log_routes.py): `backend/routes/log_routes.py`
- [Tea and coffee](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/frontend/src/components/TeaCoffee.js): `frontend/src/components/TeaCoffee.js`
- [Office service API](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/routes/tea_coffee_routes.py): `backend/routes/tea_coffee_routes.py`

### API and data

- [Flask API](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/app.py): `backend/app.py`
- [MongoDB](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/config/db.py): `backend/config/db.py`

### Mail delivery

- [Mail orchestration](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/services/mail_service.py): `backend/services/mail_service.py`
- [Mail queue](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/services/queue_service.py): `backend/services/queue_service.py`
- [Mail worker](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/workers/mail_worker.py): `backend/workers/mail_worker.py`
- [SMTP delivery](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/services/smtp_service.py): `backend/services/smtp_service.py`
- [Mail settings](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/models/mail_settings.py): `backend/models/mail_settings.py`
- [Email logs](https://github.com/rishabrebala-03/naxrita-hrms/blob/main/backend/models/email_logs.py): `backend/models/email_logs.py`

### Other components

- **Employee**
- **Manager**
- **Administrator**
- **SMTP server**

## Connections

- Employee → Role-based portal: uses
- Manager → Role-based portal: uses
- Administrator → Role-based portal: uses
- Role-based portal → Leave workspaces: selects workspace (evidence: `frontend/src/App.js`)
- Role-based portal → Manager approvals: selects workspace (evidence: `frontend/src/App.js`)
- Role-based portal → Admin leave desk: selects workspace (evidence: `frontend/src/App.js`)
- Role-based portal → Payroll documents: renders (evidence: `frontend/src/App.js`)
- Role-based portal → Employee directory: renders (evidence: `frontend/src/App.js`)
- Role-based portal → Access management: renders (evidence: `frontend/src/App.js`)
- Role-based portal → Timesheet workspace: renders (evidence: `frontend/src/App.js`)
- Role-based portal → Tea and coffee: renders (evidence: `frontend/src/App.js`)
- Role-based portal → Flask API: calls APIs
- Flask API → User APIs: registers (evidence: `backend/app.py`)
- Flask API → Leave workflows: registers (evidence: `backend/app.py`)
- Flask API → Timesheet workflows: registers (evidence: `backend/app.py`)
- Flask API → Expense claims: registers (evidence: `backend/app.py`)
- Flask API → Payslip distribution: registers (evidence: `backend/app.py`)
- Flask API → Project tracking: registers (evidence: `backend/app.py`)
- Flask API → Audit and policy: registers (evidence: `backend/app.py`)
- Flask API → Office service API: registers (evidence: `backend/app.py`)
- User APIs → MongoDB: reads and writes (evidence: `backend/routes/user_routes.py`)
- Leave workflows → MongoDB: reads and writes (evidence: `backend/routes/leave_routes.py`)
- Leave workflows → Leave accrual: uses accrual (evidence: `backend/routes/leave_routes.py`)
- Timesheet workflows → MongoDB: reads and writes (evidence: `backend/routes/timesheet_routes.py`)
- Expense claims → MongoDB: reads and writes (evidence: `backend/routes/expense_routes.py`)
- Leave workspaces → Flask API: calls APIs
- Manager approvals → Flask API: calls APIs
- Timesheet workspace → Flask API: calls APIs
- Payroll documents → Flask API: calls APIs
- Tea and coffee → Flask API: calls APIs
- Leave workflows → Mail orchestration: queues notices (evidence: `backend/routes/leave_routes.py`)
- Mail orchestration → Mail queue: enqueues (evidence: `backend/services/mail_service.py`)
- Mail queue → MongoDB: stores queue (evidence: `backend/services/queue_service.py`)
- Mail worker → Mail queue: claims and updates (evidence: `backend/workers/mail_worker.py`)
- Mail worker → SMTP delivery: sends mail (evidence: `backend/workers/mail_worker.py`)
- SMTP delivery → Mail settings: loads settings (evidence: `backend/services/smtp_service.py`)
- SMTP delivery → SMTP server: delivers (evidence: `backend/services/smtp_service.py`)
- Mail queue → Email logs: records status (evidence: `backend/services/queue_service.py`)
