Enterprise-Grade Inventory Planning, Forecasting & Warehouse Operations Platform
- About the Project
- Key Features
- Architecture
- Tech Stack
- Project Structure
- Getting Started
- Git Workflow
- Environment Variables
- Security & RBAC
- Database Schema
- API Reference
- Contributing
- Versioning
- Authors & Maintainers
- License & Copyright
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.
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.
| 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. |
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.
| 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 |
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
| 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 |
1. Clone the repository:
git clone https://github.com/AutoCrat-Engineers/WarehouseManagementSystem.git
cd WarehouseManagementSystem2. Install dependencies:
npm install3. 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_key4. 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 devThe application will be available at http://localhost:3000.
| Command | Description |
|---|---|
npm run dev |
Start development server with HMR |
npm run build |
Create production build in build/ |
This project follows a Git Feature Branch Workflow with the following branch strategy:
| 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 |
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-testTo 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 --rebaseAfter 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-nameThen create a Pull Request on GitHub to merge into develop-test.
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 |
| Variable | Required | Description |
|---|---|---|
VITE_SUPABASE_URL |
β | Your Supabase project URL |
VITE_SUPABASE_ANON_KEY |
β | Your Supabase anonymous/public key |
β οΈ Never commit.envfiles to version control. The.gitignoreis configured to exclude all environment files.
- JWT-based authentication via Supabase Auth
- Secure session management with automatic token refresh
- Protected routes and API calls
| 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 |
- β 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
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.
The backend API is powered by Supabase Edge Functions using the Hono framework.
Request β Route Handler β Service β Repository β Database
| 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/.
We follow the GitHub Flow model. All changes must go through Pull Requests.
-
Create a feature branch from
develop-test:git checkout develop-test git pull origin develop-test git checkout -b feature/your-feature-name
-
Make your changes with clean, atomic commits.
-
Push your branch and create a Pull Request:
git push origin feature/your-feature-name
-
Request a code review from at least one team member.
-
Merge after approval β squash merge is preferred for clean history.
- β 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.login production code (use proper error handling) - β Meaningful commit messages following Conventional Commits
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
| AutoCrat Engineers |
| Engineering & Product Team |
Organisation: AutoCrat Engineers
Repository: github.com/AutoCrat-Engineers/WarehouseManagementSystem
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
