LogiPredict is a full-stack web application that predicts shipment transit times based on historical routing data. It combines a Machine Learning prediction engine with a RESTful backend and a custom frontend interface.
- Predictive Engine: Uses a trained Random Forest Regressor to estimate delivery windows.
- API-First Architecture: The backend serves JSON data, decoupling the logic from the UI.
- Persistent Auditing: Logs every estimation request to a database using SQLAlchemy.
- Environment Agnostic: Falls back to a local SQLite database if a cloud PostgreSQL URL is not provided.
- Custom UI: A zero-dependency frontend built with Vanilla JS, CSS, and the Fetch API.
- Backend: Python, Flask, Flask-SQLAlchemy, Flask-Marshmallow
- Machine Learning: Scikit-Learn, Pandas, Joblib
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Server: Gunicorn
-
Clone the repository:
git clone https://github.com/shakeelsaga/LogiPredict.git cd LogiPredict -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activateOn Windows, use
venv\Scripts\activate -
Install the dependencies:
pip install -r requirements.txt
-
Configure your environment variables: Create a
.envfile in the root directory and add a secret key:SECRET_KEY=your_generated_secret_key_hereLeave
DATABASE_URLblank to default to local SQLite. -
Run the server:
python run.py
The application will be available at
http://127.0.0.1:5000.
The backend exposes a RESTful endpoint for transit time calculation.
Calculates the estimated transit time and logs the request to the database.
Request Body (JSON):
{
"origin": "DELHI",
"destination": "CHENNAI",
"weight": 5.3,
"service": "FEDEX_EXPRESS_SAVER"
}Success Response (200 OK):
{
"id": 1,
"created_at": "2026-03-06T15:10:31.440476",
"origin_city": "DELHI",
"destination_city": "CHENNAI",
"weight_kg": 5.3,
"service_type": "FEDEX_EXPRESS_SAVER",
"predicted_hours": 12.88
}This project is licensed under the MIT License.