Every unsold item is a missed opportunity. SmartStockX is an intelligent stock revival engine designed to tackle inventory inefficiency head-on. By leveraging machine learning for demand prediction, it provides actionable insights on dynamic pricing and suggests optimal inter-store transfers, minimizing waste and maximizing profitability. This project was originally developed for the Walmart Sparkathon 2025.
Retail inventory management is a high-stakes balancing act. Overstocking leads to tied-up capital, increased holding costs, and potential losses from expired or obsolete products. Understocking results in lost sales and dissatisfied customers. SmartStockX addresses the critical need for a data-driven approach.
By using predictive analytics, SmartStockX transforms inventory management from a reactive process to a proactive strategy. It empowers retailers to make smarter, faster decisions, ensuring the right product is at the right place, at the right time, and at the right price. This closes critical gaps in manual forecasting and prevents losses due to preventable stock imbalances.
SmartStockX addresses this critical issue by:
π§ Predicting Future Demand: Utilizes a Random Forest machine learning model to forecast product demand based on historical sales, stock levels, and shelf life.
πΈ Optimizing Prices Dynamically: Automatically calculates and suggests discounts for items nearing expiry or facing low demand, helping to clear stock and recover potential losses before they occur.
π Suggesting Smart Transfers: Identifies stores with surplus stock ("donors") and those with deficits ("receivers"), then recommends optimized transfer routes to rebalance inventory across locations efficiently.
π Providing Actionable Analytics: Delivers a clear, intuitive dashboard with key metrics on projected revenue, potential losses, and overall inventory health, turning raw data into strategic insights.
By automating predictions and centralizing inventory intelligence, SmartStockX ensures that no sale is missed and no product is wasted due to preventable forecasting errors.
SmartStockX is built using a modern full-stack architecture combining Python's data science capabilities with a responsive JavaScript frontend.
- Python β Core backend language.
- Django & Django REST Framework β For building a robust and scalable REST API.
- PostgreSQL β Powerful, open-source object-relational database system.
- Scikit-learn β For implementing the Random Forest machine learning model for demand prediction.
- Pandas β For high-performance, easy-to-use data structures and data analysis.
- Gunicorn β As the WSGI HTTP server for production deployment.
- React.js β Core UI library for building an interactive and component-based user interface.
- Vite β Next-generation frontend tooling for a blazing-fast development experience.
- Tailwind CSS β A utility-first CSS framework for rapidly building custom designs.
- Axios β For handling all frontend HTTP requests to the backend API.
- Chart.js β To create beautiful and informative charts for the analytics dashboard.
- Lucide React β For a clean and consistent icon library.
- Vercel β For hosting the frontend, providing fast performance and global CDN support.
- Render β For hosting the backend Django application and PostgreSQL database, with auto-scaling capabilities.
The backend exposes a simple REST API to run the engine and fetch results.
POST /api/run/
Runs the entire SmartStockX engine. Requires inventory_file and distance_file as multipart/form-data. It processes the data, runs predictions, and saves the results to the database.
GET /api/inventory/
Fetches the complete, processed inventory data, including predicted demand and optimized pricing.
GET /api/transfers/
Fetches all the suggested inter-store transfers generated by the engine.
Follow the steps below to run SmartStockX locally on your machine.
- Python (v3.8+ recommended)
- Node.js (v18+ recommended)
- PostgreSQL (Local instance or cloud-hosted)
- Package managers: pip and npm
git clone https://github.com/Sudhanshu-NITR/SmartStockX.git
cd SmartStockXcd Backend/SmartStockX
# It's recommended to create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txtcd ../../Frontend/SmartStockX
npm installThe backend requires a .env file in the Backend/SmartStockX/ directory. Create one and add the following variables:
# Django Secret Key (generate a new one for production)
DJANGO_SECRET_KEY='your-django-secret-key'
# Debug mode
DJANGO_DEBUG=True
# PostgreSQL Database Connection URL
# Example: postgresql://USER:PASSWORD@HOST:PORT/DB_NAME
DATABASE_URL='your_postgresql_connection_string'The frontend requires a .env.local file in the Frontend/SmartStockX/ directory:
# URL of your locally running backend server
VITE_API_BASE_URL=http://127.0.0.1:8000Make sure your PostgreSQL server is running. In a terminal, navigate to the backend directory and run:
cd Backend/SmartStockX
python manage.py migrate
python manage.py runserverYour backend will be live at http://127.0.0.1:8000.
In a new terminal window, navigate to the frontend directory and run:
cd Frontend/SmartStockX
npm run devYour frontend will be live at http://localhost:5173.
- Real-Time Data Integration: Connect directly with Point-of-Sale (POS) systems for real-time inventory updates.
- Enhanced ML Models: Incorporate more complex models (e.g., LSTMs) that account for seasonality, holidays, and promotional events.
- Supplier Recommendations: Extend the engine to suggest optimal restocking orders directly to suppliers.
- UI/UX Enhancements: Introduce more granular filtering, sorting, and data visualization options on the frontend.
- Automated Execution: Add functionality to automatically execute approved transfers and price changes in the inventory system.
This project was developed as a team submission for the Walmart Sparkathon 2025. The project reflects our combined efforts across machine learning, backend, frontend, database design, and deployment.
Team Members:
- Santoshi Sambhumahanati Santoshi-2k24
- Charishma Gowdu Charishma-Gowdu
- Sriya Akepati hiSriya
- Sudhanshu Kadam Sudhanshu-NITR


