Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StoreSight

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.

Highlights

  • 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.

Architecture

  • 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.

Quick start

cp .env.example .env
# optionally place a demo video at samples/store-demo.mp4
# or change WORKER_CAMERA_SOURCE in .env

docker compose up --build

Open http://localhost:8080.

Default demo credentials

  • Email: admin@shopalytics.local
  • Password: ChangeMe123!

These credentials are seeded automatically by the backend on startup when the user collection is empty.

Local development

Backend

cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
flask --app run.py --debug run

Frontend

cd frontend
npm install
npm run dev

CV worker

cd cv_worker
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m app.main

Core analytics model

The 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

Deployment notes

  • Nginx proxies /api and /socket.io to 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.

Resume bullet idea

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.

About

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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages