Skip to content

This Warehouse Management System (WMS) provides a comprehensive workflow for managing high-volume inventory. It bridges the gap between historical data and future demand through integrated forecasting and MRP (Material Requirements Planning) logic.

License

Notifications You must be signed in to change notification settings

AutoCrat-Engineers/WarehouseManagementSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

101 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutoCrat Engineers Logo

Warehouse Management System (WMS)

Enterprise-Grade Inventory Planning, Forecasting & Warehouse Operations Platform

Version Status License React TypeScript Supabase


πŸ“‹ Table of Contents


🏭 About the Project

Problem Statement

Modern manufacturing warehouses face critical challenges with inventory accuracy, unplanned stockouts, and excessive overstocking. Manual tracking leads to data inconsistencies, whilst basic inventory systems lack the predictive capabilities needed for intelligent replenishment planning.

Our Solution

The Warehouse Management System (WMS) is a type-safe, real-time application engineered to automate the entire stock lifecycle β€” from goods receipt and inward movements, through multi-warehouse distribution, to final dispatch and delivery. It features a built-in Holt-Winters Triple Exponential Smoothing forecasting engine for data-driven procurement decisions, a comprehensive Packing Module with sticker generation, barcode traceability and box-level stock transfer, a comprehensive audit trail for every stock movement, and a role-based access control system ensuring operational security.

Built by engineers, for engineers β€” designed to handle real-world manufacturing complexity at scale.


πŸš€ Key Features

Module Description
πŸ“Š Enterprise Dashboard Real-time KPIs, critical stock alerts, and operational summaries for warehouse managers.
πŸ“¦ Item Master Centralised catalogue of Finished Goods (FG) with part numbers, descriptions, and master serial numbers.
πŸ—οΈ Multi-Warehouse Inventory Real-time stock tracking across multiple warehouse types (S&V, Production, In Transit, Distribution) with status monitoring (Healthy, Warning, Critical, Overstock).
πŸ”„ Stock Movements Full ledger-based transaction system with movement types (Inward, Outward, Transfer, Adjustment), approval workflows, and printed slips.
πŸ“¦ Packing Module End-to-end FG packing workflow β€” sticker generation with barcodes, packing details management, packing lists against invoices and sub-invoices, box-level stock transfer from Production to FG Warehouse.
πŸ“‹ Blanket Orders Comprehensive handling of long-term customer contracts with order line items.
πŸ“… Blanket Releases Delivery scheduling against blanket orders with automatic inventory deduction upon delivery.
πŸ“ˆ Demand Forecasting Advanced demand prediction using Holt-Winters algorithm with trend and seasonality analysis.
πŸ”§ MRP Planning Automated replenishment recommendations based on lead times, safety stock levels, and forecast data.
πŸ‘₯ User Management Role-based access control (L1 Operator, L2 Supervisor, L3 Manager) with account activation/deactivation.
πŸ”” Notifications Real-time notification bell with alerts for stock movements, approvals, and system events.

πŸ—οΈ Architecture

The system follows a clean, layered architecture ensuring scalability, testability, and maintainability:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   PRESENTATION LAYER                         β”‚
β”‚         React 18 + TypeScript + Enterprise Design System     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                   BUSINESS LOGIC LAYER                       β”‚
β”‚      Custom Hooks (useDashboard, useInventory)               β”‚
β”‚      Services (inventoryService, authService, packingService)β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                   API / EDGE FUNCTIONS                        β”‚
β”‚           Supabase Edge Functions (Hono Framework)            β”‚
β”‚      Repositories β†’ Services β†’ Route Handlers                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                      DATA LAYER                              β”‚
β”‚       Supabase (PostgreSQL) + Row Level Security             β”‚
β”‚     Views, Triggers, Foreign Key Constraints                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

For detailed architecture documentation, see docs/architecture/00-ARCHITECTURE-INDEX.md.


πŸ› οΈ Tech Stack

Category Technology Purpose
Frontend React 18, TypeScript UI framework with type safety
Build Tool Vite 6 + SWC Lightning-fast HMR and builds
UI Components Radix UI Primitives Accessible, unstyled component library
Design System Custom Enterprise UI Consistent visual language
Icons Lucide React Crisp, customisable icon set
Charts Recharts Composable charting library
Forms React Hook Form Performant form management
Toasts Sonner Non-intrusive notifications
Backend / Database Supabase (PostgreSQL) Managed database with real-time subscriptions
Edge Functions Deno + Hono Serverless API layer
Authentication Supabase Auth (JWT) Secure session management
State Management React Hooks + Context Lightweight state handling
Barcode Generation QRCode library Sticker barcode printing for packing

πŸ“ Project Structure

WarehouseManagementSystem/
β”‚
β”œβ”€β”€ πŸ“„ .gitignore                # Git ignore rules
β”œβ”€β”€ πŸ“„ README.md                 # This file
β”œβ”€β”€ πŸ“„ LICENSE                   # Proprietary license
β”œβ”€β”€ πŸ“„ package.json              # Dependencies and scripts
β”œβ”€β”€ πŸ“„ tsconfig.json             # TypeScript configuration
β”œβ”€β”€ πŸ“„ tsconfig.node.json        # TypeScript config for Node.js
β”œβ”€β”€ πŸ“„ vite.config.ts            # Vite build configuration
β”œβ”€β”€ πŸ“„ index.html                # HTML entry point
β”‚
β”œβ”€β”€ πŸ“ config/                   # Database schemas & migrations
β”‚   β”œβ”€β”€ current-database-schema.sql
β”‚   β”œβ”€β”€ migration_add_text_columns.sql
β”‚   └── migration_stock_movement_v2.sql
β”‚
β”œβ”€β”€ πŸ“ .db_reference/            # Database reference schemas & migrations
β”‚   β”œβ”€β”€ presentschema.sql        # Current full schema reference
β”‚   β”œβ”€β”€ rbac.sql                 # RBAC tables, roles, policies
β”‚   β”œβ”€β”€ supabasesetup.sql        # Initial DB setup
β”‚   β”œβ”€β”€ 003_add_employee_columns.sql
β”‚   β”œβ”€β”€ packing.sql              # Packing module schema
β”‚   β”œβ”€β”€ packing_module_migration.sql
β”‚   β”œβ”€β”€ packing_data_migration.sql
β”‚   β”œβ”€β”€ packing_view.sql         # Packing detail views
β”‚   β”œβ”€β”€ fix_profiles_rls.sql     # RLS policy fixes
β”‚   β”œβ”€β”€ fix_supabase_lint_errors.sql
β”‚   β”œβ”€β”€ fix_remaining_lint_warnings.sql
β”‚   └── today.sql                # Latest consolidated SQL
β”‚
β”œβ”€β”€ πŸ“ docs/                     # Technical documentation
β”‚   β”œβ”€β”€ architecture.md          # Legacy architecture overview
β”‚   β”œβ”€β”€ developer.md             # Developer onboarding guide
β”‚   β”œβ”€β”€ architecture/            # ⭐ Architecture document suite (13 files)
β”‚   β”‚   β”œβ”€β”€ 00-ARCHITECTURE-INDEX.md
β”‚   β”‚   β”œβ”€β”€ 01-SYSTEM-OVERVIEW.md
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   └── 12-DIRECTORY-STRUCTURE.md
β”‚   └── readme/                  # Module-specific documentation (26 files)
β”‚       β”œβ”€β”€ DATABASE_SCHEMA.md
β”‚       β”œβ”€β”€ ARCHITECTURE.md
β”‚       β”œβ”€β”€ RBAC_AUTHENTICATION.md
β”‚       β”œβ”€β”€ STOCK_MOVEMENT_GUIDE.md
β”‚       β”œβ”€β”€ TROUBLESHOOTING.md
β”‚       └── ...
β”‚
β”œβ”€β”€ πŸ“ public/                   # Static assets
β”‚   β”œβ”€β”€ logo.png
β”‚   β”œβ”€β”€ a-logo.png
β”‚   β”œβ”€β”€ backgroundlogin.png
β”‚   └── data/quotes.json
β”‚
└── πŸ“ src/                      # Application source code
    β”œβ”€β”€ πŸ“„ App.tsx               # Root application component (~900 lines)
    β”œβ”€β”€ πŸ“„ main.tsx              # React entry point
    β”œβ”€β”€ πŸ“„ index.css             # Global styles & design tokens (~43KB)
    β”‚
    β”œβ”€β”€ πŸ“ auth/                 # Authentication & RBAC module
    β”‚   β”œβ”€β”€ index.ts             # Auth barrel exports
    β”‚   β”œβ”€β”€ components/          # Auth-specific UI components
    β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.tsx
    β”‚   β”‚   └── RoleBadge.tsx
    β”‚   β”œβ”€β”€ context/             # Auth context provider
    β”‚   β”‚   └── AuthContext.tsx
    β”‚   β”œβ”€β”€ login/               # Login page component
    β”‚   β”‚   └── LoginPage.tsx
    β”‚   β”œβ”€β”€ services/            # Auth service layer
    β”‚   β”‚   β”œβ”€β”€ authService.ts
    β”‚   β”‚   └── userService.ts
    β”‚   └── users/               # User management module
    β”‚       └── UserManagement.tsx
    β”‚
    β”œβ”€β”€ πŸ“ components/           # Feature components
    β”‚   β”œβ”€β”€ DashboardNew.tsx     # Enterprise dashboard
    β”‚   β”œβ”€β”€ ItemMasterSupabase.tsx  # Item catalogue (Supabase)
    β”‚   β”œβ”€β”€ InventoryGrid.tsx    # Multi-warehouse inventory grid
    β”‚   β”œβ”€β”€ StockMovement.tsx    # Stock movement ledger (~137KB)
    β”‚   β”œβ”€β”€ BlanketOrders.tsx    # Blanket order management
    β”‚   β”œβ”€β”€ BlanketReleases.tsx  # Blanket release management
    β”‚   β”œβ”€β”€ ForecastingModule.tsx # Demand forecasting engine
    β”‚   β”œβ”€β”€ PlanningModule.tsx   # MRP planning module
    β”‚   β”œβ”€β”€ StockDistributionCard.tsx # Stock breakdown card
    β”‚   β”œβ”€β”€ SampleDataInfo.tsx   # Sample data banner
    β”‚   β”œβ”€β”€ ErrorBoundary.tsx    # Error boundary wrapper
    β”‚   β”œβ”€β”€ LoadingPage.tsx      # Branded loading screen
    β”‚   β”œβ”€β”€ LoginPage.tsx        # Legacy login redirect
    β”‚   β”‚
    β”‚   β”œβ”€β”€ πŸ“ packing/         # πŸ“¦ FG Packing module
    β”‚   β”‚   β”œβ”€β”€ index.ts         # Barrel exports
    β”‚   β”‚   β”œβ”€β”€ PackingModule.tsx # Main packing workflow
    β”‚   β”‚   β”œβ”€β”€ PackingDetail.tsx # Single packing detail view
    β”‚   β”‚   β”œβ”€β”€ PackingDetails.tsx # Packing specifications manager
    β”‚   β”‚   β”œβ”€β”€ PackingList.tsx   # Packing list component
    β”‚   β”‚   β”œβ”€β”€ PackingListInvoice.tsx    # Packing list against invoice
    β”‚   β”‚   β”œβ”€β”€ PackingListSubInvoice.tsx # Packing list against sub-invoice
    β”‚   β”‚   β”œβ”€β”€ StickerPrint.tsx  # Sticker/barcode generation
    β”‚   β”‚   └── packingService.ts # Packing business logic
    β”‚   β”‚
    β”‚   β”œβ”€β”€ πŸ“ notifications/   # πŸ”” Notification system
    β”‚   β”‚   └── NotificationBell.tsx
    β”‚   β”‚
    β”‚   └── πŸ“ ui/              # Reusable UI components (51 files)
    β”‚       β”œβ”€β”€ EnterpriseUI.tsx # Core enterprise design system
    β”‚       β”œβ”€β”€ SharedComponents.tsx # Shared reusable components
    β”‚       β”œβ”€β”€ RotatingQuote.tsx # Login page quotes
    β”‚       β”œβ”€β”€ use-mobile.ts    # Responsive hook
    β”‚       β”œβ”€β”€ utils.ts         # cn() class merge utility
    β”‚       β”œβ”€β”€ button.tsx, card.tsx, dialog.tsx, ...
    β”‚       └── (46 more Radix-based primitives)
    β”‚
    β”œβ”€β”€ πŸ“ hooks/                # Custom React hooks
    β”‚   β”œβ”€β”€ useDashboard.ts      # Dashboard data fetching
    β”‚   └── useInventory.ts      # Inventory operations (8 hooks)
    β”‚
    β”œβ”€β”€ πŸ“ services/             # Business logic services
    β”‚   └── inventoryService.ts  # Inventory CRUD operations
    β”‚
    β”œβ”€β”€ πŸ“ supabase/             # Supabase edge functions
    β”‚   └── functions/server/    # API route handlers
    β”‚       β”œβ”€β”€ index.tsx        # Main edge function entry (~86KB)
    β”‚       β”œβ”€β”€ services/        # Backend services (6 files)
    β”‚       β”‚   β”œβ”€β”€ ItemService.ts
    β”‚       β”‚   β”œβ”€β”€ InventoryService.ts
    β”‚       β”‚   β”œβ”€β”€ BlanketOrderService.ts
    β”‚       β”‚   β”œβ”€β”€ BlanketReleaseService.ts
    β”‚       β”‚   β”œβ”€β”€ ForecastingService.ts
    β”‚       β”‚   └── PlanningService.ts
    β”‚       └── repositories/    # Data access layer (3 files)
    β”‚           β”œβ”€β”€ ItemRepository.ts
    β”‚           β”œβ”€β”€ InventoryRepository.ts
    β”‚           └── BlanketOrderRepository.ts
    β”‚
    β”œβ”€β”€ πŸ“ types/                # TypeScript type definitions
    β”‚   β”œβ”€β”€ index.ts             # Core application types
    β”‚   β”œβ”€β”€ inventory.ts         # Inventory-specific types
    β”‚   └── packing.ts           # Packing module types (v5)
    β”‚
    └── πŸ“ utils/                # Utility functions
        β”œβ”€β”€ api/                 # API client & fetch utilities
        β”‚   β”œβ”€β”€ client.ts        # Supabase client factory
        β”‚   β”œβ”€β”€ fetchWithAuth.ts # Authenticated fetch wrapper
        β”‚   β”œβ”€β”€ itemsSupabase.ts # Item Master API
        β”‚   └── services.ts      # General API services
        β”œβ”€β”€ notifications/       # Notification utilities
        β”‚   └── notificationService.ts
        └── supabase/            # Supabase client & auth helpers
            β”œβ”€β”€ auth.ts
            β”œβ”€β”€ client.tsx
            └── info.tsx

🏁 Getting Started

Prerequisites

Requirement Version
Node.js v18.0.0 or higher
npm v9.0.0 or higher
Git v2.30.0 or higher
Supabase Account supabase.com

Installation

1. Clone the repository:

git clone https://github.com/AutoCrat-Engineers/WarehouseManagementSystem.git
cd WarehouseManagementSystem

2. Install dependencies:

npm install

3. Configure environment variables:

Create a .env file in the project root (see Environment Variables):

VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

4. Initialise the database:

Apply the SQL schemas from config/ and .db_reference/ to your Supabase project via the SQL Editor.

5. Start the development server:

npm run dev

The application will be available at http://localhost:3000.

Available Scripts

Command Description
npm run dev Start development server with HMR
npm run build Create production build in build/

πŸ”€ Git Workflow

This project follows a Git Feature Branch Workflow with the following branch strategy:

Branch Structure

Branch Purpose Protected
main Production-ready code. Stable releases only. βœ… Yes
develop-stable Pre-production staging branch. βœ… Yes
develop-test Integration testing branch. βœ… Yes
feature/* Feature development branches. ❌ No

Pull Latest Changes (Git Pull)

Always pull the latest changes before starting new work:

# Switch to the target branch
git checkout develop-test

# Pull latest changes from remote
git pull origin develop-test

To pull changes into your current feature branch:

# Ensure you're on your feature branch
git checkout feature/your-feature-name

# Pull and rebase from develop-test
git pull origin develop-test --rebase

Push Your Changes (Git Push)

After making changes, follow this workflow:

# 1. Stage your changes
git add .

# 2. Commit with a descriptive message (follow conventional commits)
git commit -m "feat(module): brief description of the change"

# 3. Push to your feature branch
git push origin feature/your-feature-name

Then create a Pull Request on GitHub to merge into develop-test.

Commit Message Convention

We follow the Conventional Commits specification:

<type>(<scope>): <description>

# Examples:
feat(stock-movement): add print slip functionality
feat(packing): implement sticker barcode generation
fix(dashboard): resolve loading state race condition
refactor(auth): consolidate authentication services
docs(readme): update installation instructions
chore(deps): upgrade React to v18.3.1
Type When to Use
feat New feature
fix Bug fix
refactor Code restructuring (no behaviour change)
docs Documentation updates
chore Maintenance tasks (dependencies, configs)
style Formatting changes (no logic change)
perf Performance improvements

πŸ” Environment Variables

Variable Required Description
VITE_SUPABASE_URL βœ… Your Supabase project URL
VITE_SUPABASE_ANON_KEY βœ… Your Supabase anonymous/public key

⚠️ Never commit .env files to version control. The .gitignore is configured to exclude all environment files.


πŸ›‘οΈ Security & RBAC

Authentication

  • JWT-based authentication via Supabase Auth
  • Secure session management with automatic token refresh
  • Protected routes and API calls

Role-Based Access Control (RBAC)

Role Level Permissions
Operator L1 View data, create stock movements
Supervisor L2 L1 + approve/reject movements, edit items, manage packing
Manager L3 L2 + user management, full system administration

Security Best Practices

  • βœ… End-to-end TypeScript for type safety
  • βœ… Database-level constraints and triggers
  • βœ… Row Level Security (RLS) on Supabase tables
  • βœ… JWT validation on all edge function endpoints
  • βœ… Input sanitisation and validation
  • βœ… No hardcoded secrets in source code
  • βœ… Mutable search path fixes applied to all database functions

πŸ—„οΈ Database Schema

The system uses a relational PostgreSQL schema with the following core tables:

Table Description
items Finished goods master catalogue
inventory Multi-warehouse stock levels
stock_movements Complete transaction audit trail
blanket_orders Long-term customer order contracts
blanket_releases Scheduled deliveries against orders
profiles User profiles with roles and status
packing_requests FG packing workflow requests
packing_boxes Individual box records with PKG IDs
packing_audit_log Packing operation audit trail
packing_details Packing dimension/specification templates

Database migrations are stored in config/ and .db_reference/.
Full schema documentation is available at docs/readme/DATABASE_SCHEMA.md.


πŸ“‘ API Reference

The backend API is powered by Supabase Edge Functions using the Hono framework.

Architecture Pattern

Request β†’ Route Handler β†’ Service β†’ Repository β†’ Database

Key Endpoints

Method Endpoint Description
GET /items Fetch all items
POST /items Create a new item
PUT /items/:id Update an item
DELETE /items/:id Delete an item (cascading)
GET /inventory Fetch inventory data
GET /blanket-orders Fetch blanket orders
GET /forecasting Run demand forecasting
GET /planning Generate MRP plans

Edge function source is located at src/supabase/functions/server/.


🀝 Contributing

We follow the GitHub Flow model. All changes must go through Pull Requests.

Workflow

  1. Create a feature branch from develop-test:

    git checkout develop-test
    git pull origin develop-test
    git checkout -b feature/your-feature-name
  2. Make your changes with clean, atomic commits.

  3. Push your branch and create a Pull Request:

    git push origin feature/your-feature-name
  4. Request a code review from at least one team member.

  5. Merge after approval β€” squash merge is preferred for clean history.

Code Standards

  • βœ… TypeScript strict typing for all new code
  • βœ… Component files use PascalCase (e.g., StockMovement.tsx)
  • βœ… Hooks prefixed with use (e.g., useDashboard.ts)
  • βœ… Services use camelCase (e.g., inventoryService.ts)
  • βœ… Use the Enterprise Design System components for UI consistency
  • βœ… No console.log in production code (use proper error handling)
  • βœ… Meaningful commit messages following Conventional Commits

🏷️ Versioning

This project uses Semantic Versioning:

MAJOR.MINOR.PATCH
Version Part When to Increment
MAJOR Breaking changes or major architecture overhaul
MINOR New features, backwards-compatible
PATCH Bug fixes and minor improvements

Current Version: v0.3.2


πŸ‘₯ Authors & Maintainers

AutoCrat Engineers
Engineering & Product Team

Organisation: AutoCrat Engineers
Repository: github.com/AutoCrat-Engineers/WarehouseManagementSystem


πŸ“„ License & Copyright

Copyright (c) 2025-2026 AutoCrat Engineers. All Rights Reserved.

PROPRIETARY & CONFIDENTIAL

This software and its source code are the exclusive property of AutoCrat Engineers.
Unauthorised copying, distribution, modification, or use of this software,
in whole or in part, is strictly prohibited without prior written consent
from AutoCrat Engineers.

This software is provided "AS IS" without warranty of any kind, express or
implied. AutoCrat Engineers shall not be held liable for any damages arising
from the use of this software.

For licensing enquiries, contact the engineering team at AutoCrat Engineers.

Built with ❀️ by AutoCrat Engineers · © 2025-2026 · All Rights Reserved

About

This Warehouse Management System (WMS) provides a comprehensive workflow for managing high-volume inventory. It bridges the gap between historical data and future demand through integrated forecasting and MRP (Material Requirements Planning) logic.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages