# abhijeetb0/car-price-ml-app architecture

> Architecture diagram of the GitHub repository abhijeetb0/car-price-ml-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhijeetb0/car-price-ml-app
- Repository: https://github.com/abhijeetb0/car-price-ml-app

## Overview

This is a used-car resale-price prediction application. A user enters vehicle details in the React form; the frontend posts them to FastAPI, which runs the loaded scikit-learn pipeline and returns an INR estimate for display. Separately, the training script reads the CSV, prepares features, compares model/target configurations, and saves the selected model. The README documents Vercel and Render deployment. The referenced model artifact is not present in the supplied tree, so its runtime link is shown but its contents cannot be verified.

Main entry points: [`backend/train.py`](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py) (Training experiments), [`backend/main.py`](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/main.py) (FastAPI endpoints), [`frontend/src/App.jsx`](https://github.com/abhijeetb0/car-price-ml-app/blob/main/frontend/src/App.jsx) (Prediction form), [`frontend/src/main.jsx`](https://github.com/abhijeetb0/car-price-ml-app/blob/main/frontend/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_app["Prediction form<br/>[App.jsx]"]
  node_frontend_entry["React entry<br/>[main.jsx]"]
end

subgraph group_serving["API serving"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_request["Car input schema<br/>[main.py]"]
  node_inference["Loaded ML pipeline<br/>[main.py]"]
end

subgraph group_ml["Model lifecycle"]
  node_artifact["Trained model artifact"]
  node_dataset[("Used-car dataset<br/>[car_data.csv]")]
  node_training["Training experiments<br/>[train.py]"]
  node_clean_split["Clean and split<br/>[train.py]"]
  node_features["Feature engineering<br/>[train.py]"]
  node_encoding["Categorical encoding<br/>[train.py]"]
  node_regression["Regressor experiments<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[train.py]"]
end

subgraph group_hosting["Hosting"]
  node_vercel["Vercel frontend"]
  node_render["Render backend"]
end

node_user(("Car buyer"))

node_frontend_entry -->|"renders"| node_app
node_user -->|"enters details"| node_app
node_app -->|"POST /predict"| node_api
node_api -->|"validates"| node_request
node_api -->|"predicts with"| node_inference
node_inference -->|"loads"| node_artifact
node_api -->|"returns estimate"| node_app
node_training -->|"reads"| node_dataset
node_training -->|"cleans and splits"| node_clean_split
node_training -->|"fits pipeline"| node_features
node_features -->|"transforms features"| node_encoding
node_training -->|"trains candidates"| node_regression
node_training -->|"scores candidates"| node_evaluation
node_training -->|"saves selected model"| node_artifact
node_vercel -.->|"serves"| node_app
node_render -.->|"hosts"| node_api

click node_app "https://github.com/abhijeetb0/car-price-ml-app/blob/main/frontend/src/App.jsx"
click node_frontend_entry "https://github.com/abhijeetb0/car-price-ml-app/blob/main/frontend/src/main.jsx"
click node_api "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/main.py"
click node_request "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/main.py"
click node_inference "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/main.py"
click node_dataset "https://github.com/abhijeetb0/car-price-ml-app/blob/main/data/raw/car_data.csv"
click node_training "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py"
click node_clean_split "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py"
click node_features "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py"
click node_encoding "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py"
click node_regression "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py"
click node_evaluation "https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.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_frontend_entry toneBlue
class node_api,node_request,node_inference toneAmber
class node_artifact,node_dataset,node_training,node_clean_split,node_features,node_encoding,node_regression,node_evaluation toneMint
class node_vercel,node_render toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Prediction form](https://github.com/abhijeetb0/car-price-ml-app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [React entry](https://github.com/abhijeetb0/car-price-ml-app/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### API serving

- [FastAPI endpoints](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/main.py): `backend/main.py`
- [Car input schema](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/main.py): `backend/main.py`
- [Loaded ML pipeline](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/main.py): `backend/main.py`

### Model lifecycle

- **Trained model artifact**
- [Used-car dataset](https://github.com/abhijeetb0/car-price-ml-app/blob/main/data/raw/car_data.csv): `data/raw/car_data.csv`
- [Training experiments](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py): `backend/train.py`
- [Clean and split](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py): `backend/train.py`
- [Feature engineering](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py): `backend/train.py`
- [Categorical encoding](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py): `backend/train.py`
- [Regressor experiments](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py): `backend/train.py`
- [Model evaluation](https://github.com/abhijeetb0/car-price-ml-app/blob/main/backend/train.py): `backend/train.py`

### Hosting

- **Vercel frontend**
- **Render backend**

### Other components

- **Car buyer**

## Connections

- React entry → Prediction form: renders
- Car buyer → Prediction form: enters details
- Prediction form → FastAPI endpoints: POST /predict
- FastAPI endpoints → Car input schema: validates
- FastAPI endpoints → Loaded ML pipeline: predicts with
- Loaded ML pipeline → Trained model artifact: loads
- FastAPI endpoints → Prediction form: returns estimate
- Training experiments → Used-car dataset: reads
- Training experiments → Clean and split: cleans and splits
- Training experiments → Feature engineering: fits pipeline
- Feature engineering → Categorical encoding: transforms features
- Training experiments → Regressor experiments: trains candidates
- Training experiments → Model evaluation: scores candidates
- Training experiments → Trained model artifact: saves selected model
- Vercel frontend → Prediction form: serves
- Render backend → FastAPI endpoints: hosts
