venture backends on Cloudflare: a domain, a Worker, a database and AI per venture
With CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID, each venture gets its own Worker (time-<slug>) with its own D1 database and Workers AI. The Worker serves the venture's GitHub Pages folder under <slug>.<TIME_VENTURE_DOMAIN> (or workers.dev) and adds a small API: share links stored in D1, and a rate-limited small model. The page reaches it through time.js, which Time writes next to index.html and the build may not edit; every call degrades to null, so products still work on Pages alone and in the headless checks. The backend is deployed when a venture is picked, so the plan, the signal issue and the page all carry the venture's own domain. A Cloudflare failure never holds a venture: it launches on Pages and the chores retry. The chores also backfill older ventures and redeploy every venture when worker.js or its settings change (a revision hash), a couple per tick; update.yml carries the new files. The doctor checks the token. Offline tests cover the provisioner, the loop with and without Cloudflare, the backfill and redeploys, and the worker itself (node, against a fake D1, AI and Pages). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wyb3QQDESFkosKRXzrXqwr
This commit is contained in:
1 parent
e1dc4f2790
commit
134a03ce41
13 files changed
+717
-11
No files matched your search
@@ -18,6 +18,9 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
|
||||
VENICE_API_KEY: ${{ secrets.VENICE_API_KEY }}
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
TIME_VENTURE_DOMAIN: ${{ vars.TIME_VENTURE_DOMAIN }}
|
||||
TIME_MODE: ${{ vars.TIME_MODE }}
|
||||
TIME_DAILY_CAP: ${{ vars.TIME_DAILY_CAP }}
|
||||
TIME_REVIEW: ${{ vars.TIME_REVIEW }}
|
||||
|
||||
Reference in new issue
Block a user