Deployment
Deployment
Section titled “Deployment”Bookmarks deployment is Cloudflare-first.
Release sequence
Section titled “Release sequence”- Create/verify D1 database
bookmarksand R2 bucketbookmarks-media. - Update
workers/bookmarks-api-worker/wrangler.tomlbindings and IDs. - Deploy API worker (
wrangler deploy). - Set
AUTH_MODE=serviceand bindAUTH_SERVICEtocosmos-auth-worker. - Deploy
apps/bookmarks_siteto Cloudflare Pages. - Build/deploy Flutter web and mobile with production API base URL.
Prerequisites
Section titled “Prerequisites”cosmos-auth-workerhasAPP_URLset to deployed Bookmarks app URL.cosmos-auth-workerhas healthyMAIL_SERVICEbinding.JWT_SECRETandENCRYPTION_KEYare configured on auth worker.
Post-deploy smoke tests
Section titled “Post-deploy smoke tests”Run these in order after each production deploy:
GET /healthreturns{ ok: true, service: "bookmarks-api-worker" }.- Login flow works (
/v1/auth/loginand/v1/auth/refresh). - Authenticated
GET /v1/mereturns user context. - Create club (
POST /v1/clubs) returns201andclubId. - Member can open
/v1/clubs/:clubId/settings. - Admin can update club settings and member role.
- Note create/comment/reaction flow works.
- Meeting create/RSVP/calendar endpoints work.
/v1/clubs/:clubId/streamwebsocket connects for a member.
Rollback guidance
Section titled “Rollback guidance”If critical regressions are detected:
- Roll back worker to previous known-good deployment.
- Revert app/site to previous release artifact.
- Re-run smoke tests against rolled-back versions.
- If DB migration introduced incompatibility, halt write traffic and apply a tested corrective migration before re-enable.
Operational guidance
Section titled “Operational guidance”- Treat API worker as authorization and persistence boundary.
- Keep site deployment independent so marketing updates do not block app/API releases.
- Add direct R2 upload flows only when attachment throughput requires it.