← Back to index

save-n-subscribe

Repo: save-n-subscribe

Summary

Frontend JavaScript widget for Shopify product pages that fetches subscription plans, injects a “Subscribe & Save” button, shows a plan-selection modal, and initiates checkout by calling a Shiprocket checkout handler with encoded subscription metadata. Built and bundled with esbuild and deployed as static assets to Cloudflare Pages.

Responsibilities

Dependencies

Architecture Diagram

save-n-subscribe architecture diagram

Mermaid Source

flowchart LR
  U[Shopper Browser] --> P[Shopify Product Page]
  P --> W[save-n-subscribe Widget JS]
  W --> API[Subscription Plan API]
  W --> SR[Shiprocket Checkout Handler]
  W --> LS[Browser localStorage]
  CF[Cloudflare Pages] --> P

DFD Diagram

save-n-subscribe DFD diagram

Mermaid Source

flowchart TB
  E1[External Entity: Shopper Browser] --> P1[Process: Widget Init & UI]
  E2[External Entity: Shopify Storefront] --> P1
  D1[Data Store: Browser localStorage] --> P2[Process: Fetch Subscription Plans]
  P1 --> P2
  P2 --> E3[External Entity: Subscription Plan API]
  E3 --> P2
  P2 --> P3[Process: Render Button & Modal]
  P3 --> P4[Process: Initiate Checkout]
  P4 --> E4[External Entity: Shiprocket Checkout]
  P3 --> E1