# rohit91singh9/hrms-system architecture

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

- Interactive diagram: https://gitdiagram.com/rohit91singh9/hrms-system
- Repository: https://github.com/rohit91singh9/hrms-system

## Overview

Codnizant HRMS is a multi-tenant HR management application with a vanilla-JS UI and FastAPI/SQLAlchemy backend. Users interact through the UI and API for authentication, core HR data, workflow operations, and AI/reporting features; tenant-scoped records persist in the configured database. The graph preserves README-documented product areas, including features whose implementation excerpts were not shown. Some links rely on the SOURCE INDEX or README rather than sampled function bodies; unsampled details are not inferred.

Main entry points: [`backend/app/database.py`](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/database.py) (SQLAlchemy session), [`backend/app/main.py`](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/auth.py`](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/auth.py) (Authentication and tenants), [`backend/app/hooks.py`](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/hooks.py) (Business rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_ui["Web interface<br/>[app.js]"]
  node_api["FastAPI application<br/>[main.py]"]
end

subgraph group_access["Identity and tenancy"]
  node_auth["Authentication and tenants<br/>[auth.py]"]
  node_security["Tokens and MFA<br/>[security.py]"]
  node_access_rules["RBAC and tenant scope<br/>[deps.py]"]
end

subgraph group_hr["HR operations"]
  node_crud["Scoped HR data API<br/>[crud.py]"]
  node_workflows["HR workflows<br/>[workflows.py]"]
  node_business_rules["Business rules<br/>[hooks.py]"]
  node_recruiting_nlp["Resume parsing and matching<br/>[nlp.py]"]
  node_payroll["Payroll calculations<br/>[payroll_calc.py]"]
end

subgraph group_insights["AI and insights"]
  node_analytics["Reports and CSV<br/>[reports.py]"]
  node_ai["AI assistant and analysis<br/>[ai.py]"]
end

subgraph group_platform["Shared platform"]
  node_database["SQLAlchemy session<br/>[database.py]"]
  node_records[("HR and audit records<br/>[models.py]")]
  node_bootstrap["Tenant bootstrap data<br/>[seed.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

node_employee(("HRMS user"))
node_store[("Configured SQL database")]

node_employee -->|"uses"| node_ui
node_ui -->|"calls API"| node_api
node_api -->|"registers routes"| node_auth
node_api -->|"registers routes"| node_crud
node_api -->|"registers routes"| node_workflows
node_api -->|"registers routes"| node_analytics
node_api -->|"registers routes"| node_ai
node_api -->|"initializes data"| node_bootstrap
node_auth -->|"uses"| node_security
node_auth -->|"checks access"| node_access_rules
node_auth -->|"opens session"| node_database
node_auth -->|"creates tenant"| node_bootstrap
node_access_rules -->|"decodes tokens"| node_security
node_access_rules -->|"loads session"| node_database
node_crud -->|"applies hooks"| node_business_rules
node_crud -->|"checks scope"| node_access_rules
node_crud -->|"queries records"| node_database
node_workflows -->|"uses rules"| node_business_rules
node_workflows -->|"calculates payroll"| node_payroll
node_workflows -->|"runs queries"| node_database
node_business_rules -->|"parses and scores"| node_recruiting_nlp
node_business_rules -->|"hashes credentials"| node_security
node_analytics -->|"queries records"| node_database
node_ai -->|"ranks policy text"| node_recruiting_nlp
node_ai -->|"reads and writes"| node_database
node_bootstrap -->|"creates tables"| node_database
node_bootstrap -->|"creates checklists"| node_business_rules
node_database -->|"reads database URL"| node_settings
node_records -->|"declares ORM base"| node_database
node_database -->|"connects"| node_store

click node_ui "https://github.com/rohit91singh9/hrms-system/blob/main/frontend/app.js"
click node_api "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/main.py"
click node_auth "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/auth.py"
click node_security "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/security.py"
click node_access_rules "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/deps.py"
click node_crud "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/crud.py"
click node_workflows "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/workflows.py"
click node_business_rules "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/hooks.py"
click node_recruiting_nlp "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/nlp.py"
click node_payroll "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/payroll_calc.py"
click node_analytics "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/reports.py"
click node_ai "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/ai.py"
click node_database "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/database.py"
click node_records "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/models.py"
click node_bootstrap "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/seed.py"
click node_settings "https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/config.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_ui,node_api,node_employee toneBlue
class node_auth,node_security,node_access_rules,node_store toneAmber
class node_crud,node_workflows,node_business_rules,node_recruiting_nlp,node_payroll toneMint
class node_analytics,node_ai toneRose
class node_database,node_records,node_bootstrap,node_settings toneIndigo
```

## Components

### User experience

- [Web interface](https://github.com/rohit91singh9/hrms-system/blob/main/frontend/app.js): `frontend/app.js`
- [FastAPI application](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/main.py): `backend/app/main.py`

### Identity and tenancy

- [Authentication and tenants](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Tokens and MFA](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/security.py): `backend/app/security.py`
- [RBAC and tenant scope](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/deps.py): `backend/app/deps.py`

### HR operations

- [Scoped HR data API](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/crud.py): `backend/app/crud.py`
- [HR workflows](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/workflows.py): `backend/app/workflows.py`
- [Business rules](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/hooks.py): `backend/app/hooks.py`
- [Resume parsing and matching](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/nlp.py): `backend/app/nlp.py`
- [Payroll calculations](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/payroll_calc.py): `backend/app/payroll_calc.py`

### AI and insights

- [Reports and CSV](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/reports.py): `backend/app/reports.py`
- [AI assistant and analysis](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/ai.py): `backend/app/ai.py`

### Shared platform

- [SQLAlchemy session](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/database.py): `backend/app/database.py`
- [HR and audit records](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/models.py): `backend/app/models.py`
- [Tenant bootstrap data](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/seed.py): `backend/app/seed.py`
- [Runtime settings](https://github.com/rohit91singh9/hrms-system/blob/main/backend/app/config.py): `backend/app/config.py`

### Other components

- **HRMS user**
- **Configured SQL database**

## Connections

- HRMS user → Web interface: uses (evidence: `README.md`)
- Web interface → FastAPI application: calls API (evidence: `README.md`)
- FastAPI application → Authentication and tenants: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Scoped HR data API: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → HR workflows: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Reports and CSV: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → AI assistant and analysis: registers routes (evidence: `backend/app/main.py`)
- FastAPI application → Tenant bootstrap data: initializes data (evidence: `backend/app/main.py`)
- Authentication and tenants → Tokens and MFA: uses (evidence: `backend/app/auth.py`)
- Authentication and tenants → RBAC and tenant scope: checks access (evidence: `backend/app/auth.py`)
- Authentication and tenants → SQLAlchemy session: opens session (evidence: `backend/app/auth.py`)
- Authentication and tenants → Tenant bootstrap data: creates tenant (evidence: `backend/app/auth.py`)
- RBAC and tenant scope → Tokens and MFA: decodes tokens (evidence: `backend/app/deps.py`)
- RBAC and tenant scope → SQLAlchemy session: loads session (evidence: `backend/app/deps.py`)
- Scoped HR data API → Business rules: applies hooks (evidence: `backend/app/crud.py`)
- Scoped HR data API → RBAC and tenant scope: checks scope (evidence: `backend/app/crud.py`)
- Scoped HR data API → SQLAlchemy session: queries records (evidence: `backend/app/crud.py`)
- HR workflows → Business rules: uses rules (evidence: `backend/app/workflows.py`)
- HR workflows → Payroll calculations: calculates payroll (evidence: `backend/app/workflows.py`)
- HR workflows → SQLAlchemy session: runs queries (evidence: `backend/app/workflows.py`)
- Business rules → Resume parsing and matching: parses and scores (evidence: `backend/app/hooks.py`)
- Business rules → Tokens and MFA: hashes credentials (evidence: `backend/app/hooks.py`)
- Reports and CSV → SQLAlchemy session: queries records (evidence: `backend/app/reports.py`)
- AI assistant and analysis → Resume parsing and matching: ranks policy text (evidence: `backend/app/ai.py`)
- AI assistant and analysis → SQLAlchemy session: reads and writes (evidence: `backend/app/ai.py`)
- Tenant bootstrap data → SQLAlchemy session: creates tables (evidence: `backend/app/seed.py`)
- Tenant bootstrap data → Business rules: creates checklists (evidence: `backend/app/seed.py`)
- SQLAlchemy session → Runtime settings: reads database URL (evidence: `backend/app/database.py`)
- HR and audit records → SQLAlchemy session: declares ORM base (evidence: `backend/app/models.py`)
- SQLAlchemy session → Configured SQL database: connects (evidence: `backend/app/database.py`)
