How httpmuhammadsalman/fastauth-shopping works
FastAuth Shop is a demo storefront for creating and updating FastAuth carts, then completing payment in an embedded checkout. Shoppers browse the catalog, manage a locally persisted cart, submit it through the cart API routes, and receive payment confirmation from the checkout iframe. The map also includes the published integration guide. The cart API client and product-card implementations were not sampled; their nodes and connections reflect the documented/runtime roles visible from the tree and callers.
Main entry points: fastauth.ts FastAuth API adapter · cart-context.tsx Cart state · page.tsx Cart and checkout · CheckoutModal.tsx Checkout modal
Components 17
Storefront
- Product listing
src/app/page.tsx - Product cards
src/components/ProductCard.tsx - Product catalog
src/lib/products.ts - App layout
src/app/layout.tsx
Cart management
- Cart and checkout
src/app/cart/page.tsx - Cart state
src/lib/cart-context.tsx - Browser storage
- Cart API client
src/lib/cart-api.ts
FastAuth checkout
- Create cart route
src/app/api/cart/route.ts - Update cart route
src/app/api/cart/[cartId]/route.ts - FastAuth API adapter
src/lib/fastauth.ts - API configuration
src/config/env.ts - Checkout modal
src/components/CheckoutModal.tsx
Integration guide
- Integration guide
src/app/docs/page.tsx
Other components
- Shopper
- FastAuth cart API
- FastAuth checkout
Connections 25
- Shopper → Product listing: browses
- Product listing → Product catalog: renders products
- Product listing → Product cards: renders cards
- Shopper → Product cards: adds products
- Product cards → Cart state: updates cart
- App layout → Cart state: provides state
- Cart state → Product catalog: resolves products
- Cart state → Browser storage: persists cart
- Browser storage → Cart state: restores cart
- Shopper → Cart and checkout: manages cart
- Cart and checkout → Cart state: reads and updates
- Cart and checkout → Cart API client: submits cart
- Cart API client → Create cart route: posts cart
- Cart API client → Update cart route: posts updates
- Create cart route → FastAuth API adapter: builds and sends
- Update cart route → FastAuth API adapter: builds and sends
- FastAuth API adapter → Product catalog: reads prices
- FastAuth API adapter → API configuration: reads settings
- FastAuth API adapter → FastAuth cart API: posts cart
- FastAuth cart API → FastAuth API adapter: returns cart
- Cart and checkout → Checkout modal: opens checkout
- Checkout modal → FastAuth checkout: embeds checkout
- FastAuth checkout → Checkout modal: posts payment event
- Checkout modal → Cart and checkout: reports payment
- Shopper → Integration guide: reads guide