# datarishavrathore/mlops-house-price architecture

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

- Interactive diagram: https://gitdiagram.com/datarishavrathore/mlops-house-price
- Repository: https://github.com/datarishavrathore/mlops-house-price

## Overview

This repository implements a house-price prediction workflow: clean raw CSV data, train and log a random-forest model, then serve predictions through a FastAPI application and static frontend. The sampled code supports the data and model flows shown below. The README is empty, and the frontend files and deployment wiring were not sampled, so their behavior and the model-artifact handoff to serving cannot be verified.

Main entry points: [`serve.py`](https://github.com/datarishavrathore/mlops-house-price/blob/main/serve.py) (Prediction API), [`data-clean-versioning.py`](https://github.com/datarishavrathore/mlops-house-price/blob/main/data-clean-versioning.py) (CSV cleaner), [`train.py`](https://github.com/datarishavrathore/mlops-house-price/blob/main/train.py) (Model trainer), [`static/index.html`](https://github.com/datarishavrathore/mlops-house-price/blob/main/static/index.html) (Static frontend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_rawcsv["Raw CSV"]
  node_cleaner["CSV cleaner"]
  node_s3data[("Processed data")]
end

subgraph group_training["Model training"]
  node_trainer["Model trainer<br/>[train.py]"]
  node_mlflow["MLflow tracking"]
  node_modelstore[("Model artifact store")]
end

subgraph group_serving["Prediction serving"]
  node_api["Prediction API<br/>[serve.py]"]
  node_modelloader["Model loader<br/>[serve.py]"]
  node_webui["Static frontend<br/>[index.html]"]
end

node_operator(("Data operator"))
node_user(("House seeker"))

node_operator -->|"runs cleaning"| node_cleaner
node_cleaner -->|"reads CSV"| node_rawcsv
node_cleaner -->|"uploads cleaned CSV"| node_s3data
node_s3data -->|"provides training data"| node_trainer
node_trainer -->|"logs metrics and model"| node_mlflow
node_mlflow -.->|"stores model artifact"| node_modelstore
node_modelstore -.->|"supplies configured model"| node_modelloader
node_user -->|"requests prediction"| node_api
node_api -->|"uses loaded model"| node_modelloader
node_api -->|"returns price"| node_user
node_api -->|"serves index"| node_webui

click node_cleaner "https://github.com/datarishavrathore/mlops-house-price/blob/main/data-clean-versioning.py"
click node_trainer "https://github.com/datarishavrathore/mlops-house-price/blob/main/train.py"
click node_api "https://github.com/datarishavrathore/mlops-house-price/blob/main/serve.py"
click node_modelloader "https://github.com/datarishavrathore/mlops-house-price/blob/main/serve.py"
click node_webui "https://github.com/datarishavrathore/mlops-house-price/blob/main/static/index.html"

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_rawcsv,node_cleaner,node_s3data toneBlue
class node_trainer,node_mlflow,node_modelstore toneAmber
class node_api,node_modelloader,node_webui toneMint
class node_operator,node_user toneIndigo
```

## Components

### Data preparation

- **Raw CSV**
- [CSV cleaner](https://github.com/datarishavrathore/mlops-house-price/blob/main/data-clean-versioning.py): `data-clean-versioning.py`
- **Processed data**

### Model training

- [Model trainer](https://github.com/datarishavrathore/mlops-house-price/blob/main/train.py): `train.py`
- **MLflow tracking**
- **Model artifact store**

### Prediction serving

- [Prediction API](https://github.com/datarishavrathore/mlops-house-price/blob/main/serve.py): `serve.py`
- [Model loader](https://github.com/datarishavrathore/mlops-house-price/blob/main/serve.py): `serve.py`
- [Static frontend](https://github.com/datarishavrathore/mlops-house-price/blob/main/static/index.html): `static/index.html`

### Other components

- **Data operator**
- **House seeker**

## Connections

- Data operator → CSV cleaner: runs cleaning (evidence: `data-clean-versioning.py`)
- CSV cleaner → Raw CSV: reads CSV (evidence: `data-clean-versioning.py`)
- CSV cleaner → Processed data: uploads cleaned CSV (evidence: `data-clean-versioning.py`)
- Processed data → Model trainer: provides training data (evidence: `train.py`)
- Model trainer → MLflow tracking: logs metrics and model (evidence: `train.py`)
- MLflow tracking → Model artifact store: stores model artifact
- Model artifact store → Model loader: supplies configured model
- House seeker → Prediction API: requests prediction (evidence: `serve.py`)
- Prediction API → Model loader: uses loaded model (evidence: `serve.py`)
- Prediction API → House seeker: returns price (evidence: `serve.py`)
- Prediction API → Static frontend: serves index (evidence: `serve.py`)
