How astermd/storefront-node works
AsterMD Storefront is a server-rendered telehealth commerce application. The principal journey runs from product discovery and cart through definition-driven clinical intake, optional identity verification, payment checkout, optional upsells, and a receipt. Internal layers include funnel routing, journey/session state, and persistence. The README documents the broad workflow and integrations; the shown source excerpts confirm selected controller, checkout, session-store, and browser-form interactions. Many listed modules were not sampled, so edges between those stages rely on the README rather than inspected implementation.
Main entry points: checkout.service.ts Checkout service · intake-session.ts Intake forms · funnel-router.ts Funnel routing · upsell-service.ts Post-purchase upsells
Components 24
Storefront journey
- Product catalog
src/catalog/catalog-builder.ts - Cart
src/domain/cart.ts - Funnel routing
src/domain/funnel-router.ts - Journey state
src/journey/journey-state.ts - Session persistence
src/repository/session-repository.ts
Clinical workflow
- Intake forms
src/forms/intake-session.ts - Browser form engine
public/js/intake-engine.js - Eligibility rules
src/forms/disqualification.ts - Identity verification
src/verification/identity-verification-sequence.ts
Checkout and orders
- Checkout route
src/routes/checkout/checkout.controller.ts - Checkout service
src/checkout/checkout.service.ts - Payment adapters
src/payment/payment-adapter.ts - Order recording
src/checkout/database-order-recorder.ts - Post-purchase upsells
src/upsell/upsell-service.ts - Receipt
src/completion/receipt.ts
Platform and operations
- AsterMD gateways
src/emr - SEO routes
src/seo - Reconciliation
src/reconciliation/forward-reconciliation.ts - Operations commands
src/console - Deployment config
config/app.ts
Other components
- Visitor
- Payment aggregator
- AsterMD platform
- Application database
Connections 25
- Visitor → Product catalog: browses
- Product catalog → Cart: adds products
- Cart → Intake forms: starts intake
- Intake forms → Browser form engine: renders questionnaire
- Browser form engine → Intake forms: posts answers
public/js/intake-engine.js - Intake forms → Eligibility rules: checks eligibility
- Eligibility rules → Funnel routing: routes outcome
src/domain/funnel-router.ts - Funnel routing → Identity verification: may require
src/domain/funnel-router.ts - Funnel routing → Checkout route: routes to checkout
src/domain/funnel-router.ts - Checkout route → Checkout service: invokes
src/routes/checkout/checkout.controller.ts - Checkout service → Cart: reads cart
src/checkout/checkout.service.ts - Checkout service → Journey state: reads journey
src/checkout/checkout.service.ts - Journey state → Session persistence: persists state
src/repository/session-repository.ts - Checkout service → Payment adapters: places charge
src/checkout/checkout.service.ts - Payment adapters → Payment aggregator: sends payment
- Checkout service → Order recording: records order
- Order recording → Application database: writes order
- Checkout service → AsterMD gateways: reports funnel events
src/checkout/checkout.service.ts - AsterMD gateways → AsterMD platform: calls platform
- Checkout service → Post-purchase upsells: continues purchase
- Post-purchase upsells → Payment aggregator: charges again
- Post-purchase upsells → Receipt: finishes at
- Visitor → SEO routes: requests pages
- Operations commands → Reconciliation: runs sweeps
- Deployment config → Identity verification: configures checks
config/app.ts