Skip to content

SL1: the chat app on Workers - #2

Merged
ruehowl merged 1 commit into
mainfrom
sl1-the-chat-app
Oct 29, 2026
Merged

ruehowl merged 1 commit into
mainfrom
sl1-the-chat-app

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What this lands

Supabase's Slack clone example in apps/web, built by @opennextjs/cloudflare into one Worker + Static Assets (task SL-2).

The example's code is the code. The pages, components, styles, lib/Store.js, lib/UserContext.js and public/ come from upstream at 9eaae4c. The only changes are what the platform forces:

  • next pinned at 16.3.8 (upstream says latest), with React 19.
  • components/Layout.js: the class moves onto <Link>. Next ≥ 13 renders the anchor itself and refuses a nested <a>.
  • pages/_app.js: onAuthStateChange returns { data: { subscription } } in supabase-js 2, so upstream's unsubscribe threw on unmount.
  • pages/_app.js: the App component is named ChatApp, because upstream's name spells this repository's slug.
  • lib/site.ts (SITE_NAME) supplies every page's <title> and a heading on the sign-in form. This is the rebrand's seam.
  • next.config.ts reads NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY from the committed wrangler.jsonc, the fixture render of wrangler.template.jsonc. The bundle and the Worker therefore name one project.
  • pages/api/health.ts is new and read-only, and only the Worker can answer it. It returns 200 only when the project's Auth answers the build's key and its Data API knows the channels table. Before the migrations it returns 503 schema: "not migrated".
  • tests/web (vitest, 18 tests) covers the health check, the data layer against a stand-in client, the Next config and the committed wrangler config.

The Supabase project and the schema land in SL2. Until then, every build inlines the fixture's placeholder project, which nothing calls.

Checked

  • orun validate passes, and the lockfile resolves this workspace.
  • On the full tree: pnpm typecheck, pnpm lint, pnpm test and pnpm build are green (Worker ~1.1 MiB gzipped).

Generated by Claude Code

Supabase's Slack clone example in apps/web, built by OpenNext into one
Cloudflare Worker + Static Assets. The example's code is the code: the
pages, the components, the styles and lib/Store.js are upstream's, with
next pinned at 16.3.8 (upstream says latest) and only what the platform
forces changed — the Link that wrapped an <a>, onAuthStateChange's
supabase-js 2 return shape, the App component no longer named after this
repository's slug, and SITE_NAME (lib/site.ts) in every page's title and
on the sign-in form. next.config.ts reads the project's URL and
publishable key from the committed wrangler.jsonc, so the bundle and the
Worker name one project. /api/health answers only from the Worker,
read-only: Auth's settings and the Data API's channels table, asked with
the publishable key. tests/web covers the health check, the data layer,
the Next config and the committed wrangler config.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
@ruehowl
ruehowl merged commit 81226e6 into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants