Skip to content

A full-stack Order Management System (OMS) built with Python/Flask and Vanilla JavaScript, featuring an admin dashboard, order tracking, and sales analytics.

License

Notifications You must be signed in to change notification settings

PrasanthSurya-dev/Order_Management_System

Repository files navigation

Orderlla – Order Management System (OMS)

A comprehensive digital solution for small businesses to manage orders, inventory, and analytics—built with Python/Flask and Vanilla JavaScript.

Python Version
Flask
SQLite
License: MIT


🚀 Live Demo

https://orderlla-oms-4116a2547cd5.herokuapp.com/


📋 Project Overview

Orderlla is a unified platform that gives businesses complete control over their sales by centralizing the entire order lifecycle—from product management and order tracking to real-time sales analytics—eliminating the errors and inefficiencies of manual, spreadsheet-based methods.

Target Audience: This project is a portfolio piece aimed at potential employers and technical reviewers, showcasing the ability to build a complete, data-driven web application from the ground up.

Key Differentiators:

  • Hybrid Frontend Architecture: Demonstrates architectural flexibility by combining a classic, server-rendered admin panel (for robust control) with a dynamic, API-driven customer dashboard (for a fast, modern user experience).
  • Asynchronous Processing: Features an independent background thread that simulates real-world cron jobs by automatically updating order statuses, showcasing an understanding of processes outside the standard request-response cycle.
  • Business Intelligence Engine: Moves beyond simple data entry by providing a rich analytics and reporting suite, including interactive KPI widgets and Chart.js-powered visualizations to help business owners make informed, data-driven decisions.

✨ Features

  • Authentication & Authorization: Features a role-based login for Customers and Admins with secure, user-specific data access.
  • Dynamic Product Catalog: Browse, filter, and view detailed product listings.
  • Real-Time Shopping Cart: Add, update, and remove items without page reloads.
  • Full Order Workflow: Place, track, and cancel orders; inventory auto-restores on cancellations.
  • Live Order History: Track status from “Order Received” → “Delivered.”
  • Admin Dashboard: CRUD operations for products, orders, and customers.
  • Interactive Analytics: KPI widgets (Sales, AOV, Pending Orders) link to detailed Chart.js visualizations.

🛠️ Tech Stack

Layer Technologies
Backend Python 3.13 & Flask 2.x,
Database SQLite (development) → PostgreSQL (on Supabase for production)
Database Drivers sqlite3 (built-in), psycopg2 (for PostgreSQL)
Frontend HTML5, CSS3, Vanilla JavaScript (Fetch API)
Templating Jinja2
Charting Chart.js
Deployment Heroku, Gunicorn

⚡ Getting Started

Prerequisites

  • Python 3.8+
  • Git
  • SQLite 3 command-line tool

Installation & Setup

  1. Clone the repository

    # TODO: Replace <your-username> with your actual GitHub username
    git clone https://github.com/your-username/your-repository-name.git
    cd your-repository-name
  2. Create and activate a virtual environment

    # Create the environment
    python -m venv .venv
    # Activate on Windows: .venv\Scripts\activate
    # Activate on Mac/Linux: source .venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Set up and seed the local database (This requires the populate_sqlite.sql file in your root directory.)

    Run the command below that matches your terminal.

    # If you are on Mac, Linux, or the old Windows Command Prompt (cmd.exe), use this:
    sqlite3 database.db < populate_sqlite.sql
    
    # If you are on the modern Windows PowerShell, use this instead:
    Get-Content populate_sqlite.sql | sqlite3 database.db
  5. Run the application

    python app.py

    The app will be running at http://122.0.0.1:8080 Default admin: admin / adminpass


📖 Usage Examples

Customer Dashboard

Experience a seamless, app-style interface for browsing, cart management, and order tracking without reloads.
Customer Dashboard image Order History image

Admin Analytics

An at-a-glance dashboard with clickable KPI widgets linking to detailed, interactive reports.
Sales Data image Order Status Distribution image Payment Method Distribution image


🏗️ Project Architecture

Folder Structure

/Orderlla-OMS
├── app.py
├── populate_data.sql
├── requirements.txt
├── README.md
├── static/
│   ├── css/
│   │   └── style.css
│   └── js/
│       └── customer_dashboard.js
└── templates/
    ├── admin_aov_report.html
    ├── admin_awaiting_refund.html
    ├── admin_base.html
    ├── admin_customers_list.html
    ├── admin_customer_detail.html
    ├── admin_dashboard.html
    ├── admin_edit_product.html
    ├── admin_orders.html
    ├── admin_order_detail.html
    ├── admin_products.html
    ├── admin_reports.html
    ├── cancel_confirmation.html
    ├── customer_dashboard.html
    ├── login.html
    └── register.html

🔍 System Architecture & Database

┌───── Frontend ──────┐
│ • Customer SPA      │
│ • Admin SSR Panels  │
└────────┬────────────┘
         │ REST/JSON
┌────────▼────────────┐
│     Flask API       │
│ • Routes & Sessions │
│ • Background Tasks  │
└────────┬────────────┘
         │ 
┌────────▼────────────┐
│  SQLite / PostgreSQL│
│  Tables:            │
│  customers, products│
│  orders, admin,returns│
└─────────────────────┘

ER Diagram

ER Diagram


🔄 Business Logic & Reports

  • Automated Status Updates: Hourly thread marks "In Transit" → "Delivered".
  • Inventory Management: Stock decremented on order placement; restored on cancellation.
  • Refund Workflow: Tracks cancellation and refund initiation via admin route.
  • KPI Widgets: Live metrics—Sales Today, Pending Orders, AOV MoM.
  • Report Visuals: Bar, pie, and progress-bar charts with date filters.

🛠️ Error Handling & Testing

  • Backend: try…except for DB ops; flask.flash() for user messages.
  • Frontend: Fetch error checks with .then() & alert().
  • Testing: Recommended—pytest unit tests for logic, Flask test client for routes.

⚙️ Performance & Scalability

  • Dev: Flask dev server + SQLite (single-user).
  • Prod: Gunicorn/uWSGI + Nginx; PostgreSQL for concurrency & scale; optional Redis caching.

🚀 Deployment

  1. Push to GitHub.
  2. Provision web service on Render/Heroku; link repo.
  3. Build: pip install -r requirements.txt
  4. Start: gunicorn app:app
  5. Configure DATABASE_URL & SECRET_KEY env vars.
  6. Seed production DB with modified SQL script.

🔮 Future Enhancements

  • Email/SMS notifications
  • Advanced inventory alerts
  • Payment gateway integration
  • Multi-vendor support
  • PWA + mobile app
  • Full returns management

🤝 Contributing

Fork, branch, commit, and submit a pull request. Issues and suggestions welcome.


📝 License

MIT License – see LICENSE.


📫 Contact

LinkedIn: https://www.linkedin.com/in/suryaprasanth001/
Email: suryaprasanthmedidi3@gmail.com

⭐ If you find Orderlla useful, please give it a star!

About

A full-stack Order Management System (OMS) built with Python/Flask and Vanilla JavaScript, featuring an admin dashboard, order tracking, and sales analytics.

Topics

Resources

License

Stars

Watchers

Forks