Skip to content

Latest commit

 

History

History
79 lines (71 loc) · 2.75 KB

File metadata and controls

79 lines (71 loc) · 2.75 KB

PriceLens Architecture

System Diagram

Browser
   |
React + TS (frontend)
   |
API Gateway
   |
   +-- Auth Service
   +-- Search Service
   +-- Tracking Service
   +-- Analytics Service
   +-- Notification Service
   |
   +-- PostgreSQL
   +-- Redis
   +-- RabbitMQ
            |
       Celery Workers (scraper-service)
            |
       +-- Amazon Scraper
       +-- Flipkart Scraper

Prometheus scrapes metrics from all services -> Grafana dashboards All services run as containers, orchestrated by Kubernetes

  • Services are split by bounded context (auth, search, tracking, analytics, notifications) so each can be developed, deployed, and scaled independently.
  • Scraping is moved off the request path into Celery workers consuming from RabbitMQ, so a slow/flaky scrape never blocks a user-facing request.
  • Redis sits in front of the scrapers as a cache to avoid redundant scraping and reduce ban risk on Amazon/Flipkart.
  • PostgreSQL is the system of record for users, products, price history, watchlists, and alerts — enabling trend analysis and AI forecasting later.

Folder Structure

pricelens/
├── frontend/
├── services/
│   ├── api-gateway/
│   ├── auth-service/
│   ├── search-service/
│   ├── tracking-service/
│   ├── analytics-service/
│   ├── notification-service/
│   └── scraper-service/
│       ├── scrapers/
│       │   ├── base_scraper.py
│       │   ├── amazon_scraper.py
│       │   └── flipkart_scraper.py
│       ├── tasks/
│       └── workers/
├── infra/
│   ├── docker-compose.yml
│   ├── k8s/
│   ├── prometheus/
│   └── grafana/
├── .github/workflows/
└── docs/

Each backend service internally follows Clean Architecture: api/ (routes) -> services/ (business logic) -> repositories/ (DB access) -> models/ (SQLAlchemy) with schemas/ (Pydantic) for I/O validation.

Project History & Engineering Logs

This system was built incrementally across 19 distinct phases.