Repository navigation
AT1: the CRM on Workers - #2
Merged
Merged
Conversation
apps/web is Marmelab's Atomic CRM — the React-Admin single-page app, its FakeRest demo and its six Supabase edge functions — on one Cloudflare Worker. Vite builds the app into the Worker's Static Assets; the edge functions are the Worker's own routes at the paths supabase.functions.invoke calls (/functions/v1/<name>), nearly verbatim: Deno.env and Deno.serve come from a two-function shim, the jsr:/npm: imports are npm packages, and the two that held a Postgres pool for the life of the process (Kysely in merge_contacts, @supabase/server's middleware in the MCP server) open a client per request through the Hyperdrive binding, since a Worker may not reuse a socket another request opened. The Supabase client's fetch sends function calls to the page's own origin; the build inlines the project's URL and publishable key from the rendered wrangler config, so the bundle and the Worker name the same project. Inbound email answers 503 until it is configured instead of failing the Worker at load. tests/web runs upstream's 33 test files in Chromium with the Storybook stories they render, its edge-function tests, and the port's own: the routes, the functions' fetch, the build's project, the wrangler render and the MCP server's Postgres. Every direct dependency is pinned to the version upstream's lockfile resolves. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Marmelab's Atomic CRM (marmelab/atomic-crm at
9eb8349, MIT) running on one Cloudflare Worker.apps/web: the React-Admin app, its FakeRest demo, and its six Supabase edge functions.supabase.functions.invokealready calls (/functions/v1/<name>). The code is nearly verbatim:Deno.envandDeno.servecome from a two-function shim.jsr:/npm:imports are npm packages.merge_contacts, and@supabase/server's middleware in the MCP server. Both now open a client per request through the Hyperdrive binding. A Worker may not reuse a socket another request opened, and I confirmed the pooled version hangs on the second request.tests/web:Checked locally:
pnpm typecheck,lint,testandbuildare green.wrangler dev, against a stand-in Supabase and a local Postgres:Every departure from upstream is listed in
specs/epics/atomic-crm/IMPLEMENTATION-STATUS.md.Generated by Claude Code