Skip to content

murdock-dev/DeliveryPredictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delivery Predictor

A fully local Flask web application that predicts delivery delays using a logistic regression model trained on synthetic data. The app provides an admin-only dashboard to view and add deliveries, with instant delay predictions.

Features

  • Admin login (username: admin, password: admin123)
  • Dashboard listing deliveries from CSV
  • Add new delivery via form; prediction is generated and saved
  • Synthetic dataset and model generated automatically on first run
  • Bootstrap 5 UI (via CDN)

Project Structure

delivery_predictor/
├── app.py
├── model/
│   ├── train_model.py
│   └── logistic_model.pkl  # generated on first run
├── data/
│   └── deliveries.csv      # generated on first run
├── templates/
│   ├── base.html
│   ├── login.html
│   ├── dashboard.html
│   └── add_delivery.html
├── static/
│   ├── css/style.css
│   └── js/script.js
└── requirements.txt

Setup

Local Python (no Docker)

  1. Create and activate a Python 3.10+ virtual environment (recommended).
  2. Install dependencies:
    pip install -r requirements.txt

Docker Installation

If you don't have Docker and Docker Compose:

Verify installation:

docker --version
docker compose version

Run

Local Python

Start the Flask app locally from the repository root; it will generate the dataset and model if missing:

python app.py

Open http://127.0.0.1:5000 and log in with admin / admin123.

Docker Compose (Recommended)

Build and run the app in a container (persistent data):

docker compose up --build

Or, to run in the background:

docker compose up -d --build

Open http://localhost:5000 and log in with admin / admin123.

To stop and remove the container:

docker compose down

Your delivery data will persist in the dp_data Docker volume.

Notes

  • Data is stored in delivery_predictor/data/deliveries.csv.
  • The ML model is stored in delivery_predictor/model/logistic_model.pkl.
  • To regenerate the dataset/model manually:
python delivery_predictor/model/train_model.py

Security

This demo uses hardcoded credentials and is intended for local/offline use only.

DeliveryPredictor

About

A Flask-based web app that forecasts delivery times using ML . Users input package details, and it predicts ETA delivery status.

Topics

Resources

Stars

Watchers

Forks

Contributors