examples/storefront Public
Architecture
From .rebasely/architecture/system.yaml at 94db762: 3 components, 2 connections in this view.
What browsing the shop touches, and where product images come from.
Select a component to see what it talks to.
storefront-api
The public HTTP API (wrangler.jsonc, Worker storefront-api). Shoppers browse the catalog, fill carts and check out; the merchant edits products and uploads their images with the admin token. Its OrdersService entrypoint is how the other Workers change orders: it is the only Worker with the database binding. A cron trigger expires unpaid orders every five minutes.
- Owns
- src/**
- Talks to
- db (d1), images (r2)
Components
- storefront-api Worker
The public HTTP API (wrangler.jsonc, Worker storefront-api). Shoppers browse the catalog, fill carts and check out; the merchant edits products and uploads their images with the admin token. Its OrdersService entrypoint is how the other Workers change orders: it is the only Worker with the database binding. A cron trigger expires unpaid orders every five minutes.
- db D1 database
The storefront database: products, carts, orders and their lines. Every schema change is a numbered file in migrations/, applied with wrangler d1 migrations apply.
- Owns
- migrations/**
- Binding
- DB
- Used by
- storefront-api (d1)
- images R2 bucket
Bucket storefront-images: product images under products/<product>/<hash>.<ext>. A key is never overwritten, so every image URL can be cached for a year. Public on its custom domain (IMAGES_URL), where browsers load the images; storefront-api only writes to it.
- Binding
- IMAGES
- Used by
- storefront-api (r2)