How helloyug/noteflow works
1. Overall shape
NoteFlow is a three-part system: a static frontend, a Google Apps Script backend, and Google Sheets/Drive as the data and file layer. The frontend never talks to Sheets directly; all product, order, and delivery actions go through the Apps Script web app.
2. Frontend presentation layer
The UI is split into page-specific HTML files: index.html for the landing page, and pages/notes.html, pages/buy.html, and pages/contact.html for the storefront, purchase flow, and support page. Each page has its own CSS file under assets/css/, with global.css for shared styling and page files for layout-specific visuals.
3. Client-side application modules
The behavior is organized into small vanilla-JS modules under assets/js/. api.js is the backend gateway, config.js holds deployment URLs, utils.js and ui.js provide shared helpers/rendering, theme.js manages dark/light mode persistence, qr.js generates UPI QR codes, and notes.js, buy.js, home.js, contact.js, and filters.js drive page-specific interactions.
4. Catalog browsing flow
The notes storefront is driven by data fetched from Google Sheets via Apps Script. notes.html uses the JS modules to render cards, apply search/filtering, and sort results. The sheet-backed catalog is the primary content source, with visible, featured, tags, and date/price fields shaping what the user sees.
5. Purchase flow
The buy page is the transaction hub. It reads the selected product’s data, shows note details, generates a UPI payment QR from the configured payee and amount, and collects buyer details plus a payment screenshot before submitting the order to the backend.
6. Backend orchestration
gas/Code.gs is the serverless control plane. It exposes the web app endpoints used by the frontend, validates inputs, appends new orders, handles screenshot uploads, and reacts to admin edits in the sheet to trigger delivery actions. The backend also centralizes sanitization and quota checks.
7. Google Sheets as CMS and order database
The spreadsheet is the operational source of truth. notes_db stores storefront content and product metadata, orders stores purchase records and verification state, and config stores runtime settings like UPI ID, delivery mode, email templates, support email, and Drive folder IDs. This makes the app mostly configuration-driven.
8. Google Drive as secure file storage
Drive stores two sensitive file types: the premium PDFs for sale and buyer payment screenshots. PDFs remain restricted until an order is verified, while screenshots are uploaded into a private folder referenced by the screenshots_folder_id config value.
9. Verification and delivery boundary
Order state changes are controlled manually in the orders sheet. When an admin marks a payment as verified, Apps Script detects the change and performs fulfillment based on config: email attachment delivery or Drive-based sharing. That means verification is the handoff between human review and automated delivery.
10. Caching and quota protection
Because Apps Script has execution limits, the catalog payload is cached in CacheService and refreshed when the sheet changes. This creates a read-optimized path for storefront browsing, while write paths like order submission and delivery remain more controlled and quota-sensitive.
11. Support/contact integration
The contact page is separate from the notes/order pipeline. It uses static contact details plus an external Formspree endpoint for message capture, so support traffic does not depend on the Sheets backend.
12. Deployment model
The frontend is purely static and is designed to work with relative paths, so it can be hosted on GitHub Pages, Netlify, or similar platforms. The backend is deployed as a Google Apps Script web app, and assets/js/config.js is where the frontend is pointed at the live Apps Script URL.
13. Operational focus
The repo is built around a “spreadsheet CMS + serverless fulfillment” pattern rather than a traditional app server. The key architectural boundary is: frontend for presentation and input, Sheets for editable business data, Apps Script for logic and automation, and Drive for protected file assets.
Main entry points: Code.gs Apps Script · buy.html Buy page · api.js API gateway · notes.html Notes shop
Components 20
Frontend
Static pages, styling, and client-side modules.
- Landing · Static entry page.
index.html - Notes shop · Catalog browsing and filtering page.
pages/notes.html - Buy page · Purchase and checkout page.
pages/buy.html - Contact · Support and contact page.
pages/contact.html - Global CSS · Shared styling across pages.
assets/css/global.css - Page CSS · Page-specific layout and visuals.
assets/css/notes.css - API gateway · Frontend bridge to the Apps Script backend.
assets/js/api.js - UI helpers · Shared rendering and interface helpers.
assets/js/ui.js - Catalog logic · Loads, filters, sorts, and renders notes.
assets/js/notes.js - Checkout logic · Handles selected product and purchase flow.
assets/js/buy.js - Contact logic · Handles contact page interactions.
assets/js/contact.js - Theme mode · Manages dark/light theme persistence.
assets/js/theme.js - UPI QR · Generates payment QR codes.
assets/js/qr.js - Deployment config · Holds backend URL and runtime settings.
assets/js/config.js
Backend
Google Apps Script control plane and fulfillment logic.
- Apps Script · Web app endpoints, validation, order handling, and fulfillment.
gas/Code.gs
Data layer
Sheets and Drive-backed operational storage.
- Notes sheet · Catalog content and product metadata.
Project NoteFlow.xlsx - Orders sheet · Purchase records and verification state.
Project NoteFlow.xlsx - Config sheet · Runtime settings, templates, and IDs.
Project NoteFlow.xlsx - Drive assets · Premium PDFs and uploaded payment screenshots.
External services
Third-party endpoints and delivery channels.
- Formspree · Captures contact messages outside the backend.
Connections 32
- Landing → Global CSS: styles · Shared page styling.
- Landing → Theme mode: theme · Applies persistent theme mode.
- Landing → UI helpers: ui · Shared interface rendering.
- Notes shop → Global CSS: styles · Shared page styling.
- Notes shop → Page CSS: page styles · Catalog page visuals.
- Notes shop → API gateway: data · Fetches catalog data through backend.
- Notes shop → Catalog logic: behavior · Catalog browsing logic.
- Buy page → Global CSS: styles · Shared page styling.
- Buy page → Page CSS: page styles · Checkout page visuals.
- Buy page → API gateway: data · Submits order and fetches product data.
- Buy page → Checkout logic: behavior · Checkout flow logic.
- Buy page → UPI QR: payment · Builds UPI payment QR.
- Contact → Global CSS: styles · Shared page styling.
- Contact → Page CSS: page styles · Support page visuals.
- Contact → Contact logic: behavior · Contact form interactions.
- Deployment config → Apps Script: endpoint · Points the frontend at the live Apps Script web app.
- API gateway → Apps Script: requests · Backend gateway for catalog and orders.
- Catalog logic → API gateway: reads · Loads catalog data.
- Checkout logic → API gateway: submits · Sends order and verification data.
- Checkout logic → Deployment config: config · Uses deployment and payment settings.
- Catalog logic → UI helpers: renders · Uses shared UI helpers.
- Checkout logic → UI helpers: renders · Uses shared UI helpers.
- Contact logic → Formspree: messages · Sends support submissions externally.
- Apps Script → Notes sheet: catalog · Reads storefront content and metadata.
- Apps Script → Orders sheet: orders · Appends and updates purchase records.
- Apps Script → Config sheet: settings · Reads runtime configuration.
- Apps Script → Drive assets: files · Stores screenshots and serves protected PDFs.
- Apps Script → Orders sheet: verify · Detects admin verification changes.
- Apps Script → Drive assets: deliver · Shares attachments or file access after verification.
- Notes sheet → Catalog logic: catalog data · Source data for browse and filter UI.
- Orders sheet → Apps Script: state · Order verification boundary.
- Config sheet → Apps Script: runtime config · Delivery mode, templates, IDs, and UPI settings.