feat(cli): add Supabase as a backend option#283
Open
gonzoblasco wants to merge 2 commits into
Open
Conversation
- Add supabase plugin with @supabase/supabase-js and @supabase/ssr dependencies - Generate browser client (lib/supabase/client.ts) and server client (lib/supabase/server.ts) - Add environment variables: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY - Add --supabase flag to CLI - Register supabasePlugin in setup - Add supabase to technologies and environment variables sort orders - Bare-bones hosted setup (no local development / Docker)
|
@gonzoblasco is attempting to deploy a commit to the 9ty Team on Vercel. A member of the Team first needs to authorize it. |
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.
Add support for Supabase (#249)
Closes #249
Summary
Adds Supabase as a backend-as-a-service option via
--supabaseflag. This is a bare-bones hosted setup that generates browser and server clients for Next.js App Router, plus the required environment variables.As noted in the issue, this PR starts with hosted Supabase support (connecting to a remote project). Local development with Docker can be added in a follow-up.
Changes
supabase.tswith:@supabase/supabase-js@^2.0.0and@supabase/ssr@^0.6.0as dependencieslib/supabase/client.ts(usescreateBrowserClient)lib/supabase/server.ts(usescreateServerClientwith cookie handling for App Router)NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY--supabase(boolean)supabasePluginadded tosetup.tssupabaseadded to technologies, Supabase env vars added to environment variables sort orderDesign decisions
supabase init) can be a follow-up.@supabase/ssrover raw@supabase/supabase-js: The SSR package is the official way to use Supabase with Next.js App Router, handling cookie-based auth in server components and route handlers.supabase gen typesrequires a live project URL. Users can run it after setting up their env vars.Verification
pnpm run build— cleanpnpm run lint— no errorspnpm run unit— 9/9 tests pass./bin/run --helpshows--supabaseflagNotes
lib/supabase/server.tsusesawait cookies()which requires Next.js 15+ (App Router). This is compatible with the Next.js 16 that create-next-stack currently scaffolds.