A comprehensive, modular Inventory Management System (IMS) that digitizes and streamlines all stock-related operations within a business. This system replaces manual registers, Excel sheets, and scattered tracking methods with a centralized, real-time, easy-to-use application.
- ✅ User signup/login with JWT authentication
- ✅ OTP-based password reset (Forgot Password)
- ✅ Role-based access control (Inventory Managers, Warehouse Staff, Admin)
- ✅ Protected routes and session management
- ✅ Real-time KPIs:
- Total Products in Stock
- Low Stock / Out of Stock Items
- Pending Receipts
- Pending Deliveries
- Internal Transfers Scheduled
- ✅ Dynamic filters by document type, status, warehouse, and category
- ✅ Recent operations view with document history
- ✅ Create/update products with:
- Name, SKU/Code
- Category
- Unit of Measure
- Initial stock (optional)
- ✅ Stock availability per location and warehouse
- ✅ Product categories management
- ✅ Reordering rules (reorder level and quantity)
- ✅ Low stock alerts and filtering
- ✅ Search by name or SKU
- ✅ Create receipts for incoming goods from vendors
- ✅ Add supplier and products with quantities
- ✅ Input unit prices (optional)
- ✅ Validate → stock increases automatically
- ✅ Status tracking: Draft, Waiting, Ready, Done, Canceled
- ✅ Document numbering: WH/IN/0001 format
- ✅ Create delivery orders for customer shipments
- ✅ Pick items (track picked quantities)
- ✅ Pack items (track packed quantities)
- ✅ Validate → stock decreases automatically
- ✅ Status tracking: Draft, Waiting, Ready, Done, Canceled
- ✅ Document numbering: WH/OUT/0001 format
- ✅ Move stock between warehouses/locations
- ✅ Track transfers from source to destination
- ✅ Stock is automatically updated in both locations
- ✅ Complete audit trail in stock ledger
- ✅ Document numbering: WH/MOVE/0001 format
- ✅ Fix mismatches between recorded and physical stock
- ✅ Select product/location/warehouse
- ✅ Enter recorded and physical quantities
- ✅ System calculates difference automatically
- ✅ Reason tracking (Damaged, Lost, Found, Counting error, Theft)
- ✅ Document numbering: WH/ADJ/0001 format
- ✅ Complete audit trail of all stock movements
- ✅ Filter by product, warehouse, document type, transaction type, and date range
- ✅ View quantity changes and stock after each transaction
- ✅ Track who created each transaction
- ✅ Create and manage warehouses
- ✅ Track stock by warehouse and location
- ✅ Multi-warehouse support
- ✅ Warehouse codes and addresses
- Node.js with Express.js
- MySQL database
- Sequelize ORM for database operations
- JWT for authentication
- bcrypt for password hashing
- dotenv for environment variables
- cors for cross-origin resource sharing
- React with Vite
- React Router for navigation
- TailwindCSS for modern, responsive styling
- Context API for state management
- Axios for API calls
- Node.js (v14 or higher)
- MySQL (v5.7 or higher, or MySQL 8.0+)
- npm or yarn
- Navigate to the Backend directory:
cd Backend- Install dependencies:
npm install- Create a
.envfile in the Backend directory:
PORT=3000
DB_HOST=localhost
DB_PORT=3306
DB_NAME=stockmaster
DB_USER=root
DB_PASSWORD=your_mysql_password
JWT_SECRET=your-secret-key-change-in-production
NODE_ENV=development- Create the MySQL database:
CREATE DATABASE stockmaster;- Seed the database with sample data (recommended for first run):
npm run seedThis will create:
- 4 users (Inventory Manager, Warehouse Staff, Admin)
- 3 warehouses (Main Warehouse, Production Stock, Distribution Center)
- 64 products across 8 categories (Furniture, Raw Materials, Electronics, Office Supplies, Tools, Packaging, Safety Equipment, Maintenance)
- 200 receipts with various statuses
- 200 delivery orders with various statuses
- 200 internal transfers
- 200 stock adjustments
- Complete stock ledger entries
- Start the backend server:
npm run devThe backend will run on http://localhost:3000
- Navigate to the Frontend directory:
cd Frontend- Install dependencies:
npm install- Start the frontend development server:
npm run devThe frontend will run on http://localhost:5173 (or another port if 5173 is busy)
-
Start the backend server:
cd Backend npm run dev -
Start the frontend server:
cd Frontend npm run dev -
Open your browser and navigate to
http://localhost:5173 -
Login with sample credentials:
- Email:
john.anderson@stockmaster.com - Password:
password123
Or create a new account.
- Email:
-
Start managing your inventory!
StockMaster/
├── Backend/
│ ├── config/
│ │ └── database.js # MySQL connection with Sequelize
│ ├── models/ # Sequelize models
│ │ ├── User.js
│ │ ├── Product.js
│ │ ├── Warehouse.js
│ │ ├── StockLocation.js
│ │ ├── Receipt.js
│ │ ├── ReceiptItem.js
│ │ ├── DeliveryOrder.js
│ │ ├── DeliveryOrderItem.js
│ │ ├── Transfer.js
│ │ ├── TransferItem.js
│ │ ├── Adjustment.js
│ │ ├── AdjustmentItem.js
│ │ ├── StockLedger.js
│ │ └── index.js # Model associations
│ ├── routes/ # API routes
│ │ ├── auth.js
│ │ ├── products.js
│ │ ├── warehouses.js
│ │ ├── receipts.js
│ │ ├── deliveryOrders.js
│ │ ├── transfers.js
│ │ ├── adjustments.js
│ │ ├── stockLedger.js
│ │ └── dashboard.js
│ ├── middleware/
│ │ └── auth.js # JWT authentication middleware
│ ├── services/
│ │ └── stockService.js # Stock update logic with transactions
│ ├── utils/
│ │ └── generateDocNumber.js # Document number generator
│ ├── scripts/
│ │ ├── seedData.js # Database seeding script
│ │ └── ... # Utility scripts
│ └── server.js # Express server setup
│
└── Frontend/
├── src/
│ ├── components/
│ │ ├── Layout.jsx # Main layout with sidebar
│ │ ├── ProtectedRoute.jsx
│ │ └── Pagination.jsx
│ ├── context/
│ │ └── AuthContext.jsx # Authentication context
│ ├── pages/
│ │ ├── Login.jsx
│ │ ├── Signup.jsx
│ │ ├── ForgotPassword.jsx
│ │ ├── Dashboard.jsx
│ │ ├── Products.jsx
│ │ ├── Warehouses.jsx
│ │ ├── Receipts.jsx
│ │ ├── DeliveryOrders.jsx
│ │ ├── Transfers.jsx
│ │ ├── Adjustments.jsx
│ │ ├── MoveHistory.jsx
│ │ └── Profile.jsx
│ ├── utils/
│ │ └── api.js # API client utility
│ ├── App.jsx # Main app component with routing
│ └── main.jsx # Entry point
└── package.json
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/forgot-password- Request OTPPOST /api/auth/reset-password- Reset password with OTPGET /api/auth/me- Get current user
GET /api/products- Get all products (with filters: category, search, warehouse, lowStock)GET /api/products/:id- Get single productPOST /api/products- Create productPUT /api/products/:id- Update productDELETE /api/products/:id- Deactivate productGET /api/products/categories/list- Get all categories
GET /api/warehouses- Get all warehousesGET /api/warehouses/:id- Get single warehousePOST /api/warehouses- Create warehousePUT /api/warehouses/:id- Update warehouseDELETE /api/warehouses/:id- Deactivate warehouse
GET /api/receipts- Get all receipts (with filters: status, warehouse)GET /api/receipts/:id- Get single receiptPOST /api/receipts- Create receiptPUT /api/receipts/:id- Update receiptPOST /api/receipts/:id/validate- Validate receipt (update stock)POST /api/receipts/:id/cancel- Cancel receipt
GET /api/delivery-orders- Get all orders (with filters: status, warehouse)GET /api/delivery-orders/:id- Get single orderPOST /api/delivery-orders- Create orderPUT /api/delivery-orders/:id- Update orderPOST /api/delivery-orders/:id/pick- Pick itemsPOST /api/delivery-orders/:id/pack- Pack itemsPOST /api/delivery-orders/:id/validate- Validate order (update stock)POST /api/delivery-orders/:id/cancel- Cancel order
GET /api/transfers- Get all transfers (with filters: status, fromWarehouse, toWarehouse)GET /api/transfers/:id- Get single transferPOST /api/transfers- Create transferPUT /api/transfers/:id- Update transferPOST /api/transfers/:id/validate- Validate transfer (move stock)POST /api/transfers/:id/cancel- Cancel transfer
GET /api/adjustments- Get all adjustments (with filters: status, warehouse)GET /api/adjustments/:id- Get single adjustmentPOST /api/adjustments- Create adjustmentPUT /api/adjustments/:id- Update adjustmentPOST /api/adjustments/:id/validate- Validate adjustment (update stock)POST /api/adjustments/:id/cancel- Cancel adjustment
GET /api/stock-ledger- Get ledger entries (with filters: product, warehouse, documentType, transactionType, startDate, endDate)GET /api/stock-ledger/product/:id- Get product movement history
GET /api/dashboard/kpis- Get dashboard KPIsGET /api/dashboard/data- Get dashboard data with filters
-
Receive Goods from Vendor
- Create a Receipt: Receive 100 kg Steel
- Validate → Stock: +100
- Stock Ledger entry created
-
Move to Production Rack
- Create Internal Transfer: Main Store → Production Rack
- Validate → Stock decreased from source, increased at destination
- Stock Ledger entries created for both locations
-
Deliver Finished Goods
- Create Delivery Order: Deliver 20 kg Steel
- Pick items → Track picked quantities
- Pack items → Track packed quantities
- Validate → Stock: -20
- Stock Ledger entry created
-
Adjust Damaged Items
- Create Adjustment: Physical count shows 3 kg Steel damaged
- Enter recorded quantity and physical quantity
- System calculates difference: -3
- Validate → Stock updated
- Stock Ledger entry created
All transactions are automatically logged in the Stock Ledger with complete audit trail.
- Modern Design: Gradient backgrounds, smooth animations, and professional styling
- Beautiful Cards: KPI cards with icons and gradients
- Responsive Tables: Clean, modern table design with hover effects
- Status Badges: Color-coded status indicators (Draft, Waiting, Ready, Done, Canceled)
- Smooth Transitions: All interactions have smooth animations
- Professional Layout: Clean sidebar with collapsible menu
- Beautiful Forms: Modern input fields with focus states
- Real-time Updates: Dashboard KPIs update based on current data
- Advanced Filtering: Filter documents by type, status, warehouse, and date range
- Change the
JWT_SECRETin production - Use environment variables for sensitive data
- Implement proper CORS policies for production
- Add rate limiting for API endpoints
- Use HTTPS in production
- Passwords are hashed using bcrypt
- JWT tokens expire after 7 days
After seeding the database, you can test all features:
- Login with sample credentials
- View Dashboard - Check KPIs and recent operations
- Manage Products - Create, update, and view products
- Create Receipt - Add incoming stock
- Create Delivery Order - Process outgoing stock
- Create Transfer - Move stock between warehouses
- Create Adjustment - Fix stock discrepancies
- View Move History - Check complete audit trail
The system uses MySQL with Sequelize ORM. Key tables include:
users- User accounts with roleswarehouses- Warehouse informationproducts- Product catalogstock_locations- Stock quantities by product, warehouse, and locationreceipts&receipt_items- Incoming stock documentsdelivery_orders&delivery_order_items- Outgoing stock documentstransfers&transfer_items- Internal stock movementsadjustments&adjustment_items- Stock count adjustmentsstock_ledger- Complete audit trail of all stock movements
- Export reports to PDF/Excel
- Email notifications for low stock
- Barcode scanning support
- Mobile app
- Advanced analytics and reporting
- Multi-currency support
- Purchase order management
- Supplier management
- Customer management
This project is part of a portfolio/demo project.
This is a personal project, but suggestions and feedback are welcome!
StockMaster - Streamline your inventory management! 🎉