# srimanikanta2006/resale-wale architecture

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

- Interactive diagram: https://gitdiagram.com/srimanikanta2006/resale-wale
- Repository: https://github.com/srimanikanta2006/resale-wale

## Overview

Resale Wale is a used-car price valuation product backed by a trained LightGBM pipeline. Its principal workflow takes eight vehicle inputs through the web interface and REST API, normalizes and scores them, then returns a price estimate with valuation intervals and supporting advice. Offline capabilities cover synthetic benchmark-data generation, model training and statistical evaluation; the live product also exposes comparable listings and model metrics. The API and prediction excerpts show the inference handoff; some UI-to-API wiring and unsampled subsystem details remain unverified.

Main entry points: [`src/train.py`](https://github.com/srimanikanta2006/resale-wale/blob/main/src/train.py) (Model Training), [`src/api_server.py`](https://github.com/srimanikanta2006/resale-wale/blob/main/src/api_server.py) (REST API), [`src/predict.py`](https://github.com/srimanikanta2006/resale-wale/blob/main/src/predict.py) (Valuation Engine), [`data/used_cars_marketplace.csv`](https://github.com/srimanikanta2006/resale-wale/blob/main/data/used_cars_marketplace.csv) (Marketplace Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and Analysis"]
  node_generator["Dataset Generator"]
  node_marketdata["Marketplace Records"]
  node_eda["Exploratory Analysis<br/>[eda_analysis.py]"]
end

subgraph group_model["Model Lifecycle"]
  node_features["Feature Engineering"]
  node_trainer["Model Training<br/>[train.py]"]
  node_evaluator["Model Evaluation<br/>[evaluate.py]"]
  node_modelartifact["Valuation Pipeline"]
  node_metrics["Model Metrics<br/>[metrics.json]"]
end

subgraph group_serving["Valuation Service"]
  node_api["REST API<br/>[api_server.py]"]
  node_engine["Valuation Engine<br/>[predict.py]"]
  node_estimate["Valuation Results"]
  node_comps["Comparable Listings<br/>[api_server.py]"]
  node_metricsapi["Metrics Endpoint<br/>[api_server.py]"]
end

subgraph group_product["Web Product"]
  node_web["Web Interface<br/>[index.html]"]
end

node_user(("Valuation User"))

node_user -->|"enters vehicle details"| node_web
node_web -.->|"requests valuation"| node_api
node_api -->|"calls prediction"| node_engine
node_engine -->|"loads pipeline"| node_modelartifact
node_engine -->|"imports mappings"| node_features
node_engine -->|"produces price and advice"| node_estimate
node_api -->|"returns valuation response"| node_estimate
node_api -->|"serves comparisons"| node_comps
node_api -->|"serves metrics"| node_metricsapi
node_generator -->|"generates records"| node_marketdata
node_marketdata -.->|"analyzes data"| node_eda
node_eda -->|"uses transformations"| node_features
node_marketdata -.->|"trains from records"| node_trainer
node_trainer -->|"fits pipeline"| node_features
node_trainer -->|"uses metrics functions"| node_evaluator
node_trainer -.->|"saves champion model"| node_modelartifact
node_trainer -.->|"records evaluation"| node_metrics

click node_generator "https://github.com/srimanikanta2006/resale-wale/blob/main/src/generate_dataset.py"
click node_marketdata "https://github.com/srimanikanta2006/resale-wale/blob/main/data/used_cars_marketplace.csv"
click node_eda "https://github.com/srimanikanta2006/resale-wale/blob/main/src/eda_analysis.py"
click node_features "https://github.com/srimanikanta2006/resale-wale/blob/main/src/feature_engineering.py"
click node_trainer "https://github.com/srimanikanta2006/resale-wale/blob/main/src/train.py"
click node_evaluator "https://github.com/srimanikanta2006/resale-wale/blob/main/src/evaluate.py"
click node_modelartifact "https://github.com/srimanikanta2006/resale-wale/blob/main/models/car_valuation_pipeline.joblib"
click node_metrics "https://github.com/srimanikanta2006/resale-wale/blob/main/reports/metrics.json"
click node_web "https://github.com/srimanikanta2006/resale-wale/blob/main/static/index.html"
click node_api "https://github.com/srimanikanta2006/resale-wale/blob/main/src/api_server.py"
click node_engine "https://github.com/srimanikanta2006/resale-wale/blob/main/src/predict.py"
click node_comps "https://github.com/srimanikanta2006/resale-wale/blob/main/src/api_server.py"
click node_metricsapi "https://github.com/srimanikanta2006/resale-wale/blob/main/src/api_server.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_generator,node_marketdata,node_eda,node_user toneBlue
class node_features,node_trainer,node_evaluator,node_modelartifact,node_metrics toneAmber
class node_api,node_engine,node_estimate,node_comps,node_metricsapi toneMint
class node_web toneRose
```

## Components

### Data and Analysis

- [Dataset Generator](https://github.com/srimanikanta2006/resale-wale/blob/main/src/generate_dataset.py): `src/generate_dataset.py`
- [Marketplace Records](https://github.com/srimanikanta2006/resale-wale/blob/main/data/used_cars_marketplace.csv): `data/used_cars_marketplace.csv`
- [Exploratory Analysis](https://github.com/srimanikanta2006/resale-wale/blob/main/src/eda_analysis.py): `src/eda_analysis.py`

### Model Lifecycle

- [Feature Engineering](https://github.com/srimanikanta2006/resale-wale/blob/main/src/feature_engineering.py): `src/feature_engineering.py`
- [Model Training](https://github.com/srimanikanta2006/resale-wale/blob/main/src/train.py): `src/train.py`
- [Model Evaluation](https://github.com/srimanikanta2006/resale-wale/blob/main/src/evaluate.py): `src/evaluate.py`
- [Valuation Pipeline](https://github.com/srimanikanta2006/resale-wale/blob/main/models/car_valuation_pipeline.joblib): `models/car_valuation_pipeline.joblib`
- [Model Metrics](https://github.com/srimanikanta2006/resale-wale/blob/main/reports/metrics.json): `reports/metrics.json`

### Valuation Service

- [REST API](https://github.com/srimanikanta2006/resale-wale/blob/main/src/api_server.py): `src/api_server.py`
- [Valuation Engine](https://github.com/srimanikanta2006/resale-wale/blob/main/src/predict.py): `src/predict.py`
- **Valuation Results**
- [Comparable Listings](https://github.com/srimanikanta2006/resale-wale/blob/main/src/api_server.py): `src/api_server.py`
- [Metrics Endpoint](https://github.com/srimanikanta2006/resale-wale/blob/main/src/api_server.py): `src/api_server.py`

### Web Product

- [Web Interface](https://github.com/srimanikanta2006/resale-wale/blob/main/static/index.html): `static/index.html`

### Other components

- **Valuation User**

## Connections

- Valuation User → Web Interface: enters vehicle details (evidence: `README.md`)
- Web Interface → REST API: requests valuation
- REST API → Valuation Engine: calls prediction (evidence: `src/api_server.py`)
- Valuation Engine → Valuation Pipeline: loads pipeline (evidence: `src/predict.py`)
- Valuation Engine → Feature Engineering: imports mappings (evidence: `src/predict.py`)
- Valuation Engine → Valuation Results: produces price and advice (evidence: `src/predict.py`)
- REST API → Valuation Results: returns valuation response (evidence: `src/api_server.py`)
- REST API → Comparable Listings: serves comparisons (evidence: `src/api_server.py`)
- REST API → Metrics Endpoint: serves metrics (evidence: `src/api_server.py`)
- Dataset Generator → Marketplace Records: generates records (evidence: `README.md`)
- Marketplace Records → Exploratory Analysis: analyzes data
- Exploratory Analysis → Feature Engineering: uses transformations (evidence: `src/eda_analysis.py`)
- Marketplace Records → Model Training: trains from records (evidence: `README.md`)
- Model Training → Feature Engineering: fits pipeline (evidence: `src/train.py`)
- Model Training → Model Evaluation: uses metrics functions (evidence: `src/train.py`)
- Model Training → Valuation Pipeline: saves champion model
- Model Training → Model Metrics: records evaluation
