Skip to content

A real-time web dashboard for managing textile manufacturing orders.

Notifications You must be signed in to change notification settings

Petrinax/workflow_manager

Repository files navigation

Textile Supply Chain Workflow Manager

A real-time web-based dashboard for managing textile manufacturing orders and supply chain workflows. This system processes order information, tracks production stages, and provides live updates on order status and manufacturing progress.

Features

  • Real-time Dashboard: Live updates using WebSocket connections
  • Order Management: Track customer orders with detailed item specifications
  • Workflow Tracking: Monitor production stages (yarn lot, weaving, dyeing, finishing, quality control, shipping)
  • Missing Information Detection: Automatically identify incomplete order details
  • Customer Communication: Track email threads and conversation history
  • Priority Management: Organize orders by priority levels
  • Interactive UI: Modern Bootstrap-based interface with real-time notifications

Technology Stack

  • Backend: Flask (Python web framework)
  • Database: SQLite with SQLAlchemy ORM
  • Real-time Communication: Flask-SocketIO
  • Frontend: HTML5, Bootstrap 5, JavaScript
  • Icons: Font Awesome

Project Structure

workflow_manager/
├── app.py                 # Main Flask application
├── requirements.txt       # Python dependencies
├── reset_db.py          # Database init + reset utility
├── generate_sample_data.py # Sample data generator
├── sample_orders.json    # Demo order data
├── static/
│   ├── css/
│   │   └── dashboard.css # Custom styles
│   └── js/
│       └── dashboard.js  # Frontend JavaScript
├── templates/
│   └── dashboard.html    # Main dashboard template
├── instance/
│   └── supply_chain.db   # SQLite database
└── python-venv/          # Virtual environment

Prerequisites

  • Python 3.11 or higher
  • pip (Python package installer)
  • Modern web browser (Chrome, Firefox, Safari, Edge)

Local Setup Instructions

1. Clone or Download the Project

# If using git
git clone https://github.com/Petrinax/workflow_manager.git
cd workflow_manager

# Or download and extract the project files

2. Set Up Python Virtual Environment

# Create virtual environment
python3 -m venv python-venv

# Activate virtual environment
# On macOS/Linux:
source python-venv/bin/activate

# On Windows:
python-venv\Scripts\activate

3. Install Dependencies

# Install required Python packages
pip install flask flask-sqlalchemy flask-socketio eventlet

Running the Application

Start the Development Server

# Make sure virtual environment is activated
source python-venv/bin/activate  # On macOS/Linux
# python-venv\Scripts\activate    # On Windows

# Run the Flask application
python app.py

The application will start on http://localhost:5000

Access the Dashboard

  1. Open your web browser
  2. Navigate to http://localhost:5000
  3. You should see the Supply Chain Dashboard with real-time order tracking

Demo Features

Dashboard Overview

The main dashboard displays:

  • Order Statistics: Total orders, pending items, active workflows, completion rate
  • Recent Orders: List of latest customer orders with status indicators
  • Real-time Updates: Live notifications when order status changes
  • Workflow Progress: Visual indicators for each production stage

Sample Data

The demo includes sample orders from various textile companies with:

  • Different fabric types (Cotton, Wool, Silk, Polyester blends)
  • Various colors and quantities
  • Multiple production stages
  • Different priority levels
  • Realistic delivery dates

Interactive Features

  1. Order Details: Click on any order to view detailed information
  2. Status Updates: Orders automatically progress through workflow stages
  3. Missing Information: System highlights orders with incomplete data
  4. Priority Filtering: Filter orders by priority level
  5. Real-time Notifications: Live updates without page refresh

API Endpoints

REST API

  • GET / - Main dashboard page
  • GET /api/orders - Retrieve all orders
  • GET /api/orders/<id> - Get specific order details
  • POST /api/orders/<id>/update - Update order information
  • GET /api/stats - Get dashboard statistics

WebSocket Events

  • connect - Client connection established
  • order_updated - Real-time order status updates
  • new_order - New order notifications
  • workflow_progress - Production stage updates

Database Schema

Orders Table

  • Customer information (name, email, destination)
  • Delivery dates and priorities
  • Order status and conversation history
  • Created/updated timestamps

Order Items Table

  • Product specifications (type, material, color)
  • Quantities and units
  • Yarn lot numbers for traceability

Order Stages Table

  • Production workflow tracking
  • Stage status (pending, in_progress, completed)
  • Start and completion timestamps

Missing Fields Table

  • Tracks incomplete order information
  • Helps identify required customer follow-ups

Troubleshooting

Common Issues

  1. Database Errors: Run python reset_db.py to recreate the database
  2. Port Conflicts: Change the port in app.py if 5000 is in use
  3. Virtual Environment: Ensure the virtual environment is activated
  4. Missing Dependencies: Reinstall packages with pip install -r requirements.txt

Development Mode

For development, set Flask environment variables:

export FLASK_ENV=development
export FLASK_DEBUG=True

Contributing

  1. Ensure code follows Python PEP 8 standards
  2. Test all features before submitting changes
  3. Update documentation for new features
  4. Maintain database compatibility

License

This project is for demonstration purposes. Please ensure compliance with your organization's policies before use in production environments.

Support

For issues or questions:

  1. Check the troubleshooting section
  2. Review the Flask and SQLAlchemy documentation
  3. Ensure all dependencies are properly installed
  4. Verify database connectivity and permissions

About

A real-time web dashboard for managing textile manufacturing orders.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published