# fatimazahra-marghich/ijaza-leave-management architecture

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

- Interactive diagram: https://gitdiagram.com/fatimazahra-marghich/ijaza-leave-management
- Repository: https://github.com/fatimazahra-marghich/ijaza-leave-management

## Overview

Ijaza is a role-based leave-management application for a Moroccan public administration. Employees submit and track leave requests; service heads review them, then HR performs final review and manages balances, planning, and reports. Administrators maintain staff, organizational structure, holidays, and leave types. The React application routes users by role and calls a Django REST backend, whose leave, user, and organization modules implement domain operations and persistence. The README documents capabilities beyond the sampled excerpts; some frontend-to-API and backend routing links are therefore shown as unverified.

Main entry points: [`ijaza-frontend/ijaza-frontend/src/App.jsx`](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/App.jsx) (Role-based routes), [`ijaza-frontend/ijaza-frontend/src/api/axios.js`](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/api/axios.js) (API client), [`backend/conges/models.py`](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/models.py) (Leave records), [`backend/conges/views.py`](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/views.py) (Leave API operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Role-based routes<br/>[App.jsx]"]
  node_auth["Authentication<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[axios.js]"]
  node_employee["Employee requests<br/>[NewRequest.jsx]"]
  node_chef["Service-head review<br/>[DashboardChef.jsx]"]
  node_hr["HR operations"]
  node_admin["Administration"]
  node_layout["Application layout<br/>[MainLayout.jsx]"]
end

subgraph group_leave["Leave management"]
  node_leave_views["Leave API operations<br/>[views.py]"]
  node_leave_serializers["Leave data serialization<br/>[serializers.py]"]
  node_leave_rules["Leave calculations<br/>[utils.py]"]
  node_leave_data[("Leave records<br/>[models.py]")]
  node_annual_balances["Annual balance rollover<br/>[tasks.py]"]
end

subgraph group_workforce["Workforce administration"]
  node_users_views["User API operations<br/>[views.py]"]
  node_users_serializers["User data serialization<br/>[serializers.py]"]
  node_users_data[("User records<br/>[models.py]")]
  node_org_views["Organization API<br/>[views.py]"]
  node_org_serializers["Organization serialization<br/>[serializers.py]"]
  node_org_data[("Organization records<br/>[models.py]")]
end

subgraph group_platform["Backend platform"]
  node_backend["Django REST service<br/>[urls.py]"]
  node_postgres[("PostgreSQL")]
end

node_user(("Application user"))

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes to"| node_employee
node_app -->|"routes to"| node_chef
node_app -->|"routes to"| node_hr
node_app -->|"routes to"| node_admin
node_auth -->|"submits login"| node_api
node_employee -->|"calls"| node_api
node_chef -->|"calls"| node_api
node_admin -.->|"calls"| node_api
node_hr -.->|"calls"| node_api
node_employee -->|"renders in"| node_layout
node_chef -->|"renders in"| node_layout
node_api -.->|"sends requests"| node_backend
node_backend -.->|"routes to"| node_leave_views
node_leave_views -->|"uses"| node_leave_serializers
node_leave_views -->|"uses"| node_leave_rules
node_leave_views -->|"queries"| node_leave_data
node_leave_serializers -->|"serializes"| node_leave_data
node_annual_balances -->|"updates balances"| node_leave_data
node_backend -.->|"routes to"| node_users_views
node_users_views -->|"uses"| node_users_serializers
node_users_serializers -->|"serializes"| node_users_data
node_users_serializers -->|"reads balances"| node_leave_data
node_backend -.->|"routes to"| node_org_views
node_org_views -->|"uses"| node_org_serializers
node_org_serializers -->|"serializes"| node_org_data
node_leave_data -.->|"stored in"| node_postgres
node_users_data -.->|"stored in"| node_postgres
node_org_data -.->|"stored in"| node_postgres

click node_app "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/App.jsx"
click node_auth "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/context/AuthContext.jsx"
click node_api "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/api/axios.js"
click node_employee "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/pages/employe/NewRequest.jsx"
click node_chef "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/pages/chef/DashboardChef.jsx"
click node_hr "https://github.com/fatimazahra-marghich/ijaza-leave-management/tree/main/ijaza-frontend/ijaza-frontend/src/pages/rh"
click node_admin "https://github.com/fatimazahra-marghich/ijaza-leave-management/tree/main/ijaza-frontend/ijaza-frontend/src/pages/admin"
click node_layout "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/components/MainLayout.jsx"
click node_leave_views "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/views.py"
click node_leave_serializers "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/serializers.py"
click node_leave_rules "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/utils.py"
click node_leave_data "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/models.py"
click node_annual_balances "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/tasks.py"
click node_users_views "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/users/views.py"
click node_users_serializers "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/users/serializers.py"
click node_users_data "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/users/models.py"
click node_org_views "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/organisation/views.py"
click node_org_serializers "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/organisation/serializers.py"
click node_org_data "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/organisation/models.py"
click node_backend "https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/config/urls.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_app,node_auth,node_api,node_employee,node_chef,node_hr,node_admin,node_layout,node_user toneBlue
class node_leave_views,node_leave_serializers,node_leave_rules,node_leave_data,node_annual_balances toneAmber
class node_users_views,node_users_serializers,node_users_data,node_org_views,node_org_serializers,node_org_data toneMint
class node_backend,node_postgres toneRose
```

## Components

### Web application

- [Role-based routes](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/App.jsx): `ijaza-frontend/ijaza-frontend/src/App.jsx`
- [Authentication](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/context/AuthContext.jsx): `ijaza-frontend/ijaza-frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/api/axios.js): `ijaza-frontend/ijaza-frontend/src/api/axios.js`
- [Employee requests](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/pages/employe/NewRequest.jsx): `ijaza-frontend/ijaza-frontend/src/pages/employe/NewRequest.jsx`
- [Service-head review](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/pages/chef/DashboardChef.jsx): `ijaza-frontend/ijaza-frontend/src/pages/chef/DashboardChef.jsx`
- [HR operations](https://github.com/fatimazahra-marghich/ijaza-leave-management/tree/main/ijaza-frontend/ijaza-frontend/src/pages/rh): `ijaza-frontend/ijaza-frontend/src/pages/rh`
- [Administration](https://github.com/fatimazahra-marghich/ijaza-leave-management/tree/main/ijaza-frontend/ijaza-frontend/src/pages/admin): `ijaza-frontend/ijaza-frontend/src/pages/admin`
- [Application layout](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/ijaza-frontend/ijaza-frontend/src/components/MainLayout.jsx): `ijaza-frontend/ijaza-frontend/src/components/MainLayout.jsx`

### Leave management

- [Leave API operations](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/views.py): `backend/conges/views.py`
- [Leave data serialization](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/serializers.py): `backend/conges/serializers.py`
- [Leave calculations](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/utils.py): `backend/conges/utils.py`
- [Leave records](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/models.py): `backend/conges/models.py`
- [Annual balance rollover](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/conges/tasks.py): `backend/conges/tasks.py`

### Workforce administration

- [User API operations](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/users/views.py): `backend/users/views.py`
- [User data serialization](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/users/serializers.py): `backend/users/serializers.py`
- [User records](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/users/models.py): `backend/users/models.py`
- [Organization API](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/organisation/views.py): `backend/organisation/views.py`
- [Organization serialization](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/organisation/serializers.py): `backend/organisation/serializers.py`
- [Organization records](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/organisation/models.py): `backend/organisation/models.py`

### Backend platform

- [Django REST service](https://github.com/fatimazahra-marghich/ijaza-leave-management/blob/main/backend/config/urls.py): `backend/config/urls.py`
- **PostgreSQL**

### Other components

- **Application user**

## Connections

- Application user → Role-based routes: uses (evidence: `ijaza-frontend/ijaza-frontend/src/App.jsx`)
- Role-based routes → Authentication: provides auth (evidence: `ijaza-frontend/ijaza-frontend/src/App.jsx`)
- Role-based routes → Employee requests: routes to (evidence: `ijaza-frontend/ijaza-frontend/src/App.jsx`)
- Role-based routes → Service-head review: routes to (evidence: `ijaza-frontend/ijaza-frontend/src/App.jsx`)
- Role-based routes → HR operations: routes to (evidence: `ijaza-frontend/ijaza-frontend/src/App.jsx`)
- Role-based routes → Administration: routes to (evidence: `ijaza-frontend/ijaza-frontend/src/App.jsx`)
- Authentication → API client: submits login (evidence: `ijaza-frontend/ijaza-frontend/src/context/AuthContext.jsx`)
- Employee requests → API client: calls (evidence: `ijaza-frontend/ijaza-frontend/src/pages/employe/NewRequest.jsx`)
- Service-head review → API client: calls (evidence: `ijaza-frontend/ijaza-frontend/src/pages/chef/DashboardChef.jsx`)
- Administration → API client: calls (evidence: `ijaza-frontend/ijaza-frontend/src/pages/admin/JourFeriePage.jsx`)
- HR operations → API client: calls (evidence: `ijaza-frontend/ijaza-frontend/src/pages/rh/DashboardRH.jsx`)
- Employee requests → Application layout: renders in (evidence: `ijaza-frontend/ijaza-frontend/src/pages/employe/NewRequest.jsx`)
- Service-head review → Application layout: renders in (evidence: `ijaza-frontend/ijaza-frontend/src/pages/chef/DashboardChef.jsx`)
- API client → Django REST service: sends requests
- Django REST service → Leave API operations: routes to
- Leave API operations → Leave data serialization: uses (evidence: `backend/conges/views.py`)
- Leave API operations → Leave calculations: uses (evidence: `backend/conges/views.py`)
- Leave API operations → Leave records: queries (evidence: `backend/conges/views.py`)
- Leave data serialization → Leave records: serializes (evidence: `backend/conges/serializers.py`)
- Annual balance rollover → Leave records: updates balances (evidence: `backend/conges/tasks.py`)
- Django REST service → User API operations: routes to
- User API operations → User data serialization: uses (evidence: `backend/users/views.py`)
- User data serialization → User records: serializes (evidence: `backend/users/serializers.py`)
- User data serialization → Leave records: reads balances (evidence: `backend/users/serializers.py`)
- Django REST service → Organization API: routes to
- Organization API → Organization serialization: uses (evidence: `backend/organisation/views.py`)
- Organization serialization → Organization records: serializes (evidence: `backend/organisation/serializers.py`)
- Leave records → PostgreSQL: stored in
- User records → PostgreSQL: stored in
- Organization records → PostgreSQL: stored in
