Supabase, for those who don’t know, is an alternative to Firebase that’s open source and built on top of PostgreSQL. It’s new, so it can’t do a fraction of what Firebase does, but what it already does do is pretty awesome!
Earlier today I tried using it with Redwood.
My first experiment was to use supabase, instead of Heroku, as the “production” db for the Redwood tutorial.
Worked great, and was super easy to get going.
Creating a post using the scaffolded CRUD stuff from the tutorial, and it immediately shows up in the supabase webinterface, and vice versa
If you want to try it out yourself, you just have to create a project on supabase and get your DB’s connection info, and use that as
DATABASE_URL in your Netlify setup
The code for the blog is below, but there is not much to look at really. All the “magic” is in the DATABASE_URL env var, and that’s secret and only visible on Netlify
Supabase launched auth support a while ago, and with that they also published a “slack clone” as a demo showcasing both the auth stuff, but also the real-time capabilities of supabase. The demo is written using Next and is deployed to Vercel. I ported it over to Redwood and it was actually way less work than I feared
This is their gif to show it off. I could create my own, but why bother, it’d look exactly the same
This is what the users table look like (on my cellphone)
Their auth stuff is built using Netlify’s GoTrue
The code is linked below, but before you look at it I do have to warn you that I touched as little as possible of their original code. So it’s a mix of 100 different coding styles, because that’s what they had… Just so you know.