A powerful, real-time inventory management solution built for modern businesses. Replace manual registers and Excel sheets with a centralized, intelligent system that streamlines every stock operation.
Built for Odoo Hackathon Virtual Round 🏆
| 📊 Real-Time Tracking | 🔄 Automated Workflows | 👥 Multi-Role Support | ⚡ Lightning Fast |
|---|---|---|---|
| Live stock updates across all warehouses | Automated receipt, delivery & transfer processing | Manager & Staff role-based access | Instant updates with Socket.IO |
| Multi-location inventory | Smart low-stock alerts | Task assignment & tracking | Optimized performance |
| Complete audit trail | Auto-calculated stock levels | Activity monitoring | Real-time notifications |
- ➕ Smart Product Creation - SKU generation, categorization, and unit management
- 📍 Multi-Location Tracking - Track stock across multiple warehouses and locations
- 📊 Stock Availability - Real-time stock levels per location
- 🔄 Reordering Rules - Automated low-stock alerts and reorder suggestions
- 🔍 Advanced Search - SKU-based search with smart filters
- 📋 Supplier Management - Track vendors and purchase orders
- ✅ Quick Validation - Fast receipt processing with barcode support
- 📈 Auto Stock Updates - Automatic inventory adjustments
- 📝 Receipt History - Complete audit trail of all incoming goods
- 🔔 Real-time Notifications - Instant updates on new receipts
- 🎯 Pick & Pack Workflow - Streamlined order fulfillment
- 📦 Batch Processing - Handle multiple deliveries efficiently
- 📉 Auto Deduction - Automatic stock reduction on validation
- 🚚 Delivery Tracking - Monitor outgoing shipments
- ✔️ Quality Checks - Built-in validation steps
- 🏭 Inter-Warehouse Moves - Transfer stock between locations
- 📍 Rack Management - Organize inventory by racks and zones
- 🔍 Movement Tracking - Complete visibility of stock movements
- ⚡ Instant Updates - Real-time location changes
- 📊 Transfer Reports - Detailed movement history
- 📊 Physical Count - Easy stock counting interface
- 🔄 Auto Reconciliation - Automatic variance calculation
- 📝 Adjustment Logging - Complete audit trail
- 🔍 Discrepancy Reports - Identify and resolve mismatches
- 📈 Trend Analysis - Track adjustment patterns
- 📊 Comprehensive Dashboard - Real-time KPIs and metrics
- 👥 Staff Management - Assign and monitor warehouse staff
- 📈 Analytics & Reports - Detailed inventory insights
- ⚙️ System Configuration - Warehouse and location setup
- 🔍 Complete Visibility - Access to all operations
- 📋 Task Dashboard - Assigned tasks and priorities
- ⚡ Quick Actions - Fast receipt and picking workflows
- 📦 Stock Counting - Mobile-friendly counting interface
- 📊 Activity History - Personal work log
- 🔔 Task Notifications - Real-time task updates
- 📦 Total Products in Stock - Overall inventory value
⚠️ Low Stock Alerts - Items requiring attention- 📥 Pending Receipts - Awaiting validation
- 📤 Pending Deliveries - Orders to fulfill
- 🔄 Scheduled Transfers - Upcoming movements
- 📋 Document Type - Filter by receipts, deliveries, transfers, adjustments
- ✅ Status-Based - Draft, waiting, ready, done, canceled
- 🏢 Location Filter - By warehouse or specific location
- 📁 Category Filter - By product category
- 📅 Date Range - Time-based filtering
- ⚡ Live Updates - Socket.IO powered real-time synchronization
- 🔄 Instant Notifications - Push notifications for all operations
- 👥 Collaborative Workflows - Multiple users working simultaneously
- 📊 Live Dashboard - Auto-updating metrics and KPIs
- 🎯 Task Assignment - Real-time task distribution
flowchart LR
%% Layout LR for a wide, presentation-friendly diagram
subgraph FRONTEND["Frontend Layer"]
direction TB
A[React 19 + TypeScript]
B[Redux Toolkit]
C[Tailwind CSS]
D[Socket.IO Client]
end
subgraph BACKEND["Backend Layer"]
direction TB
E[Node.js + Express]
F[Socket.IO Server]
G[RESTful API]
H[JWT Authentication]
end
subgraph DATA["Data Layer"]
direction TB
I[MongoDB Atlas]
J[Mongoose ODM]
K[Real-time Subscriptions]
end
subgraph SEC["Security & Performance"]
direction LR
L[Rate Limiting]
M[Helmet Security]
N[Compression]
O[Error Handling]
end
%% Primary flow (left -> right)
A -->|API calls| E
B -.->|state -> api| G
D -->|ws| F
%% Backend -> data
E -->|reads/writes| I
G --> J
F --> K
%% Cross-cutting concerns
H --> E
L --> E
M --> E
N --> E
O --> E
%% Styling (GitHub-friendly)
classDef frontend fill:#0ea5a4,stroke:#065f46,color:white,stroke-width:1px;
classDef backend fill:#2563eb,stroke:#1e40af,color:white,stroke-width:1px;
classDef data fill:#f59e0b,stroke:#92400e,color:black,stroke-width:1px;
classDef security fill:#ef4444,stroke:#7f1d1d,color:white,stroke-width:1px;
class A,B,C,D frontend;
class E,F,G,H backend;
class I,J,K data;
class L,M,N,O security;
📦 StockMaster/
├── 📋 README.md # You are here!
├── 📦 package.json # Root dependencies
├── 🚀 .gitignore # Git ignore rules
│
├── 🔙 Backend/ # Node.js + Express API
│ ├── 📦 package.json # Backend dependencies
│ ├── 🌍 .env # Environment variables
│ ├── 🚀 server.js # Express server entry
│ ├── ⚙️ config/
│ │ ├── 🗄️ database.js # MongoDB connection
│ │ └── 🔑 jwt.js # JWT configuration
│ ├── 🎛️ controllers/
│ │ ├── 🔐 authController.js
│ │ ├── 📦 productController.js
│ │ ├── 📥 receiptController.js
│ │ ├── 📤 deliveryController.js
│ │ ├── 🔄 transferController.js
│ │ ├── 🔧 adjustmentController.js
│ │ ├── 🏢 warehouseController.js
│ │ ├── 📊 dashboardController.js
│ │ └── 📝 historyController.js
│ ├── 📚 models/
│ │ ├── 👤 User.js
│ │ ├── 📦 Product.js
│ │ ├── 🏢 Warehouse.js
│ │ ├── 📥 Receipt.js
│ │ ├── 📤 Delivery.js
│ │ ├── 🔄 Transfer.js
│ │ ├── 🔧 Adjustment.js
│ │ └── 📝 StockHistory.js
│ ├── 🛣️ routes/
│ │ ├── 🔐 authRoutes.js
│ │ ├── 📦 productRoutes.js
│ │ ├── 📥 receiptRoutes.js
│ │ ├── 📤 deliveryRoutes.js
│ │ ├── 🔄 transferRoutes.js
│ │ ├── 🔧 adjustmentRoutes.js
│ │ ├── 🏢 warehouseRoutes.js
│ │ ├── 📊 dashboardRoutes.js
│ │ └── 📝 historyRoutes.js
│ ├── 🛡️ middlewares/
│ │ ├── 🔒 auth.js # JWT verification
│ │ ├── 👮 roleCheck.js # Role-based access
│ │ ├── ✅ validation.js # Input validation
│ │ └── ⚠️ errorHandler.js # Global error handler
│ └── 🔧 utils/
│ ├── 📧 notifications.js # Socket.IO helpers
│ ├── 🔢 stockCalculator.js # Stock calculations
│ └── 📊 logger.js # Custom logger
│
└── 🎨 Frontend/ # React + TypeScript SPA
├── 📦 package.json # Frontend dependencies
├── 🌍 .env # Environment variables
├── ⚡ vite.config.ts # Vite configuration
├── 🎯 tsconfig.json # TypeScript config
├── 🎨 tailwind.config.js # Tailwind CSS config
├── 🗂️ src/
│ ├── 🚀 main.tsx # Application entry
│ ├── 📱 App.tsx # Root component
│ ├── 🎨 index.css # Global styles
│ ├── 🧩 components/
│ │ ├── 🔐 Auth/
│ │ │ ├── 🚪 LoginPage.tsx
│ │ │ └── 📝 SignupPage.tsx
│ │ ├── 🖼️ Layout/
│ │ │ ├── 📐 Layout.tsx
│ │ │ ├── 🔝 Header.tsx
│ │ │ ├── 📊 Sidebar.tsx
│ │ │ └── 🔔 Notifications.tsx
│ │ ├── 🛡️ ProtectedRoute.tsx
│ │ └── 🎨 ui/ # Reusable components
│ ├── 📄 pages/
│ │ ├── 📊 Dashboard.tsx
│ │ ├── 🏢 WarehouseDashboard.tsx
│ │ ├── 👥 StaffManagement.tsx
│ │ ├── 📋 MyTasks.tsx
│ │ ├── 📦 Products.tsx
│ │ ├── 🔄 operations/
│ │ │ ├── 📥 Receipts.tsx
│ │ │ ├── 📤 Deliveries.tsx
│ │ │ └── 🔧 Adjustments.tsx
│ │ ├── 📝 MoveHistory.tsx
│ │ ├── ⚙️ Settings.tsx
│ │ ├── ⚡ QuickReceive.tsx # Staff
│ │ ├── 🎯 QuickPick.tsx # Staff
│ │ ├── 📊 StockCount.tsx # Staff
│ │ └── 📈 MyActivity.tsx # Staff
│ ├── 🔄 store/ # Redux Toolkit
│ │ ├── 📦 index.ts
│ │ └── 🗂️ slices/
│ │ ├── 🔐 authSlice.ts
│ │ ├── 📦 productSlice.ts
│ │ ├── 📥 receiptSlice.ts
│ │ ├── 📤 deliverySlice.ts
│ │ ├── 🔄 transferSlice.ts
│ │ ├── 🔧 adjustmentSlice.ts
│ │ └── 🔔 notificationSlice.ts
│ ├── 🔌 services/
│ │ ├── 🌐 api.ts # Axios configuration
│ │ └── ⚡ socket.ts # Socket.IO client
│ ├── 🎣 hooks/
│ │ ├── 🔐 useAuth.ts
│ │ ├── ⚡ useSocket.ts
│ │ └── 🔔 useNotifications.ts
│ ├── 📝 types/
│ │ └── 📋 index.ts # TypeScript types
│ └── 🔧 utils/
│ ├── 📅 dateFormatter.ts
│ ├── 💰 numberFormatter.ts
│ └── ✅ validators.ts
└── 🎯 public/
├── 🖼️ logo.svg
└── 📱 favicon.ico
| Requirement | Version | Download |
|---|---|---|
| 🟢 Node.js | 18+ | Download |
| 📦 npm | Latest | Included with Node.js |
| 🗄️ MongoDB | 6.0+ | MongoDB Atlas |
# 1️⃣ Clone the repository
git clone https://github.com/yourusername/stockmaster.git
cd stockmaster
# 2️⃣ Install Backend Dependencies
cd Backend
npm install
# 3️⃣ Install Frontend Dependencies
cd ../Frontend
npm install
# 4️⃣ Set up Backend environment
cd ../Backend
cp .env.example .env
# Edit .env with your MongoDB URI and JWT secret
# 5️⃣ Set up Frontend environment
cd ../Frontend
cp .env.example .env
# Edit .env with your backend API URL
# 6️⃣ Start Backend Server
cd ../Backend
npm run dev
# 7️⃣ Start Frontend (in new terminal)
cd Frontend
npm run dev# Server Configuration
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:5173
# MongoDB Configuration
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/stockmaster
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRE=7d
# Socket.IO
SOCKET_CORS_ORIGIN=http://localhost:5173# Backend API
VITE_API_URL=http://localhost:5000/api
VITE_SOCKET_URL=http://localhost:5000
# App Configuration
VITE_APP_NAME=StockMaster| Service | URL | Description |
|---|---|---|
| 🎨 Frontend | http://localhost:5173 | Main application |
| 🔙 Backend API | http://localhost:5000/api | REST API |
| 🏥 Health Check | http://localhost:5000/api/health | Server status |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/auth/signup |
Register new user | ❌ |
POST |
/api/auth/login |
User login | ❌ |
GET |
/api/auth/me |
Get current user | ✅ |
POST |
/api/auth/logout |
User logout | ✅ |
POST |
/api/auth/reset-password |
OTP-based reset | ❌ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/products |
List all products | ✅ |
POST |
/api/products |
Create product | ✅ |
GET |
/api/products/:id |
Get product details | ✅ |
PUT |
/api/products/:id |
Update product | ✅ |
DELETE |
/api/products/:id |
Delete product | ✅ |
GET |
/api/products/:id/stock |
Get stock by location | ✅ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/receipts |
List all receipts | ✅ |
POST |
/api/receipts |
Create receipt | ✅ |
PUT |
/api/receipts/:id |
Update receipt | ✅ |
POST |
/api/receipts/:id/validate |
Validate receipt | ✅ |
DELETE |
/api/receipts/:id |
Cancel receipt | ✅ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/deliveries |
List all deliveries | ✅ |
POST |
/api/deliveries |
Create delivery | ✅ |
PUT |
/api/deliveries/:id |
Update delivery | ✅ |
POST |
/api/deliveries/:id/validate |
Validate delivery | ✅ |
DELETE |
/api/deliveries/:id |
Cancel delivery | ✅ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/transfers |
List all transfers | ✅ |
POST |
/api/transfers |
Create transfer | ✅ |
PUT |
/api/transfers/:id |
Update transfer | ✅ |
POST |
/api/transfers/:id/validate |
Validate transfer | ✅ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/adjustments |
List all adjustments | ✅ |
POST |
/api/adjustments |
Create adjustment | ✅ |
POST |
/api/adjustments/:id/validate |
Validate adjustment | ✅ |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/api/dashboard/kpis |
Get dashboard KPIs | ✅ |
GET |
/api/dashboard/low-stock |
Get low stock items | ✅ |
GET |
/api/history |
Get stock movement history | ✅ |
GET |
/api/history/product/:id |
Get product history | ✅ |
-
📊 Monitor Dashboard
- View real-time KPIs
- Check low stock alerts
- Monitor pending operations
-
👥 Manage Staff
- Assign warehouse staff
- Monitor task completion
- Track staff performance
-
📦 Oversee Operations
- Review all receipts, deliveries, transfers
- Validate high-value transactions
- Generate reports
-
📋 Check Tasks
- View assigned tasks
- Prioritize urgent items
- Update task status
-
⚡ Quick Operations
- Fast receipt processing
- Quick pick & pack
- Stock counting
-
📊 Track Activity
- View personal work history
- Monitor performance metrics
| Feature | Implementation | Benefit |
|---|---|---|
| 🔑 JWT Authentication | Token-based auth with expiry | Secure session management |
| 🛡️ Helmet Security | HTTP headers protection | Prevents common attacks |
| ⏱️ Rate Limiting | 100 requests/15min per IP | DDoS protection |
| 🔐 Role-Based Access | Manager & Staff roles | Data isolation |
| 📝 Audit Trail | Complete operation logging | Accountability |
| 🔒 CORS Protection | Restricted origins | Cross-origin security |
🔴 MongoDB Connection Failed
Problem: MongoNetworkError: failed to connect to server
Solutions:
- Check MongoDB Atlas connection string
- Verify IP whitelist in Atlas
- Ensure network connectivity
- Check username/password in URI
🔑 JWT Token Invalid
Problem: 401 Unauthorized or JsonWebTokenError
Solutions:
- Verify JWT_SECRET in backend .env
- Check token expiry
- Clear browser localStorage
- Re-login to get new token
⚡ Socket.IO Not Connecting
Problem: Real-time updates not working
Solutions:
- Check CORS configuration
- Verify Socket.IO URLs match
- Check browser console for errors
- Restart both servers
🎨 Frontend Build Errors
Problem: TypeScript or build errors
Solutions:
- Delete node_modules and reinstall
- Clear Vite cache:
rm -rf node_modules/.vite - Check TypeScript version compatibility
- Run
npm run type-check
| Feature | Technology | Impact |
|---|---|---|
| ⚡ Real-time Updates | Socket.IO | Instant synchronization |
| 🗜️ Response Compression | Express Compression | 70% smaller payloads |
| 🚀 Code Splitting | Vite + React.lazy | Faster initial load |
| 📦 State Management | Redux Toolkit | Optimized re-renders |
| 🔄 Connection Pooling | Mongoose | Efficient DB queries |
| 🎯 Lazy Loading | React Suspense | On-demand components |
We welcome contributions! Here's how you can help:
- 🍴 Fork the repository
- 🌿 Create a feature branch:
git checkout -b feature/amazing-feature - 💾 Commit your changes:
git commit -m 'Add amazing feature' - 📤 Push to the branch:
git push origin feature/amazing-feature - 🔄 Submit a Pull Request
- Follow existing code style
- Write meaningful commit messages
- Add tests for new features
- Update documentation
- Keep PRs focused and small
This project is licensed under the MIT License - see the LICENSE file for details.
Odoo Hackathon - Virtual Round
Demonstrating next-generation inventory management capabilities
Special thanks to:
- 🚀 Odoo for the hackathon opportunity
- ⚛️ React Team for the amazing framework
- 🗄️ MongoDB for the powerful database
- ⚡ Socket.IO for real-time capabilities
- 🎨 Tailwind CSS for beautiful styling