Skip to content

namish18/SmartShelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ SmartShelf - AI-Powered Warehouse Inventory Management System

SmartShelf Banner License MERN Stack

A comprehensive warehouse management solution with real-time tracking, FEFO ordering, and demand forecasting

Features β€’ Tech Stack β€’ Installation β€’ API Documentation β€’ Contributors


πŸ“‹ Table of Contents


🎯 About

SmartShelf is an intelligent warehouse inventory management system designed to optimize warehouse operations through automation, predictive analytics, and real-time monitoring. It addresses critical challenges in modern warehouse management including:

  • ❌ Inventory discrepancies and manual errors
  • ❌ Product expiry and waste management
  • ❌ Inefficient task allocation
  • ❌ Lack of predictive capabilities
  • ❌ Limited real-time visibility

✨ Features

πŸ” Authentication & Authorization

  • Secure JWT-based authentication
  • Role-based access control (Admin, Manager, Worker)
  • Password encryption using bcrypt
  • Session management

πŸ“¦ Inventory Management

  • Real-time tracking of inventory items
  • CRUD operations with full data validation
  • Category-based filtering and search
  • Multi-field search (product name, SKU, supplier)
  • Inventory analytics with KPIs

πŸ“Š FEFO Ordering System

  • First Expired, First Out algorithm implementation
  • Automatic prioritization based on expiry dates
  • Urgency levels: Critical (≀3 days), High (≀7 days), Medium (≀14 days), Low (>14 days)
  • Visual indicators for quick identification

πŸ“ˆ Demand Forecasting

  • 7-day demand projections based on historical data
  • Daily consumption rate calculations
  • Trend indicators: Stable, Normal, Critical
  • Product-wise forecast visualization
  • Interactive forecast graphs

πŸ”” Alert System

  • Real-time notifications for critical events
  • Live alert feed with human-readable messages
  • Alert categories:
    • πŸ”΄ Expired items
    • 🟠 Expiring soon (within 7 days)
    • 🟑 Low stock (below threshold)
    • ⚫ Out of stock

βœ… Task Management

  • Task creation and assignment to workers
  • Status tracking: Pending β†’ In Progress β†’ Completed
  • Real-time task updates
  • Task completion analytics
  • Worker-specific task views

πŸ“± Dashboard Analytics

  • Admin Dashboard: System-wide overview and user management
  • Manager Dashboard: Live alerts, forecasting, FEFO ordering, top products
  • Worker Dashboard: Assigned tasks with quick status updates
  • Responsive design with dark mode support

🎨 User Interface

  • Modern, intuitive interface built with React + TypeScript
  • Tailwind CSS for responsive design
  • Dark mode support
  • Mobile-friendly layouts
  • Smooth animations and transitions

πŸ› οΈ Tech Stack

Frontend

React TypeScript Tailwind CSS Vite

  • React 18 - UI library with hooks
  • TypeScript - Type safety
  • Tailwind CSS - Utility-first styling
  • Vite - Fast build tool
  • React Context API - State management

Backend

Node.js Express MongoDB JWT

  • Node.js - Runtime environment
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - ODM for MongoDB
  • JWT - Authentication
  • bcrypt - Password hashing

Development Tools

  • Git - Version control
  • VS Code - Code editor
  • Postman - API testing
  • MongoDB Compass - Database management

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CLIENT TIER                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚         React + TypeScript Frontend (SPA)          β”‚   β”‚
β”‚  β”‚  β€’ Component-based architecture                     β”‚   β”‚
β”‚  β”‚  β€’ React Context for state management              β”‚   β”‚
β”‚  β”‚  β€’ Tailwind CSS for styling                        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           ↕ HTTP/HTTPS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     APPLICATION TIER                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚        Node.js + Express.js Backend (API)          β”‚   β”‚
β”‚  β”‚  β€’ RESTful API endpoints                           β”‚   β”‚
β”‚  β”‚  β€’ JWT authentication middleware                   β”‚   β”‚
β”‚  β”‚  β€’ Role-based authorization                        β”‚   β”‚
β”‚  β”‚  β€’ Business logic & algorithms                     β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           ↕ Mongoose ODM
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         DATA TIER                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚              MongoDB Database (NoSQL)              β”‚   β”‚
β”‚  β”‚  β€’ Collections: Users, Inventory, Tasks            β”‚   β”‚
β”‚  β”‚  β€’ Indexes for query optimization                  β”‚   β”‚
β”‚  β”‚  β€’ Document-based storage                          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Installation

Prerequisites

Ensure you have the following installed:

Clone Repository

git clone https://github.com/namish18/SmartShelf.git
cd SmartShelf

Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Create .env file
cp .env.example .env

# Edit .env with your configuration
# Add MongoDB connection string and JWT secret

# Start development server
npm run dev

Frontend Setup

# Navigate to frontend directory (from root)
cd ../frontend

# Install dependencies
npm install

# Create .env file
cp .env.example .env

# Edit .env with backend API URL

# Start development server
npm run dev

The application will be available at:


βš™οΈ Configuration

Backend Environment Variables

Create a .env file in the backend directory:

# Server Configuration
PORT=5000
NODE_ENV=development

# Database Configuration
MONGODB_URI=mongodb://localhost:27017/smartshelf
# Or use MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:[email protected]/smartshelf

# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here_minimum_32_characters
JWT_EXPIRE=24h

# CORS Configuration
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000

Frontend Environment Variables

Create a .env file in the frontend directory:

# API Configuration
VITE_API_URL=http://localhost:5000/api

MongoDB Setup

Option 1: Local MongoDB

# Start MongoDB service
# Windows
net start MongoDB

# macOS/Linux
sudo systemctl start mongod

Option 2: MongoDB Atlas (Cloud)

  1. Create account at MongoDB Atlas
  2. Create a cluster
  3. Get connection string
  4. Update MONGODB_URI in backend .env

πŸ’» Usage

User Roles & Permissions

Feature Admin Manager Worker
Dashboard Overview βœ… βœ… βœ…
View Inventory βœ… βœ… βœ…
Add/Edit Inventory βœ… βœ… ❌
Delete Inventory βœ… βœ… ❌
User Management βœ… ❌ ❌
Create Tasks βœ… βœ… ❌
View All Tasks βœ… βœ… ❌
View My Tasks - - βœ…
Update Task Status βœ… βœ… βœ…
View Analytics βœ… βœ… ❌
FEFO Ordering βœ… βœ… ❌
Demand Forecast βœ… βœ… ❌

πŸ“š API Documentation

Base URL

http://localhost:5000/api

Authentication

All authenticated endpoints require a JWT token in the Authorization header:

Authorization: Bearer <your_jwt_token>

API Endpoints Overview

πŸ” Authentication APIs

Method Endpoint Description Auth
POST /auth/register Register new user ❌
POST /auth/login Login user ❌
GET /auth/me Get current user βœ…
POST /auth/logout Logout user βœ…

πŸ‘₯ User Management APIs

Method Endpoint Description Auth Role
GET /users Get all users βœ… Admin
POST /users Create user βœ… Admin
PUT /users/:id Update user βœ… Admin
DELETE /users/:id Delete user βœ… Admin
GET /users/workers Get all workers βœ… Manager/Admin

πŸ“¦ Inventory Management APIs

Method Endpoint Description Auth Role
GET /inventory Get all items βœ… All
GET /inventory/:id Get item by ID βœ… All
POST /inventory Create item βœ… Manager/Admin
PUT /inventory/:id Update item βœ… Manager/Admin
DELETE /inventory/:id Delete item βœ… Manager/Admin
GET /inventory/analytics/summary Get inventory summary βœ… All
GET /inventory/analytics/by-category Get category analytics βœ… All

βœ… Task Management APIs

Method Endpoint Description Auth Role
GET /tasks Get all tasks βœ… Manager/Admin
GET /tasks/my-tasks Get my tasks βœ… Worker
POST /tasks Create task βœ… Manager/Admin
PUT /tasks/:id Update task βœ… Manager/Admin
PATCH /tasks/:id/status Update status βœ… Worker/Manager/Admin
DELETE /tasks/:id Delete task βœ… Manager/Admin

πŸ”” Alert System APIs

Method Endpoint Description Auth
GET /alerts/low-stock Get low stock alerts βœ…
GET /alerts/expiring-soon Get expiring soon alerts βœ…
GET /alerts/critical Get critical alerts βœ…
GET /alerts/summary Get alert summary βœ…

πŸ“ˆ Analytics & Forecast APIs

Method Endpoint Description Auth Role
GET /analytics/demand-forecast Get demand forecast βœ… Manager/Admin
GET /analytics/fefo-ordering Get FEFO ordering βœ… Manager/Admin
GET /analytics/top-selling Get top selling products βœ… Manager/Admin
GET /analytics/notification-alerts Get notification alerts βœ… Manager/Admin

Example API Requests

Register User

POST /api/auth/register
Content-Type: application/json

{
  "name": "John Doe",
  "email": "[email protected]",
  "password": "password123",
  "role": "Worker"
}

Create Inventory Item

POST /api/inventory
Authorization: Bearer <token>
Content-Type: application/json

{
  "productName": "Fresh Milk",
  "category": "Dairy",
  "sku": "DA-001",
  "quantity": 150,
  "purchaseDate": "2025-11-01",
  "expiryDate": "2025-11-15",
  "supplier": "Local Dairy Farm"
}

Create Task

POST /api/tasks
Authorization: Bearer <token>
Content-Type: application/json

{
  "description": "Inspect expired items in dairy section",
  "assignedTo": "673ab12c5f8e9a001234abcd"
}

For complete API documentation, refer to the API Documentation Chapter in the project report.


πŸ“ Project Structure

SmartShelf/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/          # Request handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ userController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ inventoryController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ taskController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ alertController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ forecastController.js
β”‚   β”‚   β”‚   └── analyticsController.js
β”‚   β”‚   β”œβ”€β”€ models/                # Database models
β”‚   β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Inventory.js
β”‚   β”‚   β”‚   └── Task.js
β”‚   β”‚   β”œβ”€β”€ routes/                # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ userRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ inventoryRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ taskRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ alertRoutes.js
β”‚   β”‚   β”‚   └── analyticsRoutes.js
β”‚   β”‚   β”œβ”€β”€ middlewares/           # Custom middleware
β”‚   β”‚   β”‚   β”œβ”€β”€ authMiddleware.js
β”‚   β”‚   β”‚   β”œβ”€β”€ roleMiddleware.js
β”‚   β”‚   β”‚   └── errorHandler.js
β”‚   β”‚   β”œβ”€β”€ utils/                 # Utility functions
β”‚   β”‚   β”‚   β”œβ”€β”€ responseHelper.js
β”‚   β”‚   β”‚   └── validators.js
β”‚   β”‚   β”œβ”€β”€ config/                # Configuration
β”‚   β”‚   β”‚   └── database.js
β”‚   β”‚   └── app.js                 # Express app setup
β”‚   β”œβ”€β”€ .env                       # Environment variables
β”‚   β”œβ”€β”€ .env.example              # Example env file
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js                  # Entry point
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ components/                # Reusable components
β”‚   β”‚   └── Modal.tsx
β”‚   β”œβ”€β”€ pages/                     # Page components
β”‚   β”‚   β”œβ”€β”€ LoginPage.tsx
β”‚   β”‚   β”œβ”€β”€ RegistrationPage.tsx
β”‚   β”‚   β”œβ”€β”€ MainLayout.tsx
β”‚   β”‚   β”œβ”€β”€ AdminDashboard.tsx
β”‚   β”‚   β”œβ”€β”€ ManagerDashboard.tsx
β”‚   β”‚   β”œβ”€β”€ WorkerDashboard.tsx
β”‚   β”‚   β”œβ”€β”€ InventoryPage.tsx
β”‚   β”‚   β”œβ”€β”€ UserManagementPage.tsx
β”‚   β”‚   └── TaskManagementPage.tsx
β”‚   β”œβ”€β”€ contexts/                  # React contexts
β”‚   β”‚   └── ThemeContext.tsx
β”‚   β”œβ”€β”€ services/                  # API services
β”‚   β”‚   β”œβ”€β”€ apiClient.ts
β”‚   β”‚   β”œβ”€β”€ authService.ts
β”‚   β”‚   β”œβ”€β”€ inventoryService.ts
β”‚   β”‚   β”œβ”€β”€ taskService.ts
β”‚   β”‚   β”œβ”€β”€ userService.ts
β”‚   β”‚   └── alertService.ts
β”‚   β”œβ”€β”€ config/                    # Frontend config
β”‚   β”‚   └── api.ts
β”‚   β”œβ”€β”€ types.ts                   # TypeScript types
β”‚   β”œβ”€β”€ constants.tsx              # Constants & icons
β”‚   β”œβ”€β”€ App.tsx                    # Main app component
β”‚   β”œβ”€β”€ index.tsx                  # Entry point
β”‚   β”œβ”€β”€ index.css                  # Global styles
β”‚   β”œβ”€β”€ .env                       # Environment variables
β”‚   β”œβ”€β”€ .env.example              # Example env file
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   └── vite.config.ts
β”‚
β”œβ”€β”€ docs/                          # Documentation
β”‚   β”œβ”€β”€ API_DOCUMENTATION.md
β”‚   └── PROJECT_REPORT.docx
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md


🀝 Contributors

Namish Kumar Sahu
Namish Kumar Sahu

Backend Development & API Design
Turanya Mishra
Turanya Mishra

Frontend Development & UI/UX
Shiba Prasad Gochhayat
Shiba Prasad Gochhayat

Database Design & Algorithms

Institution

Biju Patnaik University of Technology (BPUT)
Department of Computer Science & Engineering
Center for Under Graduate & Post Graduate Studies
Rourkela, Odisha - 769015


πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 Namish Kumar Sahu, Turanya Mishra, Shiba Prasad Gochhayat

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

πŸ“ž Contact

For queries or feedback:


🚧 Future Enhancements

  • IoT sensor integration (RFID, weight sensors)
  • Advanced ML models (LSTM, Prophet) for forecasting
  • Barcode/QR code scanning
  • Native mobile applications (iOS/Android)
  • Multi-warehouse support
  • Supplier API integration
  • Email/SMS notifications
  • Blockchain for supply chain traceability
  • Voice command interface
  • Advanced reporting and analytics

⭐ Star this repository if you find it helpful!

Made with ❀️ by Team SmartShelf

Made with Love BPUT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •