# darikkoo/food-delivery-ml architecture

> Architecture diagram of the GitHub repository darikkoo/food-delivery-ml, 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/darikkoo/food-delivery-ml
- Repository: https://github.com/darikkoo/food-delivery-ml

## Overview

This repository is a food-delivery ETA prediction product: a React form sends order and delivery details to a Django prediction endpoint, which loads a serialized model and returns predicted minutes for display. The repository also contains a dataset and a broader set of analysis, feature-engineering, training, tuning, and evaluation scripts. The graph shows the training steps visible in excerpts; the other ML scripts are included as distinct capabilities, but their internal relationships are not inferred. The README documents the prediction goal and Gradient Boosting model, not the full training workflow.

Main entry points: [`backend/predictor/views.py`](https://github.com/darikkoo/food-delivery-ml/blob/main/backend/predictor/views.py) (Prediction endpoint), [`frontend/src/App.jsx`](https://github.com/darikkoo/food-delivery-ml/blob/main/frontend/src/App.jsx) (ETA form), [`data/food_delivery_orders_dataset.csv`](https://github.com/darikkoo/food-delivery-ml/blob/main/data/food_delivery_orders_dataset.csv) (Orders dataset), [`backend/predictor/urls.py`](https://github.com/darikkoo/food-delivery-ml/blob/main/backend/predictor/urls.py) (API route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Prediction interface"]
  node_frontend["ETA form<br/>[App.jsx]"]
end

subgraph group_serving["Prediction service"]
  node_endpoint["Prediction endpoint<br/>[views.py]"]
  node_routing["API route<br/>[urls.py]"]
  node_model["Serialized model"]
end

subgraph group_ml["ML development"]
  node_feature_engineering["Feature engineering"]
  node_engineered_training["Engineered training"]
  node_training["Model training<br/>[train.py]"]
  node_engineered_training_alt["Training variants"]
  node_cross_validation["Cross-validation"]
  node_cross_validation_alt["Validation variant"]
  node_model_tuning["Model tuning<br/>[tune_model.py]"]
  node_model_comparison["Model comparison"]
  node_feature_importance["Feature importance"]
  node_error_analysis["Error analysis<br/>[error_analysis.py]"]
  node_eda["Exploratory analysis<br/>[eda.py]"]
  node_analysis["Analysis<br/>[analysis.py]"]
  node_prediction_script["Prediction script<br/>[predict.py]"]
  node_api_script["ML API script<br/>[api.py]"]
end

subgraph group_data["Prediction data"]
  node_dataset["Orders dataset"]
end

node_user(("Order user"))

node_user -->|"enters details"| node_frontend
node_frontend -->|"posts JSON"| node_endpoint
node_endpoint -->|"loads model"| node_model
node_routing -->|"routes request"| node_endpoint
node_endpoint -->|"returns minutes"| node_frontend
node_dataset -->|"reads orders"| node_feature_engineering
node_dataset -->|"loads orders"| node_engineered_training

click node_frontend "https://github.com/darikkoo/food-delivery-ml/blob/main/frontend/src/App.jsx"
click node_endpoint "https://github.com/darikkoo/food-delivery-ml/blob/main/backend/predictor/views.py"
click node_routing "https://github.com/darikkoo/food-delivery-ml/blob/main/backend/predictor/urls.py"
click node_model "https://github.com/darikkoo/food-delivery-ml/blob/main/models/delivery_time_model.pkl"
click node_dataset "https://github.com/darikkoo/food-delivery-ml/blob/main/data/food_delivery_orders_dataset.csv"
click node_feature_engineering "https://github.com/darikkoo/food-delivery-ml/blob/main/src/feature_engineering.py"
click node_engineered_training "https://github.com/darikkoo/food-delivery-ml/blob/main/src/train_engineered.py"
click node_training "https://github.com/darikkoo/food-delivery-ml/blob/main/src/train.py"
click node_engineered_training_alt "https://github.com/darikkoo/food-delivery-ml/blob/main/src/train_no_estimated.py"
click node_cross_validation "https://github.com/darikkoo/food-delivery-ml/blob/main/src/cross_validation.py"
click node_cross_validation_alt "https://github.com/darikkoo/food-delivery-ml/blob/main/src/cross_validation_no_estimated.py"
click node_model_tuning "https://github.com/darikkoo/food-delivery-ml/blob/main/src/tune_model.py"
click node_model_comparison "https://github.com/darikkoo/food-delivery-ml/blob/main/src/model_comparison.py"
click node_feature_importance "https://github.com/darikkoo/food-delivery-ml/blob/main/src/feature_importance.py"
click node_error_analysis "https://github.com/darikkoo/food-delivery-ml/blob/main/src/error_analysis.py"
click node_eda "https://github.com/darikkoo/food-delivery-ml/blob/main/src/eda.py"
click node_analysis "https://github.com/darikkoo/food-delivery-ml/blob/main/src/analysis.py"
click node_prediction_script "https://github.com/darikkoo/food-delivery-ml/blob/main/src/predict.py"
click node_api_script "https://github.com/darikkoo/food-delivery-ml/blob/main/src/api.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_frontend,node_user toneBlue
class node_endpoint,node_routing,node_model toneAmber
class node_feature_engineering,node_engineered_training,node_training,node_engineered_training_alt,node_cross_validation,node_cross_validation_alt,node_model_tuning,node_model_comparison,node_feature_importance,node_error_analysis,node_eda,node_analysis,node_prediction_script,node_api_script toneMint
class node_dataset toneRose
```

## Components

### Prediction interface

- [ETA form](https://github.com/darikkoo/food-delivery-ml/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Prediction service

- [Prediction endpoint](https://github.com/darikkoo/food-delivery-ml/blob/main/backend/predictor/views.py): `backend/predictor/views.py`
- [API route](https://github.com/darikkoo/food-delivery-ml/blob/main/backend/predictor/urls.py): `backend/predictor/urls.py`
- [Serialized model](https://github.com/darikkoo/food-delivery-ml/blob/main/models/delivery_time_model.pkl): `models/delivery_time_model.pkl`

### ML development

- [Feature engineering](https://github.com/darikkoo/food-delivery-ml/blob/main/src/feature_engineering.py): `src/feature_engineering.py`
- [Engineered training](https://github.com/darikkoo/food-delivery-ml/blob/main/src/train_engineered.py): `src/train_engineered.py`
- [Model training](https://github.com/darikkoo/food-delivery-ml/blob/main/src/train.py): `src/train.py`
- [Training variants](https://github.com/darikkoo/food-delivery-ml/blob/main/src/train_no_estimated.py): `src/train_no_estimated.py`
- [Cross-validation](https://github.com/darikkoo/food-delivery-ml/blob/main/src/cross_validation.py): `src/cross_validation.py`
- [Validation variant](https://github.com/darikkoo/food-delivery-ml/blob/main/src/cross_validation_no_estimated.py): `src/cross_validation_no_estimated.py`
- [Model tuning](https://github.com/darikkoo/food-delivery-ml/blob/main/src/tune_model.py): `src/tune_model.py`
- [Model comparison](https://github.com/darikkoo/food-delivery-ml/blob/main/src/model_comparison.py): `src/model_comparison.py`
- [Feature importance](https://github.com/darikkoo/food-delivery-ml/blob/main/src/feature_importance.py): `src/feature_importance.py`
- [Error analysis](https://github.com/darikkoo/food-delivery-ml/blob/main/src/error_analysis.py): `src/error_analysis.py`
- [Exploratory analysis](https://github.com/darikkoo/food-delivery-ml/blob/main/src/eda.py): `src/eda.py`
- [Analysis](https://github.com/darikkoo/food-delivery-ml/blob/main/src/analysis.py): `src/analysis.py`
- [Prediction script](https://github.com/darikkoo/food-delivery-ml/blob/main/src/predict.py): `src/predict.py`
- [ML API script](https://github.com/darikkoo/food-delivery-ml/blob/main/src/api.py): `src/api.py`

### Prediction data

- [Orders dataset](https://github.com/darikkoo/food-delivery-ml/blob/main/data/food_delivery_orders_dataset.csv): `data/food_delivery_orders_dataset.csv`

### Other components

- **Order user**

## Connections

- Order user → ETA form: enters details (evidence: `frontend/src/App.jsx`)
- ETA form → Prediction endpoint: posts JSON (evidence: `frontend/src/App.jsx`)
- Prediction endpoint → Serialized model: loads model (evidence: `backend/predictor/views.py`)
- API route → Prediction endpoint: routes request (evidence: `backend/predictor/urls.py`)
- Prediction endpoint → ETA form: returns minutes (evidence: `frontend/src/App.jsx`)
- Orders dataset → Feature engineering: reads orders (evidence: `src/feature_engineering.py`)
- Orders dataset → Engineered training: loads orders (evidence: `src/train_engineered.py`)
