How tcheunzy/projet_5_openclassrooms works
Futurisys’ product is a FastAPI service that accepts employee HR data, validates and authenticates prediction requests, returns a turnover-risk result, and records employee state plus a prediction history in PostgreSQL. The central flow is explicit in the API handler; the README also documents unauthenticated monitoring endpoints and historical employee-data import. Model and metadata loading are shown in the prediction module. The database is intended for local use; deployment and CI details are outside this runtime map.
Main entry points: main.py FastAPI service · insert_dataset.py Historical employee import · connection.py DB session provider · models_db.py Employee and prediction models
Components 11
API boundary
- FastAPI service
api/main.py - Request and response schemas
api/schemas.py - API-key verification
api/security.py
Prediction
- Turnover predictor
src/predict.py - Model artifacts
models
Persistence
- DB session provider
database/connection.py - Employee and prediction models
database/models_db.py
Historical data
- Historical employee import
database/insert_dataset.py - Historical dataset
data/processed/dataset_complet_historique.csv
Other components
- HR client
- PostgreSQL
Connections 12
- HR client → FastAPI service: submits request
README.md - FastAPI service → Request and response schemas: validates request
api/main.py - FastAPI service → API-key verification: verifies key
api/main.py - FastAPI service → Turnover predictor: requests prediction
api/main.py - Turnover predictor → Model artifacts: loads model and metadata
src/predict.py - FastAPI service → DB session provider: requests session
api/main.py - FastAPI service → Employee and prediction models: queries and records
api/main.py - DB session provider → PostgreSQL: connects
database/connection.py - Employee and prediction models → PostgreSQL: maps tables
database/models_db.py - Historical employee import → Historical dataset: reads
database/insert_dataset.py - Historical employee import → DB session provider: opens session
database/insert_dataset.py - Historical employee import → Employee and prediction models: inserts employees
database/insert_dataset.py