# sri-suruthi-saraswathi-s/taxi-fare-prediction-system architecture

> Architecture diagram of the GitHub repository sri-suruthi-saraswathi-s/taxi-fare-prediction-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system
- Repository: https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system

## Overview

This Flask application lets users enter trip details and receive a model-estimated fare, while saving each prediction for later history and dashboard analytics. The main workflow is form submission, input preparation, model prediction, persistence, and result rendering; the dashboard separately reads saved records and computes summary metrics. Route logic, model invocation, database operations, and their wiring are all shown in app.py. The database is created at runtime, so it is not present in the supplied file tree.

Main entry points: [`app.py`](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py) (Prediction route), [`templates/index.html`](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/index.html) (Trip form), [`templates/result.html`](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/result.html) (Fare result), [`taxi_fare_model.pkl`](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/taxi_fare_model.pkl) (Fare model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_home["Home route<br/>[app.py]"]
  node_trip_form["Trip form<br/>[index.html]"]
  node_result_page["Fare result<br/>[result.html]"]
end

subgraph group_prediction["Fare prediction"]
  node_predict["Prediction route<br/>[app.py]"]
  node_input_prep["Input preparation<br/>[app.py]"]
  node_fare_model["Fare model"]
end

subgraph group_analytics["History analytics"]
  node_prediction_store[("Prediction history<br/>[app.py]")]
  node_dashboard_route["Dashboard route<br/>[app.py]"]
  node_dashboard_page["Analytics dashboard<br/>[dashboard.html]"]
end

node_rider(("User"))

node_rider -->|"requests"| node_home
node_home -->|"renders"| node_trip_form
node_rider -->|"enters trip"| node_trip_form
node_trip_form -->|"submits"| node_predict
node_predict -->|"prepares inputs"| node_input_prep
node_predict -->|"predicts fare"| node_fare_model
node_predict -->|"saves prediction"| node_prediction_store
node_predict -->|"renders result"| node_result_page
node_rider -->|"requests dashboard"| node_dashboard_route
node_dashboard_route -->|"reads history"| node_prediction_store
node_dashboard_route -->|"renders metrics"| node_dashboard_page

click node_home "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py"
click node_trip_form "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/index.html"
click node_predict "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py"
click node_input_prep "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py"
click node_fare_model "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/taxi_fare_model.pkl"
click node_prediction_store "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py"
click node_result_page "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/result.html"
click node_dashboard_route "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py"
click node_dashboard_page "https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/dashboard.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_home,node_trip_form,node_result_page,node_rider toneBlue
class node_predict,node_input_prep,node_fare_model toneAmber
class node_prediction_store,node_dashboard_route,node_dashboard_page toneMint
```

## Components

### Web interface

- [Home route](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py): `app.py`
- [Trip form](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/index.html): `templates/index.html`
- [Fare result](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/result.html): `templates/result.html`

### Fare prediction

- [Prediction route](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py): `app.py`
- [Input preparation](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py): `app.py`
- [Fare model](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/taxi_fare_model.pkl): `taxi_fare_model.pkl`

### History analytics

- [Prediction history](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py): `app.py`
- [Dashboard route](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/app.py): `app.py`
- [Analytics dashboard](https://github.com/sri-suruthi-saraswathi-s/taxi-fare-prediction-system/blob/main/templates/dashboard.html): `templates/dashboard.html`

### Other components

- **User**

## Connections

- User → Home route: requests
- Home route → Trip form: renders
- User → Trip form: enters trip
- Trip form → Prediction route: submits
- Prediction route → Input preparation: prepares inputs
- Prediction route → Fare model: predicts fare
- Prediction route → Prediction history: saves prediction
- Prediction route → Fare result: renders result
- User → Dashboard route: requests dashboard
- Dashboard route → Prediction history: reads history
- Dashboard route → Analytics dashboard: renders metrics
