How nithyakumaresan231-lang/online-shopping-counter works
This repository implements online-shopping transaction streaming analytics. The principal workflow publishes CSV records to Kafka, parses and enriches the stream with Spark, computes streaming metrics, persists analytics artifacts, and presents them in a Streamlit dashboard. Analytics also maintains transaction history and provides KPI, category, city, payment, status, and time-window aggregations. The excerpts show the producer, stream entry point, aggregation and dashboard data-loading layers; some dashboard wiring and deployment details are not represented here.
Main entry points: aggregations.py Streaming Aggregations · producer.py Kafka Producer · spark_stream.py Spark Stream · output Analytics Artifacts
Components 10
Transaction Ingestion
- Transaction CSV
data/ecommerce_transactions.csv - Kafka Producer
producer/producer.py - Kafka Topic
Stream Processing
- Spark Stream
streaming/spark_stream.py - Transaction Schemas
analytics/schemas.py
Analytics
- Streaming Aggregations
analytics/aggregations.py - Analytics Artifacts
output
Dashboard
- Dashboard Data Loader
dashboard/data_loader.py - Streamlit Dashboard
dashboard/dashboard.py
Other components
- Operator
Connections 10
- Operator → Kafka Producer: starts publishing
producer/producer.py - Transaction CSV → Kafka Producer: reads rows
producer/producer.py - Kafka Producer → Kafka Topic: publishes JSON
producer/producer.py - Kafka Topic → Spark Stream: streams records
streaming/spark_stream.py - Spark Stream → Streaming Aggregations: starts analytics
streaming/spark_stream.py - Streaming Aggregations → Transaction Schemas: uses schema
analytics/aggregations.py - Streaming Aggregations → Analytics Artifacts: writes metrics
analytics/aggregations.py - Analytics Artifacts → Dashboard Data Loader: loads metrics
dashboard/data_loader.py - Dashboard Data Loader → Streamlit Dashboard: provides dashboard data
dashboard/dashboard.py - Streamlit Dashboard → Operator: displays analytics
dashboard/dashboard.py