dikodev/cart-abandonment-rti

This repo is for buidling a Cart Abandonment solution using an e-commerce website built with HTML & JavaScript to send cart events to Microsoft Fabric using an eventstream. It also sends push notifications to the site using an Activator alert and User Data Function.

โ˜… 0Forks 0HTMLGitHub โ†—Compare
activatorcarteventstreamfabrichtml5javascriptpythonrealtimeintelligenceudf

README

Zava Retail - Cart Abandonment RTI

A modern retail demo site for capturing shopping journey events and cart-abandonment signals, then forwarding them through Azure Event Hubs using Entra ID authentication. In the current setup, those Event Hub details often come from a Microsoft Fabric Eventstream, which exposes the Event Hub-compatible namespace and event name the app needs.

๐ŸŽฏ What This Project Is

This repository is a retail demo application plus supporting documentation for a real-time intelligence scenario. It shows how a storefront can capture shopping activity, send those events into a streaming pipeline, and connect that flow to downstream analytics and monitoring.

The code in this repo focuses on the application-facing parts of the solution:

  • a multi-page storefront that simulates customer browsing and cart activity,
  • an Express backend that receives those events and publishes them to an Event Hub-compatible endpoint,
  • browser-side retry, offline queue, simulator, and push notification support, and
  • documentation for the wider Fabric and Azure architecture around the app.

The repo is intentionally structured in layers:

  • The website and backend API simulate the retail experience and publish user journey events.
  • Azure and Fabric services handle ingestion, automation, analytics, and monitoring.
  • The docs/ folder is the system-level documentation area for architecture, provisioning, validation, and component responsibilities.

๐Ÿ›๏ธ Business Scenario

The demo models a retail journey where a visitor browses products, adds items to a cart, starts checkout, and either completes or abandons the session. The goal is to capture those interactions as events early enough that the business can react while the customer journey is still relevant.

Those events are routed into a real-time platform so the solution can:

  • detect relevant customer behavior,
  • trigger downstream processing,
  • store analytical data for investigation and reporting, and
  • visualize the outcome in a real-time dashboard.

In practical terms, this repo supports demos and experiments around questions like:

  • Which product interactions happened before a cart was abandoned?
  • When should a downstream workflow or alert be triggered?
  • How can those events be landed for analysis and shown on an operational dashboard?

๐Ÿ—๏ธ High-Level Architecture

At a high level, the solution has four layers:

  1. Customer experience layer: the website captures browsing, cart, checkout, and purchase events.
  2. Application integration layer: the backend API validates requests and publishes events using Entra ID and the Azure Event Hubs SDK.
  3. Real-time processing layer: Eventstream and related downstream components route, evaluate, and enrich the event flow.
  4. Analytics and monitoring layer: Eventhouse and the dashboard store, query, and visualize the resulting data.
Website -> Azure Web App API -> Eventstream -> Activator Alert -> User Data Function -> Eventhouse -> Real-Time Dashboard (coming soon)

High-Level Architecture Diagram

This is the intended end-to-end architecture. The storefront and backend API are implemented in this repository today, while the broader Fabric and Azure components are documented in docs/ so the full system can be provisioned and explained consistently.

๐Ÿงฉ Solution Components

  • Website and backend API for browsing, cart activity, event publishing, and notification handling
  • Eventstream for real-time ingestion and routing
  • User data function for downstream processing or enrichment
  • Activator alert for detecting conditions and triggering actions
  • Eventhouse for analytical storage and query scenarios
  • Real-time dashboard for monitoring business activity and outcomes (coming soon)

๐Ÿ“š Where To Go Next

If you are new to the repo, use this path:

  1. README.md for the project overview and system entry point.
  2. SETUP_GUIDE.md to run the app locally or prepare for deployment.
  3. docs/ for system-level documentation covering component responsibilities.

๐Ÿงช Testing with Simulator Mode

  1. Start the app and open products.html.
  2. Click the Simulator control in the top bar.
  3. Use one of the built-in actions:
    • Generate 5 Events
    • Generate 20 Events
    • Simulate Full Journey
  4. Watch the simulator log in the panel and the backend logs in the terminal.

๐Ÿ“š Additional Resources

๐Ÿ“„ License

MIT License - feel free to use this project for learning and development purposes.

Contributors

dikodev

Issues