nsc-events-fullstack_169_setup-supabase-database#178
nsc-events-fullstack_169_setup-supabase-database#178jmathew12 wants to merge 9 commits intosupabase-backend-setupfrom
Conversation
NahomAlemu
left a comment
There was a problem hiding this comment.
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:
- Raw SQL scripts should be in a dedicated sql/ directory, not as migrations.
- Package.json scripts for dump/populate workflows were not created (though the Supabase scripts for start/stop/reset are good)
- 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.
|
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
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 |
Summary & Changes 📃
Resolves: Feature Request: Implement basic database within supabase #169
Summary: (Briefly describe what this PR does)
This pr resolves issue Feature Request: Implement basic database within supabase #169. It sets up a supabase database based on the ERD design. It also creates an admin user.
Changes:
Screenshots / Visual Aids 🔎
📌 Required for: UI changes, layout updates, or bug fixes.
Expand ⬇️
How to Test 🧪
This will create a supabase database of all the tables, an admin user in the auth.user table.
Checklist ✅
Resolves #issue-number).