How alexandergdlc/casaideas-ayacucho works
CASAIDEAS AYACUCHO is a Spanish-language storefront for stationery and desk accessories, served by Cloudflare Workers. The customer journey is catalog discovery, cart and checkout, payment, order recording, then customer notifications; the README confirms D1-backed catalog, stock and orders, R2 media, and a demo payment mode that records orders without charging. Admin APIs, search, content, shipping, refunds, and MCP tools are distinct supporting capabilities. Some routes and subsystems are only represented by paths or index references, so uncertain wiring is omitted or marked dashed.
Main entry points: admin Admin APIs · products/index.ts Catalog API · recordWebhook.ts Order event handling · payments/index.ts Payment providers
Components 23
Storefront & discovery
- Storefront views
src/features/storefront - Catalog API
src/pages/api/products/index.ts - Catalog query
src/features/catalog/query.ts - Product search
src/features/products/search.ts - Search engine
src/features/search
Commerce lifecycle
- Cart API
src/pages/api/cart.ts - Checkout API
src/pages/api/checkout.ts - Payment providers
src/features/payments/index.ts - Payment webhook
src/pages/api/webhook.ts - Order event handling
src/features/orders/recordWebhook.ts - Orders & reservations
src/features/orders/db.ts - Email outbox
src/features/email/outbox.ts - Product catalog
src/features/products/db.ts - Shipping
src/features/shipping - Refunds
src/features/refunds/db.ts
Management & content
- Admin APIs
src/pages/api/admin - Pages & navigation
src/features/pages
Runtime & integrations
- Store settings
src/features/settings/db.ts - Media storage
src/features/storage - MCP tools
mcp/src/index.ts - Cloudflare D1
- Cloudflare R2
Other components
- Shopper
Connections 29
- Shopper → Storefront views: browses
- Storefront views → Catalog API: requests catalog
- Catalog API → Catalog query: parses query
src/pages/api/products/index.ts - Catalog API → Product catalog: reads products
src/pages/api/products/index.ts - Catalog API → Search engine: uses search
src/pages/api/products/index.ts - Catalog API → Catalog query: serializes results
src/pages/api/products/index.ts - Catalog query → Product search: normalizes query
src/features/catalog/query.ts - Product search → Search engine: queries search
src/features/products/search.ts - Shopper → Cart API: manages cart
- Shopper → Checkout API: checks out
- Checkout API → Payment providers: selects provider
- Payment providers → Store settings: loads settings
src/features/payments/index.ts - Payment webhook → Payment providers: selects provider
src/pages/api/webhook.ts - Payment webhook → Order event handling: records event
src/pages/api/webhook.ts - Order event handling → Orders & reservations: records paid order
src/features/orders/recordWebhook.ts - Order event handling → Email outbox: delivers notifications
src/features/orders/recordWebhook.ts - Order event handling → Refunds: syncs refunds
src/features/orders/recordWebhook.ts - Order event handling → Payment providers: gets provider
src/features/orders/recordWebhook.ts - Admin APIs → Product catalog: manages products
src/pages/api/admin/navigation.ts - Admin APIs → Pages & navigation: manages content
src/pages/api/admin/navigation.ts - Admin APIs → Orders & reservations: manages orders
src/pages/api/admin/orders/[id].ts - Admin APIs → Refunds: manages refunds
src/pages/api/admin/orders/[id].ts - Admin APIs → Shipping: manages labels
src/pages/api/admin/orders/[id].ts - MCP tools → Product catalog: reads and creates
mcp/src/index.ts - MCP tools → Orders & reservations: reads orders
mcp/src/index.ts - MCP tools → Refunds: lists refunds
mcp/src/index.ts - Media storage → Cloudflare R2: stores media
README.md - Product catalog → Cloudflare D1: persists catalog
README.md - Orders & reservations → Cloudflare D1: persists orders
README.md