Skip to content

nsc-events-fullstack_169_setup-supabase-database#178

Open
jmathew12 wants to merge 9 commits intosupabase-backend-setupfrom
supabase-backend
Open

nsc-events-fullstack_169_setup-supabase-database#178
jmathew12 wants to merge 9 commits intosupabase-backend-setupfrom
supabase-backend

Conversation

@jmathew12
Copy link
Copy Markdown
Contributor

@jmathew12 jmathew12 commented Mar 10, 2026

Summary & Changes 📃

Screenshots / Visual Aids 🔎

📌 Required for: UI changes, layout updates, or bug fixes.

Expand ⬇️

How to Test 🧪

  1. Steps to Reproduce:
    • Step 1: npm install
    • Step 2: npm run supabase:start
    • Step 3: visit the losthal host url, most likely http://localhost:54323/
  2. Expected Behavior: (Describe what should happen)
    This will create a supabase database of all the tables, an admin user in the auth.user table.
  3. Actual Behavior (if bug): (Describe what happens instead)

Checklist ✅

  • I have tested this PR locally and it works as expected.
  • This PR resolves an issue (Resolves #issue-number).
  • Reviewers, assignees(self), tags, and labels are correctly assigned.
  • Squash commits and enable auto-merge if approved.

@jmathew12 jmathew12 linked an issue Mar 10, 2026 that may be closed by this pull request
4 tasks
@jmathew12 jmathew12 self-assigned this Mar 10, 2026
@jmathew12 jmathew12 changed the title Supabase backend nsc-events-fullstack_169_setup-supabase-database Mar 12, 2026
Copy link
Copy Markdown
Contributor

@NahomAlemu NahomAlemu left a comment

Choose a reason for hiding this comment

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

This PR sets up Supabase infrastructure and removes the old NestJS backend. However, the implementation diverges from the issue requirements. Since we have no existing data, the timestamped migration files (supabase/migrations/) are unnecessary. We don't need migration tracking for a fresh development database. Per the issue:

  1. Raw SQL scripts should be in a dedicated sql/ directory, not as migrations.
  2. Package.json scripts for dump/populate workflows were not created (though the Supabase scripts for start/stop/reset are good)
  3. README still references PostgreSQL/pgAdmin instead of documenting Supabase workflows.
    Note: dummy data doesn't need to be in the codebase-Supabase Studio and the REST API handle that.

Technical issues to fix: inconsistent env var naming (NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY vs NEXT_PUBLIC_SUPABASE_ANON_KEY), FK constraints using ON DELETE SET NULL on NOT NULL columns (will cause errors), and remove the junk file supabase/snippets/Untitled query 790.sql. Recommendation: Replace migrations with raw SQL schema files in a sql/ directory, fix the FK constraints, standardize env vars, and update the README with Supabase development workflows.

@jmathew12 jmathew12 changed the base branch from main to supabase-backend-setup March 14, 2026 18:53
@IsaacJrTypes
Copy link
Copy Markdown
Collaborator

Hi @jmathew12, great work on adding the basics of Supabase. This is no easy task, especially since we do not cover Supabase in the curriculum! The PR is out of scope with the authentication data being inserted.

The reason we wanted to setup the supabase database was to replicate the table database without needing any authentication.

Reasons we didn't require authentication

  • We should not touch the supabase authentication table, because doing so will cause unexpected behaviors
  • We can still create a supabase database and query the database without authentication

I agree with the points Nahom made. You pretty much have everything we asked. Just minor tweaks like naming conventions, removing the migration files, adding scripts for dump files.

For future reference, here is a method in how supabase suggest one should handle authentication when adding a new user. It requires a simple login in page with SQL triggers that get launched in the back end.

If the authentication was done after setting up the database. Please point that out in the PR, its important to fill out a detailed PR to eliminate any assumptions from the person testing the PR. I know it can take more time to write one, but it also serves as a form of documentation. Calling out assumptions in PRs are similar to calling out edge cases in coding interviews. It is a way to communicate potential issues or misunderstandings.

Since we are off the quarter, we will continue next quarter. With Biruke joining the TA team, we will be more timely with PR reviews so you get immediate feedback.

Overall, great job this quarter. Took me a couple of small projects and read a supabase book for a couple of sprints to help me understand how to build with supabase.

-Here is a video I recommend to watch, it shows how to implement supabase auth with next.js

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.

Feature Request: Implement basic database within supabase

3 participants