# luyerjcpro/deploiement_mlops architecture

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

- Interactive diagram: https://gitdiagram.com/luyerjcpro/deploiement_mlops
- Repository: https://github.com/luyerjcpro/deploiement_mlops

## Overview

This repository implements an employee-attrition prediction service: employee records are stored in PostgreSQL, an API retrieves them and serves predictions from a serialized classifier, and results are persisted for later production evaluation. The main runtime path and training pipeline are supported by source excerpts. The README is empty, and the data-loading and preprocessing modules were not excerpted, so their roles and links are shown only where source-index references support them; the production evaluation script documents its database query directly.

Main entry points: [`api/main.py`](https://github.com/luyerjcpro/deploiement_mlops/blob/main/api/main.py) (FastAPI routes), [`models/pipeline.py`](https://github.com/luyerjcpro/deploiement_mlops/blob/main/models/pipeline.py) (Training pipeline), [`src/evaluer_production.py`](https://github.com/luyerjcpro/deploiement_mlops/blob/main/src/evaluer_production.py) (Production evaluation), [`database/connexion_db.py`](https://github.com/luyerjcpro/deploiement_mlops/blob/main/database/connexion_db.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_model["Data and training"]
  node_model_artifact["Trained model<br/>[modele.joblib]"]
  node_training["Training pipeline<br/>[pipeline.py]"]
  node_feature_engineering["Feature engineering"]
  node_raw_loader["Raw data loading<br/>[load_clean_data.py]"]
  node_feature_loader["Feature data loading"]
end

subgraph group_serving["Prediction service"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_schemas["Employee schemas<br/>[schemas.py]"]
  node_security["API key check<br/>[security.py]"]
end

subgraph group_persistence["Persistence"]
  node_database_session["Database sessions<br/>[connexion_db.py]"]
  node_employee_records[("Employees<br/>[models_tables.py]")]
  node_prediction_records[("Predictions<br/>[models_tables.py]")]
end

subgraph group_evaluation["Production evaluation"]
  node_evaluation["Production evaluation"]
  node_validation_data["Validation data"]
end

node_employee_user(("API client"))
node_postgres[("PostgreSQL")]

node_employee_user -->|"requests"| node_api
node_api -->|"checks key"| node_security
node_api -->|"validates profile"| node_schemas
node_api -->|"gets session"| node_database_session
node_api -->|"reads employee"| node_employee_records
node_api -->|"loads model"| node_model_artifact
node_api -->|"writes result"| node_prediction_records
node_training -.->|"references features"| node_feature_engineering
node_training -->|"serializes model"| node_model_artifact
node_raw_loader -.->|"prepares features"| node_feature_loader
node_database_session -->|"connects"| node_postgres
node_employee_records -.->|"stores employees"| node_postgres
node_prediction_records -.->|"stores predictions"| node_postgres
node_evaluation -->|"queries predictions"| node_postgres
node_evaluation -->|"reads truth"| node_validation_data

click node_api "https://github.com/luyerjcpro/deploiement_mlops/blob/main/api/main.py"
click node_schemas "https://github.com/luyerjcpro/deploiement_mlops/blob/main/api/schemas.py"
click node_security "https://github.com/luyerjcpro/deploiement_mlops/blob/main/api/security.py"
click node_model_artifact "https://github.com/luyerjcpro/deploiement_mlops/blob/main/models/modele.joblib"
click node_training "https://github.com/luyerjcpro/deploiement_mlops/blob/main/models/pipeline.py"
click node_feature_engineering "https://github.com/luyerjcpro/deploiement_mlops/blob/main/data/feature_engineering.py"
click node_raw_loader "https://github.com/luyerjcpro/deploiement_mlops/blob/main/data/load_clean_data.py"
click node_feature_loader "https://github.com/luyerjcpro/deploiement_mlops/blob/main/data/load_clean_fe_data.py"
click node_database_session "https://github.com/luyerjcpro/deploiement_mlops/blob/main/database/connexion_db.py"
click node_employee_records "https://github.com/luyerjcpro/deploiement_mlops/blob/main/database/models_tables.py"
click node_prediction_records "https://github.com/luyerjcpro/deploiement_mlops/blob/main/database/models_tables.py"
click node_evaluation "https://github.com/luyerjcpro/deploiement_mlops/blob/main/src/evaluer_production.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_model_artifact,node_training,node_feature_engineering,node_raw_loader,node_feature_loader,node_employee_user toneBlue
class node_api,node_schemas,node_security,node_postgres toneAmber
class node_database_session,node_employee_records,node_prediction_records toneMint
class node_evaluation,node_validation_data toneRose
```

## Components

### Data and training

- [Trained model](https://github.com/luyerjcpro/deploiement_mlops/blob/main/models/modele.joblib): `models/modele.joblib`
- [Training pipeline](https://github.com/luyerjcpro/deploiement_mlops/blob/main/models/pipeline.py): `models/pipeline.py`
- [Feature engineering](https://github.com/luyerjcpro/deploiement_mlops/blob/main/data/feature_engineering.py): `data/feature_engineering.py`
- [Raw data loading](https://github.com/luyerjcpro/deploiement_mlops/blob/main/data/load_clean_data.py): `data/load_clean_data.py`
- [Feature data loading](https://github.com/luyerjcpro/deploiement_mlops/blob/main/data/load_clean_fe_data.py): `data/load_clean_fe_data.py`

### Prediction service

- [FastAPI routes](https://github.com/luyerjcpro/deploiement_mlops/blob/main/api/main.py): `api/main.py`
- [Employee schemas](https://github.com/luyerjcpro/deploiement_mlops/blob/main/api/schemas.py): `api/schemas.py`
- [API key check](https://github.com/luyerjcpro/deploiement_mlops/blob/main/api/security.py): `api/security.py`

### Persistence

- [Database sessions](https://github.com/luyerjcpro/deploiement_mlops/blob/main/database/connexion_db.py): `database/connexion_db.py`
- [Employees](https://github.com/luyerjcpro/deploiement_mlops/blob/main/database/models_tables.py): `database/models_tables.py`
- [Predictions](https://github.com/luyerjcpro/deploiement_mlops/blob/main/database/models_tables.py): `database/models_tables.py`

### Production evaluation

- [Production evaluation](https://github.com/luyerjcpro/deploiement_mlops/blob/main/src/evaluer_production.py): `src/evaluer_production.py`
- **Validation data**

### Other components

- **API client**
- **PostgreSQL**

## Connections

- API client → FastAPI routes: requests (evidence: `api/main.py`)
- FastAPI routes → API key check: checks key (evidence: `api/main.py`)
- FastAPI routes → Employee schemas: validates profile (evidence: `api/main.py`)
- FastAPI routes → Database sessions: gets session (evidence: `api/main.py`)
- FastAPI routes → Employees: reads employee (evidence: `api/main.py`)
- FastAPI routes → Trained model: loads model (evidence: `api/main.py`)
- FastAPI routes → Predictions: writes result (evidence: `api/main.py`)
- Training pipeline → Feature engineering: references features
- Training pipeline → Trained model: serializes model (evidence: `models/pipeline.py`)
- Raw data loading → Feature data loading: prepares features
- Database sessions → PostgreSQL: connects (evidence: `database/connexion_db.py`)
- Employees → PostgreSQL: stores employees
- Predictions → PostgreSQL: stores predictions
- Production evaluation → PostgreSQL: queries predictions (evidence: `src/evaluer_production.py`)
- Production evaluation → Validation data: reads truth (evidence: `src/evaluer_production.py`)
