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