You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AI Powered Smart Inventory Management System is a comprehensive, modern web application designed specifically for small retail businesses, particularly Kirana (grocery/convenience) stores. This system transforms traditional manual inventory management into an automated, intelligent, and data-driven process.
Key Objectives
Automation: Eliminate manual ledger entries and error-prone stock counts
Stock Optimization: Proactively identify low-stock items and send alerts
AI-Driven Forecasting: Predict future demand using historical sales patterns
Efficiency Improvement: Streamline checkout, billing, and vendor communication
Data-Driven Decisions: Provide real-time analytics and insightful reports
🏗️ System Architecture
graph TB
subgraph "Frontend (React.js)"
A[User Interface] --> B[Dashboard]
A --> C[Product Management]
A --> D[Sales/POS]
A --> E[Vendor Management]
A --> F[Reports & Analytics]
end
subgraph "AI Components"
G[YOLOv8 Model]
H[TensorFlow.js]
I[Forecasting Algorithm]
end
subgraph "Backend (Node.js/Express)"
J[API Server]
K[Authentication]
L[Business Logic]
M[AI Processing]
end
subgraph "Database (MongoDB Atlas)"
N[Users Collection]
O[Products Collection]
P[Sales Collection]
Q[Vendors Collection]
R[Orders Collection]
end
subgraph "External Services"
S[Vercel Hosting]
T[Render Hosting]
U[Twilio SMS]
V[Nodemailer]
end
A --> J
G --> A
H --> A
I --> M
J --> N
J --> O
J --> P
J --> Q
J --> R
J --> U
J --> V
S --> A
T --> J
Loading
🛠️ Technology Stack
Frontend Technologies
Technology
Version
Purpose
React.js
^19.2.0
Core UI library for component-based interfaces
Vite
^7.3.1
Next-generation frontend tooling and build tool
Tailwind CSS
^4.1.18
Utility-first CSS framework for responsive styling
Framer Motion
^12.34.3
Production-ready animation library
Recharts
^3.7.0
Composable charting library for analytics
React Router
^7.13.0
Client-side routing and navigation
Axios
^1.13.5
HTTP client for API communication
Backend Technologies
Technology
Version
Purpose
Node.js
-
Asynchronous JavaScript runtime environment
Express.js
^5.2.1
Fast, minimalist web framework for REST APIs
MongoDB
^9.2.1
NoSQL database for flexible document storage
JWT
^9.0.3
JSON Web Tokens for authentication
bcryptjs
^3.0.3
Password hashing and security
Nodemailer
^8.0.1
Email sending functionality
Twilio
^5.12.2
SMS notifications and alerts
AI/ML Technologies
Technology
Purpose
YOLOv8
Real-time computer vision for product/barcode scanning
TensorFlow.js
Browser-based machine learning inference
Custom Algorithm
Demand forecasting and inventory optimization
✨ Features & Modules
🏠 Dashboard Module
Real-time KPIs: Total revenue, profit metrics, product count
Low Stock Alerts: Automated notifications for critical items
# Navigate to client directorycd client
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
Backend Setup
# Navigate to server directorycd server
# Install dependencies
npm install
# Create .env file
touch .env
# Add environment variables
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
PORT=5000
# Start development server
npm run dev
# Start production server
npm start
sequenceDiagram
participant U as User
participant F as Frontend
participant B as Backend
participant DB as Database
U->>F: Enter registration details
F->>B: POST /api/auth/register
B->>DB: Check if user exists
DB-->>B: User status
B->>DB: Create new user
DB-->>B: User created
B->>B: Generate JWT token
B-->>F: User data + token
F->>F: Store token in localStorage
F-->>U: Redirect to dashboard
Loading
Sales Process Flow
sequenceDiagram
participant U as User
participant F as Frontend
participant B as Backend
participant DB as Database
participant AI as AI Scanner
U->>F: Start new sale
U->>AI: Scan product barcode
AI->>F: Product identified
F->>B: GET /api/products/:id
B->>DB: Fetch product
DB-->>B: Product data
B-->>F: Product details
F->>F: Add to cart
U->>F: Complete checkout
F->>B: POST /api/sales
B->>DB: Create sale record
B->>DB: Update product quantity
DB-->>B: Sale created & stock updated
B-->>F: Success response
F-->>U: Receipt generated
Loading
AI Forecasting Process
flowchart TD
A[Historical Sales Data] --> B[Data Aggregation]
B --> C[Moving Average Calculation]
C --> D[Seasonal Adjustment]
D --> E[Trend Analysis]
E --> F[Demand Prediction]
F --> G[Reorder Suggestion]
G --> H[Update Product Record]
H --> I[Alert User if Needed]
style A fill:#e1f5fe
style G fill:#c8e6c9
style I fill:#ffecb3
Loading
🤖 AI Components
YOLOv8 Barcode Scanner
Purpose: Real-time product identification using camera
Technology: YOLOv8 model running in browser via TensorFlow.js
Workflow:
Access device camera via WebRTC
Continuously process video frames
Detect and localize barcodes/products
Extract barcode data
Match with product database
Auto-add to POS cart
Demand Forecasting Algorithm
Purpose: Predict future product demand
Methodology:
Historical Analysis: Analyze past sales data
Moving Average: Calculate 7/30-day averages
Seasonal Adjustment: Account for seasonal patterns
Trend Detection: Identify growth/decline trends
Reorder Calculation: Generate optimal order quantities
🔒 Security Features
Authentication & Authorization
JWT Tokens: Secure API authentication
Password Hashing: bcrypt for secure password storage
Role-Based Access: Different access levels for users