A microservices-based retail analytics system that provides sales forecasting, inventory insights, and decision support using machine learning.
This project is designed to help retail businesses make data-driven decisions by analyzing sales data, predicting future demand, and generating actionable recommendations.
The system separates core API logic and ML processing into independent services for better scalability and maintainability.
- Frontend: Next.js dashboard for analytics and visualization
- Backend: Node.js + Express REST API
- AI Engine: Python (FastAPI) for forecasting and recommendations
- Database: PostgreSQL
- Cache: Redis
- Deployment: Docker + Docker Compose + Nginx
The ML service is isolated as a separate microservice to allow independent scaling and model updates without affecting backend performance.
- Sales forecasting using time-series models (ARIMA, Moving Average, Linear Regression)
- Inventory analysis with stock-level insights
- Recommendation system (restock, discount, investigate)
- Scenario simulation for revenue impact
- REST APIs for data retrieval and predictions
- Interactive dashboard for visualization
- Backend: Node.js, Express
- Frontend: Next.js, React
- AI/ML: Python, FastAPI, Pandas, NumPy, statsmodels
- Database: PostgreSQL
- Caching: Redis
- DevOps: Docker, Nginx
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend API │ │ AI Engine │
│ (Next.js) │◄──►│ (Node.js) │◄──►│ (Python) │
│ │ │ │ │ │
│ - Dashboard │ │ - REST API │ │ - ML Models │
│ - Analytics │ │ - Auth │ │ - Forecasting │
│ - Inventory │ │ - Validation │ │ - Scenarios │
│ - Recommendations│ │ - Recommendations │ │ - Export API │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
│
┌─────────────────┐
│ Data Layer │
│ │
│ - PostgreSQL │
│ - Redis Cache │
│ - File Storage │
└─────────────────┘
git clone cd retail-intelligence-engine
cp .env.example .env
docker compose up --build
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
- AI Engine: http://localhost:8000
- Forecast future sales for products
- Identify low-stock or overstock situations
- Generate recommendations based on trends
- Simulate revenue impact for different scenarios
- API details:
API_DOCUMENTATION.md - Deployment guide:
DEPLOYMENT.md
- Designed a microservices architecture separating ML and backend logic
- Integrated ML models into a production-style API workflow
- Used Redis caching to improve performance
- Containerized services using Docker for easier deployment
This project focuses on system design and ML integration rather than optimizing model accuracy.