How stefen-taime/car-price-predictor works
Car Price Predictor is a Streamlit application backed by a FastAPI car-record API, PostgreSQL, and an asynchronous Kafka/ML prediction loop. Users submit car details in the UI; the API validates and stores them, publishes listing events, and later receives prediction events to update records. The UI fetches records and presents metrics, filters, and charts. A separate training script builds and tracks the model from the Ford dataset; the prediction worker loads the model and preprocessing artifacts. The README documents the Debezium, Kafka, MLflow, and MinIO infrastructure; connections not visible in sampled source are identified as documented.
Main entry points: backend/main.py FastAPI service · docker-compose.yml Kafka topics · ml_service/main.py Prediction worker · app.py Streamlit app
Components 11
User Interface
- Streamlit app
streamlit_app/app.py
API and Data
- FastAPI service
backend/main.py - PostgreSQL
postgres/init.sql
Prediction Pipeline
- Debezium
debezium-connector-config.json - Kafka topics
docker-compose.yml - Prediction worker
ml_service/main.py
Model Management
- Model training
ml_service/train.py - Ford dataset
data/ford.csv - MLflow tracking
mlflow/Dockerfile - Artifact storage
docker-compose.yml
Other components
- Car user
Connections 14
- Car user → Streamlit app: enters car data
README.md - Streamlit app → FastAPI service: fetches and submits
streamlit_app/app.py - FastAPI service → PostgreSQL: reads and writes cars
backend/main.py - FastAPI service → Kafka topics: publishes listings
backend/main.py - PostgreSQL → Debezium: streams changes
README.md - Debezium → Kafka topics: publishes changes
README.md - Kafka topics → Prediction worker: delivers listing events
ml_service/main.py - Prediction worker → MLflow tracking: loads tracked model
ml_service/main.py - Prediction worker → Kafka topics: publishes predictions
ml_service/main.py - Kafka topics → FastAPI service: delivers predictions
backend/main.py - Model training → Ford dataset: reads training data
ml_service/train.py - Model training → MLflow tracking: logs model and metrics
ml_service/train.py - MLflow tracking → Artifact storage: stores artifacts
README.md - FastAPI service → Streamlit app: returns car records
streamlit_app/app.py