# ma7amdm2m/main-hr architecture

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

- Interactive diagram: https://gitdiagram.com/ma7amdm2m/main-hr
- Repository: https://github.com/ma7amdm2m/main-hr

## Overview

Horilla is a Django-based HRMS spanning workforce administration, attendance, leave, payroll, recruitment, employee lifecycle, assets, and HR support. The principal user workflow is to use the web application to manage HR records and operational processes, then review their resulting records and dashboards; the README documents these capabilities but not a single end-to-end route. The graph preserves the major product areas and shared framework. Evidence is limited to the README, file tree, and supplied source-index references and excerpts; several domain implementations and their runtime wiring were not sampled.

Main entry points: [`recruitment/models.py`](https://github.com/ma7amdm2m/main-hr/blob/2.0/recruitment/models.py) (Recruitment), [`base/models.py`](https://github.com/ma7amdm2m/main-hr/blob/2.0/base/models.py) (Shared HR records), [`horilla_views/cbv_methods.py`](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/cbv_methods.py) (View methods), [`employee/models.py`](https://github.com/ma7amdm2m/main-hr/blob/2.0/employee/models.py) (Employee records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Web and shared core"]
  node_web["Web entry<br/>[urls.py]"]
  node_generic_views["Generic views<br/>[views.py]"]
  node_view_methods["View methods<br/>[cbv_methods.py]"]
  node_kanban["Kanban views<br/>[kanban.py]"]
  node_view_models[("View state<br/>[models.py]")]
  node_base_models[("Shared HR records<br/>[models.py]")]
  node_base_methods["Shared HR methods<br/>[methods.py]"]
end

subgraph group_workforce["Workforce operations"]
  node_employee_models[("Employee records<br/>[models.py]")]
  node_attendance[("Attendance tracking<br/>[models.py]")]
  node_leave[("Leave management<br/>[models.py]")]
  node_payroll[("Payroll<br/>[models.py]")]
  node_assets[("Asset management<br/>[models.py]")]
end

subgraph group_lifecycle["Employee lifecycle"]
  node_recruitment[("Recruitment<br/>[models.py]")]
  node_onboarding[("Onboarding<br/>[models.py]")]
  node_offboarding[("Offboarding<br/>[models.py]")]
end

subgraph group_services["HR services"]
  node_helpdesk[("HR helpdesk<br/>[models.py]")]
  node_audit[("Audit trail<br/>[models.py]")]
  node_api["API access<br/>[urls.py]"]
end

subgraph group_platform["Integrations and controls"]
  node_biometric["Biometric devices<br/>[views.py]"]
  node_geofencing["Geofencing<br/>[views.py]"]
  node_ldap["LDAP integration<br/>[views.py]"]
  node_middleware["Request context"]
  node_config["Application configuration<br/>[config.py]"]
  node_response["Safe responses<br/>[response.py]"]
  node_horilla_models[("Shared platform models<br/>[models.py]")]
  node_horilla_methods["Platform methods<br/>[methods.py]"]
end

node_user(("HR user"))

node_user -->|"uses"| node_web
node_web -->|"routes API"| node_api
node_web -.->|"routes views"| node_generic_views
node_generic_views -->|"uses methods"| node_view_methods
node_generic_views -->|"reads view state"| node_view_models
node_kanban -->|"uses methods"| node_view_methods
node_view_methods -->|"uses methods"| node_base_methods
node_view_methods -->|"queries employees"| node_employee_models
node_view_models -->|"references models"| node_horilla_models
node_base_models -->|"references employees"| node_employee_models
node_base_models -->|"references models"| node_horilla_models
node_base_models -->|"references audit"| node_audit
node_recruitment -->|"references HR records"| node_base_models
node_recruitment -->|"references employees"| node_employee_models
node_recruitment -->|"references audit"| node_audit
node_recruitment -->|"references onboarding"| node_onboarding
node_middleware -->|"uses responses"| node_response
node_biometric -.->|"supports tracking"| node_attendance
node_geofencing -.->|"supports tracking"| node_attendance
node_ldap -.->|"integrates workforce"| node_employee_models

click node_web "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/urls.py"
click node_generic_views "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/generic/cbv/views.py"
click node_view_methods "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/cbv_methods.py"
click node_kanban "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/generic/cbv/kanban.py"
click node_view_models "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/models.py"
click node_base_models "https://github.com/ma7amdm2m/main-hr/blob/2.0/base/models.py"
click node_base_methods "https://github.com/ma7amdm2m/main-hr/blob/2.0/base/methods.py"
click node_employee_models "https://github.com/ma7amdm2m/main-hr/blob/2.0/employee/models.py"
click node_attendance "https://github.com/ma7amdm2m/main-hr/blob/2.0/attendance/models.py"
click node_leave "https://github.com/ma7amdm2m/main-hr/blob/2.0/leave/models.py"
click node_payroll "https://github.com/ma7amdm2m/main-hr/blob/2.0/payroll/models/models.py"
click node_assets "https://github.com/ma7amdm2m/main-hr/blob/2.0/asset/models.py"
click node_recruitment "https://github.com/ma7amdm2m/main-hr/blob/2.0/recruitment/models.py"
click node_onboarding "https://github.com/ma7amdm2m/main-hr/blob/2.0/onboarding/models.py"
click node_offboarding "https://github.com/ma7amdm2m/main-hr/blob/2.0/offboarding/models.py"
click node_helpdesk "https://github.com/ma7amdm2m/main-hr/blob/2.0/helpdesk/models.py"
click node_audit "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_audit/models.py"
click node_api "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_api/urls.py"
click node_biometric "https://github.com/ma7amdm2m/main-hr/blob/2.0/biometric/views.py"
click node_geofencing "https://github.com/ma7amdm2m/main-hr/blob/2.0/geofencing/views.py"
click node_ldap "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_ldap/views.py"
click node_middleware "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/horilla_middlewares.py"
click node_config "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/config.py"
click node_response "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/http/response.py"
click node_horilla_models "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/models.py"
click node_horilla_methods "https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/methods.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_web,node_generic_views,node_view_methods,node_kanban,node_view_models,node_base_models,node_base_methods,node_user toneBlue
class node_employee_models,node_attendance,node_leave,node_payroll,node_assets toneAmber
class node_recruitment,node_onboarding,node_offboarding toneMint
class node_helpdesk,node_audit,node_api toneRose
class node_biometric,node_geofencing,node_ldap,node_middleware,node_config,node_response,node_horilla_models,node_horilla_methods toneIndigo
```

## Components

### Web and shared core

- [Web entry](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/urls.py): `horilla/urls.py`
- [Generic views](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/generic/cbv/views.py): `horilla_views/generic/cbv/views.py`
- [View methods](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/cbv_methods.py): `horilla_views/cbv_methods.py`
- [Kanban views](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/generic/cbv/kanban.py): `horilla_views/generic/cbv/kanban.py`
- [View state](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_views/models.py): `horilla_views/models.py`
- [Shared HR records](https://github.com/ma7amdm2m/main-hr/blob/2.0/base/models.py): `base/models.py`
- [Shared HR methods](https://github.com/ma7amdm2m/main-hr/blob/2.0/base/methods.py): `base/methods.py`

### Workforce operations

- [Employee records](https://github.com/ma7amdm2m/main-hr/blob/2.0/employee/models.py): `employee/models.py`
- [Attendance tracking](https://github.com/ma7amdm2m/main-hr/blob/2.0/attendance/models.py): `attendance/models.py`
- [Leave management](https://github.com/ma7amdm2m/main-hr/blob/2.0/leave/models.py): `leave/models.py`
- [Payroll](https://github.com/ma7amdm2m/main-hr/blob/2.0/payroll/models/models.py): `payroll/models/models.py`
- [Asset management](https://github.com/ma7amdm2m/main-hr/blob/2.0/asset/models.py): `asset/models.py`

### Employee lifecycle

- [Recruitment](https://github.com/ma7amdm2m/main-hr/blob/2.0/recruitment/models.py): `recruitment/models.py`
- [Onboarding](https://github.com/ma7amdm2m/main-hr/blob/2.0/onboarding/models.py): `onboarding/models.py`
- [Offboarding](https://github.com/ma7amdm2m/main-hr/blob/2.0/offboarding/models.py): `offboarding/models.py`

### HR services

- [HR helpdesk](https://github.com/ma7amdm2m/main-hr/blob/2.0/helpdesk/models.py): `helpdesk/models.py`
- [Audit trail](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_audit/models.py): `horilla_audit/models.py`
- [API access](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_api/urls.py): `horilla_api/urls.py`

### Integrations and controls

- [Biometric devices](https://github.com/ma7amdm2m/main-hr/blob/2.0/biometric/views.py): `biometric/views.py`
- [Geofencing](https://github.com/ma7amdm2m/main-hr/blob/2.0/geofencing/views.py): `geofencing/views.py`
- [LDAP integration](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla_ldap/views.py): `horilla_ldap/views.py`
- [Request context](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/horilla_middlewares.py): `horilla/horilla_middlewares.py`
- [Application configuration](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/config.py): `horilla/config.py`
- [Safe responses](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/http/response.py): `horilla/http/response.py`
- [Shared platform models](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/models.py): `horilla/models.py`
- [Platform methods](https://github.com/ma7amdm2m/main-hr/blob/2.0/horilla/methods.py): `horilla/methods.py`

### Other components

- **HR user**

## Connections

- HR user → Web entry: uses (evidence: `README.md`)
- Web entry → API access: routes API
- Web entry → Generic views: routes views (evidence: `horilla_views/generic/cbv/views.py`)
- Generic views → View methods: uses methods (evidence: `horilla_views/generic/cbv/views.py`)
- Generic views → View state: reads view state (evidence: `horilla_views/generic/cbv/views.py`)
- Kanban views → View methods: uses methods (evidence: `horilla_views/generic/cbv/kanban.py`)
- View methods → Shared HR methods: uses methods (evidence: `horilla_views/cbv_methods.py`)
- View methods → Employee records: queries employees (evidence: `horilla_views/cbv_methods.py`)
- View state → Shared platform models: references models (evidence: `horilla_views/models.py`)
- Shared HR records → Employee records: references employees (evidence: `base/models.py`)
- Shared HR records → Shared platform models: references models (evidence: `base/models.py`)
- Shared HR records → Audit trail: references audit (evidence: `base/models.py`)
- Recruitment → Shared HR records: references HR records (evidence: `recruitment/models.py`)
- Recruitment → Employee records: references employees (evidence: `recruitment/models.py`)
- Recruitment → Audit trail: references audit (evidence: `recruitment/models.py`)
- Recruitment → Onboarding: references onboarding (evidence: `recruitment/models.py`)
- Request context → Safe responses: uses responses (evidence: `horilla/horilla_middlewares.py`)
- Biometric devices → Attendance tracking: supports tracking
- Geofencing → Attendance tracking: supports tracking
- LDAP integration → Employee records: integrates workforce
