# an15cg0618sh/employee_attrition_plus architecture

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

- Interactive diagram: https://gitdiagram.com/an15cg0618sh/employee_attrition_plus
- Repository: https://github.com/an15cg0618sh/employee_attrition_plus

## Overview

Employee Attrition Plus is an educational workforce-analytics dashboard for exploring attrition patterns, training and comparing models, predicting, explaining model outputs, and monitoring drift. Users work through a React interface backed by FastAPI: upload or use workforce data, validate and explore it, train and evaluate models, then inspect predictions, explanations, analytics, and monitoring status. Backend stages and dashboard views are represented separately. The README documents the major capabilities; several backend connections are documented at workflow level because the available API excerpt is partial.

Main entry points: [`api.py`](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/api.py) (FastAPI service), [`frontend/src/App.tsx`](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/frontend/src/App.tsx) (Dashboard shell), [`frontend/src/pages`](https://github.com/an15cg0618sh/employee_attrition_plus/tree/main/frontend/src/pages) (Dashboard views), [`src/data_ingestion.py`](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/data_ingestion.py) (CSV ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard experience"]
  node_app["Dashboard shell<br/>[App.tsx]"]
  node_pages["Dashboard views"]
  node_api_client["API client<br/>[client.ts]"]
  node_ui["UI components<br/>[ui.tsx]"]
end

subgraph group_data["Data and analytics"]
  node_ingestion["CSV ingestion<br/>[data_ingestion.py]"]
  node_schema["Schema validation"]
  node_exploration["Dataset exploration"]
  node_workforce["Workforce analytics"]
end

subgraph group_modeling["Model lifecycle"]
  node_preprocessing["Feature preprocessing"]
  node_training["Model training<br/>[model_training.py]"]
  node_evaluation["Model evaluation"]
  node_optimization["Hyperparameter tuning<br/>[optimization.py]"]
  node_comparison["Model comparison"]
  node_explainability["Model explainability<br/>[explainability.py]"]
end

subgraph group_trust["Trust and monitoring"]
  node_monitoring["Drift monitoring"]
  node_artifacts[("Model artifacts")]
  node_reporting["Reports and documentation<br/>[reporting.py]"]
end

subgraph group_service["API and artifacts"]
  node_fastapi["FastAPI service<br/>[api.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_user(("Workforce analyst"))

node_user -->|"uses"| node_app
node_app -->|"requests data"| node_api_client
node_app -->|"renders views"| node_pages
node_pages -->|"requests data"| node_api_client
node_pages -->|"renders controls"| node_ui
node_api_client -->|"HTTP requests"| node_fastapi
node_fastapi -->|"loads datasets"| node_ingestion
node_ingestion -->|"validates dataset"| node_schema
node_schema -->|"enables exploration"| node_exploration
node_schema -->|"enables analytics"| node_workforce
node_fastapi -->|"serves explorer"| node_exploration
node_fastapi -->|"serves analytics"| node_workforce
node_fastapi -->|"prepares training"| node_preprocessing
node_fastapi -->|"starts training"| node_training
node_training -->|"evaluates model"| node_evaluation
node_fastapi -->|"starts tuning"| node_optimization
node_fastapi -->|"serves comparison"| node_comparison
node_fastapi -->|"serves explanations"| node_explainability
node_fastapi -->|"runs monitoring"| node_monitoring
node_monitoring -->|"stores history"| node_artifacts
node_fastapi -.->|"loads protected models"| node_artifacts
node_training -.->|"saves protected models"| node_artifacts
node_fastapi -->|"serves reports"| node_reporting
node_ingestion -->|"uses data path"| node_config
node_monitoring -->|"uses thresholds"| node_config

click node_app "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/frontend/src/App.tsx"
click node_pages "https://github.com/an15cg0618sh/employee_attrition_plus/tree/main/frontend/src/pages"
click node_api_client "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/frontend/src/api/client.ts"
click node_ui "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/frontend/src/components/ui.tsx"
click node_fastapi "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/api.py"
click node_ingestion "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/data_ingestion.py"
click node_schema "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/schema_validation.py"
click node_exploration "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/exploratory_analysis.py"
click node_workforce "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/workforce_analytics.py"
click node_preprocessing "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/data_preprocessing.py"
click node_training "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_training.py"
click node_evaluation "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_evaluation.py"
click node_optimization "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/optimization.py"
click node_comparison "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_comparison.py"
click node_explainability "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/explainability.py"
click node_monitoring "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_monitoring.py"
click node_artifacts "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/artifact_manager.py"
click node_reporting "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/reporting.py"
click node_config "https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/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_app,node_pages,node_api_client,node_ui toneBlue
class node_ingestion,node_schema,node_exploration,node_workforce toneAmber
class node_preprocessing,node_training,node_evaluation,node_optimization,node_comparison,node_explainability toneMint
class node_monitoring,node_artifacts,node_reporting toneRose
class node_fastapi,node_config,node_user toneIndigo
```

## Components

### Dashboard experience

- [Dashboard shell](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard views](https://github.com/an15cg0618sh/employee_attrition_plus/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [UI components](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/frontend/src/components/ui.tsx): `frontend/src/components/ui.tsx`

### Data and analytics

- [CSV ingestion](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/data_ingestion.py): `src/data_ingestion.py`
- [Schema validation](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/schema_validation.py): `src/schema_validation.py`
- [Dataset exploration](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/exploratory_analysis.py): `src/exploratory_analysis.py`
- [Workforce analytics](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/workforce_analytics.py): `src/workforce_analytics.py`

### Model lifecycle

- [Feature preprocessing](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Model training](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_training.py): `src/model_training.py`
- [Model evaluation](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_evaluation.py): `src/model_evaluation.py`
- [Hyperparameter tuning](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/optimization.py): `src/optimization.py`
- [Model comparison](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_comparison.py): `src/model_comparison.py`
- [Model explainability](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/explainability.py): `src/explainability.py`

### Trust and monitoring

- [Drift monitoring](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/model_monitoring.py): `src/model_monitoring.py`
- [Model artifacts](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/artifact_manager.py): `src/artifact_manager.py`
- [Reports and documentation](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/reporting.py): `src/reporting.py`

### API and artifacts

- [FastAPI service](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/api.py): `api.py`
- [Runtime configuration](https://github.com/an15cg0618sh/employee_attrition_plus/blob/main/src/config.py): `src/config.py`

### Other components

- **Workforce analyst**

## Connections

- Workforce analyst → Dashboard shell: uses (evidence: `README.md`)
- Dashboard shell → API client: requests data (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Dashboard views: renders views (evidence: `frontend/src/App.tsx`)
- Dashboard views → API client: requests data (evidence: `frontend/src/pages/OverviewPage.tsx`)
- Dashboard views → UI components: renders controls (evidence: `frontend/src/pages/OverviewPage.tsx`)
- API client → FastAPI service: HTTP requests (evidence: `frontend/src/api/client.ts`)
- FastAPI service → CSV ingestion: loads datasets (evidence: `api.py`)
- CSV ingestion → Schema validation: validates dataset (evidence: `README.md`)
- Schema validation → Dataset exploration: enables exploration (evidence: `README.md`)
- Schema validation → Workforce analytics: enables analytics (evidence: `README.md`)
- FastAPI service → Dataset exploration: serves explorer (evidence: `api.py`)
- FastAPI service → Workforce analytics: serves analytics (evidence: `api.py`)
- FastAPI service → Feature preprocessing: prepares training (evidence: `README.md`)
- FastAPI service → Model training: starts training (evidence: `README.md`)
- Model training → Model evaluation: evaluates model (evidence: `src/model_training.py`)
- FastAPI service → Hyperparameter tuning: starts tuning (evidence: `api.py`)
- FastAPI service → Model comparison: serves comparison (evidence: `api.py`)
- FastAPI service → Model explainability: serves explanations (evidence: `api.py`)
- FastAPI service → Drift monitoring: runs monitoring (evidence: `README.md`)
- Drift monitoring → Model artifacts: stores history
- FastAPI service → Model artifacts: loads protected models (evidence: `api.py`)
- Model training → Model artifacts: saves protected models (evidence: `src/artifact_manager.py`)
- FastAPI service → Reports and documentation: serves reports (evidence: `api.py`)
- CSV ingestion → Runtime configuration: uses data path (evidence: `src/data_ingestion.py`)
- Drift monitoring → Runtime configuration: uses thresholds (evidence: `src/model_monitoring.py`)
