Show HN: A Slack Clone Using Postgres Row Level Security
github.com
github.com
This is a real-time Slack clone built with Postgres' Row Level Security. It's a simple POC, and you can deploy your own, which takes a few minutes. The database, auth, real-time, and APIs are handled by Supabase, which is an open source Firebase alternative (disclaimer: I work at Supabase). The front end is built with Next.js, deployed on Vercel.
Supabase just released Auth. We use Netlify's GoTrue[1] for authentication. When you spin up a Postgres database on our platform we populate it with an auth schema, turn on the relevant extensions, and add some helper functions - signup, login, etc. When a user signs up to your app, they are assigned a UUID and issued a JWT, which contains the role `authenticated` and their UUID. We can use these details to provide fine-grained authorization for each user using Postgres' Row Level Security.
RLS is a bit confusing at first, so the next month's work will be improving our Auth system to make it extremely simple to use. And documentation :)