Add local setup to README#66
Conversation
samholmes
left a comment
There was a problem hiding this comment.
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.
| - **Windows (npm)** – requires Node.js: | ||
|
|
||
| ```sh | ||
| npm install -g supabase | ||
| ``` |
There was a problem hiding this comment.
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.
| `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)" | ||
| ``` |
There was a problem hiding this comment.
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.
| supabase --version | ||
| ``` | ||
|
|
||
| #### 2. GitHub OAuth (local-only) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@samholmes I just reproduced it after deleting supabase and reinstalling it... |
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.
|
@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.
ea031d6 to
ea528ed
Compare
|
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 ;) |
There was a problem hiding this comment.
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.
- 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
f6dbdce to
b940433
Compare
Provided instructions on how to set up supabase environment for local development of DEVxSD.
Note
Local development & docs
README.md(CLI, Docker, env vars, troubleshooting)docs/local-oauth-setup.mdfor GitHub/Google OAuth against local Supabase.gitignorenow ignores all.env**filesLogin flow updates
redirectvialocalStorageand curriedhandleLoginsetup; otherwise show email verification successWritten by Cursor Bugbot for commit b940433. This will update automatically on new commits. Configure here.