FL
flexycode/ecommerce-analytics
π€ Real-time analytics platform for e-commerce businesses with AI-powered sales predictions and inventory management.
E-commerce Analytics Dashboard
Real-time analytics platform for e-commerce businesses with AI-powered sales predictions and inventory management.
β¨ Features
- π Real-time Analytics Dashboard - Monitor sales, revenue, and inventory with sub-second latency
- π€ AI-Powered Predictions - Machine learning models for sales forecasting and inventory optimization
- π¦ Inventory Management - Real-time stock tracking with automated low-stock alerts
- π¨ Customizable Dashboards - Drag-and-drop widgets to build personalized analytics views
- π GDPR/CCPA Compliant - Built-in privacy controls for data export, deletion, and consent management
- β‘ WebSocket Real-time Updates - Live data streaming for instant dashboard updates
π― Key Outcomes
| Metric | Target |
|---|---|
| Sales Conversion Increase | 30% |
| Inventory Tracking | Real-time (<1s latency) |
| Dashboard Customization | 100% user personalization |
οΏ½ Screenshots
Landing Page

Premium landing page with animated gradients, feature highlights, and technology stack showcase
Analytics Dashboard

Real-time dashboard with metrics cards, sales charts, recent orders, low stock alerts, and AI predictions
οΏ½π οΈ Technology Stack
| Layer | Technology |
|---|---|
| Frontend | Next.js 14+, TypeScript, Tailwind CSS |
| Backend | NestJS, TypeORM, Socket.io |
| Database | PostgreSQL 16 |
| Cache | Redis 7 |
| ML Service | Python, Flask, NumPy, Pandas |
| Container | Docker, Docker Compose |
| Orchestration | Kubernetes |
π Project Structure
ecommerce-analytics/
βββ src/ # Next.js Frontend
β βββ app/ # App Router pages
β β βββ dashboard/ # Dashboard pages
β β βββ ...
β βββ components/ # React components
β βββ dashboard/ # Dashboard-specific components
βββ backend/ # NestJS Backend
β βββ src/
β βββ modules/
β β βββ analytics/ # Real-time analytics
β β βββ auth/ # JWT authentication
β β βββ cache/ # Redis caching
β β βββ inventory/ # Stock management
β β βββ predictions/ # AI forecasting
β β βββ privacy/ # GDPR compliance
β β βββ sales/ # Sales data
β βββ common/ # Shared utilities
βββ ml-service/ # Python ML Service
βββ k8s/ # Kubernetes manifests
βββ docker-compose.yml # Local development
βββ docs/ # Documentation
π Quick Start
Prerequisites
- Node.js 18+
- Docker & Docker Compose
- PostgreSQL 16 (or use Docker)
- Redis 7 (or use Docker)
1. Clone and Install
# Clone the repository
git clone https://github.com/yourusername/ecommerce-analytics.git
cd ecommerce-analytics
# Install frontend dependencies
npm install
# Install backend dependencies
cd backend && npm install && cd ..2. Environment Setup
# Copy environment files
cp backend/env.example backend/.env
# Edit .env with your configuration
# See env.example for all options3. Start with Docker Compose (Recommended)
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f4. Or Start Manually
# Terminal 1: Start PostgreSQL and Redis
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:16-alpine
docker run -d -p 6379:6379 redis:7-alpine
# Terminal 2: Start backend
cd backend && npm run start:dev
# Terminal 3: Start frontend
npm run dev
# Terminal 4: Start ML service
cd ml-service && python app.py5. Access the Application
- Frontend Dashboard: http://localhost:3000
- Backend API: http://localhost:4000
- API Documentation: http://localhost:4000/api/docs
- ML Service: http://localhost:5000
π API Documentation
The API is documented with Swagger/OpenAPI. Access the documentation at:
http://localhost:4000/api/docs
Key Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
User login |
| GET | /api/analytics/dashboard |
Get dashboard metrics |
| GET | /api/sales |
List sales with pagination |
| GET | /api/sales/metrics |
Get sales metrics |
| GET | /api/inventory/products |
List products |
| GET | /api/predictions/forecast |
Get AI predictions |
| GET | /api/privacy/export |
Export user data (GDPR) |
βΈοΈ Kubernetes Deployment
# Apply all manifests
kubectl apply -f k8s/
# Check deployments
kubectl get pods
# Check services
kubectl get services
# View HPA status
kubectl get hpaπ§ͺ Testing
# Frontend tests
npm run test
# Backend tests
cd backend && npm run test
# E2E tests
npm run test:e2eπ Performance Targets
| Metric | Target |
|---|---|
| Dashboard Load Time | < 2 seconds |
| Real-time Update Latency | < 1 second |
| API Response Time (95th) | < 200ms |
| System Uptime | 99.9% |
π Security & Compliance
- Authentication: JWT-based with secure token management
- Authorization: Role-based access control (RBAC)
- Data Encryption: TLS 1.3 in transit, encrypted at rest
- GDPR Compliance: Data export, deletion, consent management
- CCPA Compliance: Privacy rights dashboard
π€ Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by Jay Arre P. Talosig for data-driven e-commerce success
On this page
Languages
TypeScript86.9%Python6.4%CSS4.4%Dockerfile1.8%JavaScript0.5%
Contributors
MIT License
Created January 10, 2026
Updated January 12, 2026