# bhupendra-jangir/vip architecture

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

- Interactive diagram: https://gitdiagram.com/bhupendra-jangir/vip
- Repository: https://github.com/bhupendra-jangir/vip

## Overview

Vehicle Insurance Prediction is an end-to-end training and serving application. Users submit vehicle attributes through the web app for a prediction, or trigger retraining; retraining ingests MongoDB data, validates and transforms it, trains and evaluates a model, then pushes an accepted model to S3. The app’s prediction pipeline loads the production model from S3. Training orchestration and the data-access/storage layers are shown; several component internals were not sampled, so uncertain internal calls are omitted.

Main entry points: [`src/pipline/training_pipeline.py`](https://github.com/bhupendra-jangir/vip/blob/main/src/pipline/training_pipeline.py) (Training pipeline), [`app.py`](https://github.com/bhupendra-jangir/vip/blob/main/app.py) (Web routes), [`src/cloud_storage/aws_storage.py`](https://github.com/bhupendra-jangir/vip/blob/main/src/cloud_storage/aws_storage.py) (S3 storage client), [`src/pipline/prediction_pipeline.py`](https://github.com/bhupendra-jangir/vip/blob/main/src/pipline/prediction_pipeline.py) (Prediction pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Web routes<br/>[app.py]"]
  node_prediction_result["Prediction result<br/>[app.py]"]
end

subgraph group_training["Model training"]
  node_trainpipe["Training pipeline"]
  node_ingestion["Data ingestion<br/>[data_ingestion.py]"]
  node_validation["Data validation<br/>[data_validation.py]"]
  node_transform["Data transformation"]
  node_trainer["Model trainer<br/>[model_trainer.py]"]
  node_evaluation["Model evaluation"]
  node_pusher["Model pusher<br/>[model_pusher.py]"]
end

subgraph group_data["Data access"]
  node_dataaccess["Mongo data access<br/>[vip_data.py]"]
  node_mongoconfig["Mongo connection"]
  node_storage["S3 storage client<br/>[aws_storage.py]"]
end

subgraph group_serving["Model serving"]
  node_prediction["Prediction pipeline"]
  node_estimator["S3 estimator<br/>[s3_estimator.py]"]
end

subgraph group_integrations["External systems"]
  node_mongo[("MongoDB Atlas")]
  node_s3[("S3 model registry")]
end

node_user(("User"))

node_user -->|"submits vehicle data"| node_app
node_app -->|"starts training"| node_trainpipe
node_trainpipe -->|"invokes"| node_ingestion
node_trainpipe -->|"invokes"| node_validation
node_trainpipe -->|"invokes"| node_transform
node_trainpipe -->|"invokes"| node_trainer
node_trainpipe -->|"invokes"| node_evaluation
node_trainpipe -->|"invokes if accepted"| node_pusher
node_ingestion -->|"exports records"| node_dataaccess
node_dataaccess -->|"gets connection"| node_mongoconfig
node_mongoconfig -->|"connects to"| node_mongo
node_evaluation -->|"loads production model"| node_storage
node_pusher -->|"uploads accepted model"| node_storage
node_storage -->|"reads and writes"| node_s3
node_app -->|"requests prediction"| node_prediction
node_prediction -->|"predicts with"| node_estimator
node_estimator -->|"loads model"| node_storage
node_prediction -->|"returns prediction"| node_app
node_app -->|"renders result"| node_prediction_result

click node_app "https://github.com/bhupendra-jangir/vip/blob/main/app.py"
click node_trainpipe "https://github.com/bhupendra-jangir/vip/blob/main/src/pipline/training_pipeline.py"
click node_ingestion "https://github.com/bhupendra-jangir/vip/blob/main/src/components/data_ingestion.py"
click node_validation "https://github.com/bhupendra-jangir/vip/blob/main/src/components/data_validation.py"
click node_transform "https://github.com/bhupendra-jangir/vip/blob/main/src/components/data_transformation.py"
click node_trainer "https://github.com/bhupendra-jangir/vip/blob/main/src/components/model_trainer.py"
click node_evaluation "https://github.com/bhupendra-jangir/vip/blob/main/src/components/model_evaluation.py"
click node_pusher "https://github.com/bhupendra-jangir/vip/blob/main/src/components/model_pusher.py"
click node_dataaccess "https://github.com/bhupendra-jangir/vip/blob/main/src/data_access/vip_data.py"
click node_mongoconfig "https://github.com/bhupendra-jangir/vip/blob/main/src/configuration/mongo_db_connection.py"
click node_prediction "https://github.com/bhupendra-jangir/vip/blob/main/src/pipline/prediction_pipeline.py"
click node_estimator "https://github.com/bhupendra-jangir/vip/blob/main/src/entity/s3_estimator.py"
click node_storage "https://github.com/bhupendra-jangir/vip/blob/main/src/cloud_storage/aws_storage.py"
click node_prediction_result "https://github.com/bhupendra-jangir/vip/blob/main/app.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_prediction_result,node_user toneBlue
class node_trainpipe,node_ingestion,node_validation,node_transform,node_trainer,node_evaluation,node_pusher toneAmber
class node_dataaccess,node_mongoconfig,node_storage toneMint
class node_prediction,node_estimator toneRose
class node_mongo,node_s3 toneIndigo
```

## Components

### Web application

- [Web routes](https://github.com/bhupendra-jangir/vip/blob/main/app.py): `app.py`
- [Prediction result](https://github.com/bhupendra-jangir/vip/blob/main/app.py): `app.py`

### Model training

- [Training pipeline](https://github.com/bhupendra-jangir/vip/blob/main/src/pipline/training_pipeline.py): `src/pipline/training_pipeline.py`
- [Data ingestion](https://github.com/bhupendra-jangir/vip/blob/main/src/components/data_ingestion.py): `src/components/data_ingestion.py`
- [Data validation](https://github.com/bhupendra-jangir/vip/blob/main/src/components/data_validation.py): `src/components/data_validation.py`
- [Data transformation](https://github.com/bhupendra-jangir/vip/blob/main/src/components/data_transformation.py): `src/components/data_transformation.py`
- [Model trainer](https://github.com/bhupendra-jangir/vip/blob/main/src/components/model_trainer.py): `src/components/model_trainer.py`
- [Model evaluation](https://github.com/bhupendra-jangir/vip/blob/main/src/components/model_evaluation.py): `src/components/model_evaluation.py`
- [Model pusher](https://github.com/bhupendra-jangir/vip/blob/main/src/components/model_pusher.py): `src/components/model_pusher.py`

### Data access

- [Mongo data access](https://github.com/bhupendra-jangir/vip/blob/main/src/data_access/vip_data.py): `src/data_access/vip_data.py`
- [Mongo connection](https://github.com/bhupendra-jangir/vip/blob/main/src/configuration/mongo_db_connection.py): `src/configuration/mongo_db_connection.py`
- [S3 storage client](https://github.com/bhupendra-jangir/vip/blob/main/src/cloud_storage/aws_storage.py): `src/cloud_storage/aws_storage.py`

### Model serving

- [Prediction pipeline](https://github.com/bhupendra-jangir/vip/blob/main/src/pipline/prediction_pipeline.py): `src/pipline/prediction_pipeline.py`
- [S3 estimator](https://github.com/bhupendra-jangir/vip/blob/main/src/entity/s3_estimator.py): `src/entity/s3_estimator.py`

### External systems

- **MongoDB Atlas**
- **S3 model registry**

### Other components

- **User**

## Connections

- User → Web routes: submits vehicle data
- Web routes → Training pipeline: starts training
- Training pipeline → Data ingestion: invokes
- Training pipeline → Data validation: invokes
- Training pipeline → Data transformation: invokes
- Training pipeline → Model trainer: invokes
- Training pipeline → Model evaluation: invokes
- Training pipeline → Model pusher: invokes if accepted
- Data ingestion → Mongo data access: exports records
- Mongo data access → Mongo connection: gets connection
- Mongo connection → MongoDB Atlas: connects to
- Model evaluation → S3 storage client: loads production model
- Model pusher → S3 storage client: uploads accepted model
- S3 storage client → S3 model registry: reads and writes
- Web routes → Prediction pipeline: requests prediction
- Prediction pipeline → S3 estimator: predicts with
- S3 estimator → S3 storage client: loads model
- Prediction pipeline → Web routes: returns prediction
- Web routes → Prediction result: renders result
