Space runs as a single Cloudflare Worker built by OpenNext — no container. It serves space.databayt.org.
Deploy
scripts/deploy-cloudflare.sh <env-file> all| Mode | What it does |
|---|---|
build | Exports HEAD to a throwaway directory and runs the OpenNext build |
preview | Runs the real Worker locally in workerd against the real database |
deploy | Pushes secrets, populates the ISR cache and deploys |
all | All of the above |
The build runs in a throwaway directory so it can switch the Prisma generator to runtime = "workerd" without touching local next dev.
Caching
| Piece | Backed by |
|---|---|
| Incremental cache | KV (NEXT_INC_CACHE_KV) |
| Tag cache | Sharded Durable Object |
| Queue | In memory |
Public pages use time-based ISR and admin writes call revalidatePath.
Webpack, not Turbopack
The production build uses next build --webpack: Turbopack wraps Prisma's query-compiler .wasm in a loader that reads it from disk, and workerd has no filesystem.