StoreSight is a production-oriented retail analytics platform that combines a Flask API, React dashboard, MongoDB analytics store, Redis-backed real-time messaging, and a YOLOv8-powered computer vision-worker.
- Real-time occupancy, zone traffic, entry events, dwell metrics, and recent detections.
- Privacy-first telemetry pipeline: the worker stores structured observations instead of raw video.
- Production-minded architecture with Docker, Nginx, health checks, Prometheus metrics, and CI.
- Resume-quality modular codebase with backend tests, frontend type-safe patterns, and deployable containers.
- frontend/: React + Vite dashboard.
- backend/: Flask REST API + Flask-SocketIO + MongoDB aggregations.
- cv_worker/: YOLOv8 / fallback demo analytics worker.
- infra/nginx/: Reverse proxy serving the frontend and API.
- samples/: local sample fixtures.
cp .env.example .env
# optionally place a demo video at samples/store-demo.mp4
# or change WORKER_CAMERA_SOURCE in .env
docker compose up --buildOpen http://localhost:8080.
- Email:
admin@shopalytics.local - Password:
ChangeMe123!
These credentials are seeded automatically by the backend on startup when the user collection is empty.
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
flask --app run.py --debug runcd frontend
npm install
npm run devcd cv_worker
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m app.mainThe worker emits and persists:
observations: timestamped person-track events with bbox, centroid, zone, and confidence.metric_snapshots: periodic store-level metrics such as occupancy and entries.zones: normalized polygons for in-store regions.
Historical endpoints aggregate these collections to return:
- Time-series occupancy
- Zone dwell summaries
- Recent events feed
- Dashboard KPIs
- Nginx proxies
/apiand/socket.ioto the backend. - Redis is used as the Socket.IO message queue, allowing horizontal API scale.
- MongoDB TTL indexes expire old observations and metric snapshots.
- The worker supports a fallback synthetic mode if Ultralytics/OpenCV/video input are unavailable.
Built a production-ready retail analytics platform using React, Flask, MongoDB, Redis, Docker, and YOLOv8 to track in-store traffic, stream real-time occupancy metrics, and compute customer movement insights from camera telemetry.