Cloudflare D1 + Pages

Cloudflare D1 + Pages

Per-customer storage and publication stack for the EA catalog (and the delivery model template Maya may inherit at scale).

Configuration

  • One D1 database per customer. Database name = customer slug (transgesco, stm). TFD-0019 §2 + §4
  • Each DAE is a tagged catalog (catalogs.dae + catalog discriminators). Cross-DAE queries within a customer = OK. Cross-customer = structurally impossible.
  • Pages project name = customer slug. *.pages.dev subdomain is globally namespaced and may collide (stmstm-3kl.pages.dev). Cosmetic; resolved later via custom domain.
  • wrangler.{customer}.toml are the sources of truth and swapped in place at deploy time because pages deploy does not accept a custom config path. TFD-0019 Consequences §Neutral
  • Importer is config-driven via customers.json. Adding a customer or DAE is a config edit. TFD-0019 §4

Lifecycle (CSV → D1 → Pages)

CSV remains the working / validation / correction surface through the validation gate. Upload to D1 occurs only once validated. D1 + Pages is the published consumption layer, never the editing surface. Re-validation → re-export CSV → correct → re-upload. TFD-0019 §1

Cost & ownership

Cloudflare free tier covers current volume; $0 today but factory-account dependency to track. TFD-0019 Consequences §Neutral

Delivery (foundry rule applied)

Customer delivery is wrangler d1 export → portable .sqlite + CSV bundle, runnable independently of the factory and any specific LLM. The delivered artifact, not the hosted instance, is the contractual deliverable. TFD-0019 §3

Linked