Skip to content

Add local setup to README#66

Merged
samholmes merged 8 commits intoDEVxNetwork:mainfrom
AndrewHUNGNguyen:#62-set-up-local-supabase-env
Jan 22, 2026
Merged

Add local setup to README#66
samholmes merged 8 commits intoDEVxNetwork:mainfrom
AndrewHUNGNguyen:#62-set-up-local-supabase-env

Conversation

@AndrewHUNGNguyen
Copy link
Copy Markdown

@AndrewHUNGNguyen AndrewHUNGNguyen commented Dec 26, 2025

Provided instructions on how to set up supabase environment for local development of DEVxSD.


Note

Local development & docs

  • Adds comprehensive local Supabase setup to README.md (CLI, Docker, env vars, troubleshooting)
  • Introduces docs/local-oauth-setup.md for GitHub/Google OAuth against local Supabase
  • .gitignore now ignores all .env** files

Login flow updates

  • Refactors OAuth handler to preserve redirect via localStorage and curried handleLogin
  • Adds toggle to switch between OAuth buttons and an email/password form, plus a back button
  • Updates signup handling: if Supabase returns a session, redirect to setup; otherwise show email verification success
  • Minor UI/UX tweaks (shorter password help text, removed unused divider/title)

Written by Cursor Bugbot for commit b940433. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown
Contributor

@samholmes samholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial review. I tried following the instructions to install supabase start and got stuck at this point:


❯ supabase start
WARNING: You are running different service versions locally than your linked project:
supabase/gotrue:v2.182.1 => v2.184.0
Run supabase link to update them.
[+] Pulling 14/17
 ✔ edgeRuntime Skipped - Image is already present locally                                                                                                                                                                                0.0s 
 ✔ pgmeta Skipped - Image is already present locally                                                                                                                                                                                     0.0s 
 ✔ auth Skipped - Image is already present locally                                                                                                                                                                                       0.0s 
 ✔ storage Skipped - Image is already present locally                                                                                                                                                                                    0.0s 
 ✔ imgProxy Skipped - Image is already present locally                                                                                                                                                                                   0.0s 
 ✔ studio Skipped - Image is already present locally                                                                                                                                                                                     0.0s 
 ✔ api Skipped - Image is already present locally                                                                                                                                                                                        0.0s 
 ✔ realtime Skipped - Image is already present locally                                                                                                                                                                                   0.0s 
 ✔ kong Pulled                                                                                                                                                                                                                           6.2s 
   ✔ 9b18e9b68314 Pull complete                                                                                                                                                                                                          0.7s 
   ✔ 7fd91e922960 Pull complete                                                                                                                                                                                                          0.7s 
   ✔ 450997ae687c Pull complete                                                                                                                                                                                                          2.7s 
   ✔ d8380bfcbd9b Pull complete                                                                                                                                                                                                          2.7s 
 ⠙ mailpit Pulling                                                                                                                                                                                                                       6.2s 
 ✔ db Skipped - Image is already present locally                                                                                                                                                                                         0.0s 
 ⠙ logflare Pulling                                                                                                                                                                                                                      6.2s 
 ⠙ vector Pulling                                                                                                                                                                                                                        6.2s 
Starting database...
Initialising schema...
Seeding globals from roles.sql...
Applying migration 20250122000000_add_user_id_to_member.sql...
Stopping containers...
ERROR: relation "member" does not exist (SQLSTATE 42P01)           
At statement: 0                                                    
-- Add user_id foreign key to member table (nullable initially)    
ALTER TABLE member                                                 
ADD COLUMN user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE
Try rerunning the command with --debug to troubleshoot the error.

Did you run into a similar issue?

I'm assuming I'm doing something wrong, so if you know what I did wrong please let me know.

I have Docker installed, and I ran brew install supabase/tap/supabase first then I ran supabase start which resulted in the failure you see above.

Comment thread README.md Outdated
Comment on lines +65 to +69
- **Windows (npm)** – requires Node.js:

```sh
npm install -g supabase
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't correct according to the docs: https://github.com/supabase/cli?tab=readme-ov-file#install-the-cli Perhaps just reference the docs to install supabase here. No need for use to copy the instructions in this README.

Comment thread README.md Outdated
Comment on lines +99 to +106
`supabase/config.toml` is already configured to read these env vars via:

```toml
[auth.external.github]
enabled = true
client_id = "env(SUPABASE_AUTH_EXTERNAL_GITHUB_CLIENT_ID)"
secret = "env(SUPABASE_AUTH_EXTERNAL_GITHUB_SECRET)"
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this needs mentioning if it's already apart of the config. However, I double checked, and I don't see this in the toml file.

Comment thread README.md Outdated
supabase --version
```

#### 2. GitHub OAuth (local-only)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Username/password should be the recommended authentication for testing and should be mentioned here. We should put GitHub OAuth and Google OAuth setup in a separate docs/oauth-setup-guide.md file and link to it here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah separation of responsibilities (once again for me). I am in favor of having a separate docs folder for sub-setups (e.g. setting up GitHub OAuth, Google OAuth locally) in different folders. What we can do is if any contributor manages to find a way to do local setup for stuff like GitHub OAuth, then the contributor should add the exact steps to docs/oauth-setup-guide.md

@AndrewHUNGNguyen
Copy link
Copy Markdown
Author

Some initial review. I tried following the instructions to install supabase start and got stuck at this point:


❯ supabase start
WARNING: You are running different service versions locally than your linked project:
supabase/gotrue:v2.182.1 => v2.184.0
Run supabase link to update them.
[+] Pulling 14/17
 ✔ edgeRuntime Skipped - Image is already present locally                                                                                                                                                                                0.0s 
 ✔ pgmeta Skipped - Image is already present locally                                                                                                                                                                                     0.0s 
 ✔ auth Skipped - Image is already present locally                                                                                                                                                                                       0.0s 
 ✔ storage Skipped - Image is already present locally                                                                                                                                                                                    0.0s 
 ✔ imgProxy Skipped - Image is already present locally                                                                                                                                                                                   0.0s 
 ✔ studio Skipped - Image is already present locally                                                                                                                                                                                     0.0s 
 ✔ api Skipped - Image is already present locally                                                                                                                                                                                        0.0s 
 ✔ realtime Skipped - Image is already present locally                                                                                                                                                                                   0.0s 
 ✔ kong Pulled                                                                                                                                                                                                                           6.2s 
   ✔ 9b18e9b68314 Pull complete                                                                                                                                                                                                          0.7s 
   ✔ 7fd91e922960 Pull complete                                                                                                                                                                                                          0.7s 
   ✔ 450997ae687c Pull complete                                                                                                                                                                                                          2.7s 
   ✔ d8380bfcbd9b Pull complete                                                                                                                                                                                                          2.7s 
 ⠙ mailpit Pulling                                                                                                                                                                                                                       6.2s 
 ✔ db Skipped - Image is already present locally                                                                                                                                                                                         0.0s 
 ⠙ logflare Pulling                                                                                                                                                                                                                      6.2s 
 ⠙ vector Pulling                                                                                                                                                                                                                        6.2s 
Starting database...
Initialising schema...
Seeding globals from roles.sql...
Applying migration 20250122000000_add_user_id_to_member.sql...
Stopping containers...
ERROR: relation "member" does not exist (SQLSTATE 42P01)           
At statement: 0                                                    
-- Add user_id foreign key to member table (nullable initially)    
ALTER TABLE member                                                 
ADD COLUMN user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE
Try rerunning the command with --debug to troubleshoot the error.

Did you run into a similar issue?

I'm assuming I'm doing something wrong, so if you know what I did wrong please let me know.

I have Docker installed, and I ran brew install supabase/tap/supabase first then I ran supabase start which resulted in the failure you see above.

@samholmes I just reproduced it after deleting supabase and reinstalling it...

Andrew Nguyen and others added 6 commits January 22, 2026 08:08
The dates in the names were incorrect causing failure to setup/migrate
databases. One file in particular was ordered incorrectly causing the
failure.
Instead of duplicating installation instructions that may become
outdated, link directly to the official documentation.
…guide

- Username/password auth works out of the box for local testing
- OAuth setup (GitHub, Google) moved to docs/local-oauth-setup.md
- Removed incorrect reference to config.toml having GitHub OAuth
  (it wasn't actually configured)

Addresses PR DEVxNetwork#66 review comments.
@samholmes
Copy link
Copy Markdown
Contributor

@AndrewHUNGNguyen Yes the issue with the migrations ordering. I fixed it.

If email confirmation is disabled (local dev), Supabase returns a
session immediately after signup. The code now checks for this and
redirects to /setup instead of showing 'Check your email'.

In production where email confirmation is enabled, the success
message is shown as before.
@samholmes samholmes force-pushed the #62-set-up-local-supabase-env branch from ea031d6 to ea528ed Compare January 22, 2026 16:28
@samholmes
Copy link
Copy Markdown
Contributor

samholmes commented Jan 22, 2026

The updates I included fixes a few additional things regarding localhost setup. The fixes include some changes to make sure email/password works for local setup and the OAuth is an optional addition if the dev wants to setup that for testing. The dev setup should be as frictionless as possible.

@AndrewHUNGNguyen for you're information: Conventional Commit standard is a nice thing to know about ;)

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread app/login/page.tsx Outdated
- Show OAuth buttons (Google, GitHub) by default with tertiary
  'Continue with Email' button below
- Email form only appears when user clicks 'Continue with Email'
- Added 'Back to sign in options' link to return to OAuth view
- Removed divider and form title for cleaner interface
@samholmes samholmes force-pushed the #62-set-up-local-supabase-env branch from f6dbdce to b940433 Compare January 22, 2026 16:57
@samholmes samholmes merged commit a002f01 into DEVxNetwork:main Jan 22, 2026
1 check 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