Add documentation for switching to Supabase
It would be great to see some documentation on swapping out Clerk and Neon to use Supabase for the auth and database.
I agree, had a few folks ask for this! I contacted the Supabase team on X about working together on it, no reply. Maybe I'll try here.
@kiwicopple @MildTomato @saltcod keen to collab?
ping @awalias
@haydenbleasel I have a very similar monorepo setup with Supabase, so I can help with this. A bit short on time now but I'm happy to do it over the next 2 weeks
missed the ping @haydenbleasel (I'm quicker on twitter (@saltcod)!) what were you thinking?
Resolved by #312
We're open to some more docs on switching Auth, Realtime, etc. Sounds like @sergical is keen to help there.
Yup, wanted to put auth in at the same time but need some additional functionality to make sure there's feature parody with clerk's organization functionality
I'm trying to add supabase auth. Can you elaborate on what additional functionality would be needed?
I'm trying to add supabase auth. Can you elaborate on what additional functionality would be needed?
All of Clerk's organization functionality: for example https://github.com/haydenbleasel/next-forge/blob/7efa7572a5faab7c164575613bc063ffdd8809f1/apps/app/app/actions/users/get.ts#L61C27-L61C47
How far are you in the process? would love to help / collaborate!
I am now working on mapping the clerk objects like auth, users, organizations, etc. So far I've changed the server, client and middleware to supabase ssr. Would love to collaborate. Would you like to me post a fork with what I have so far?
yeah, i'd love to! not sure i have capacity in the next few days but let me know!
there's some realtime stuff as well that can be updated to supabase and obviously the db provider (not sure if you saw the docs for that https://docs.next-forge.com/migrations/database/supabase)
yeah I was working off that documentation to change the db provider. I want to use drizzle as well so I was stripping that out for this branch but it should have a WIP https://github.com/jorda0mega/next-forge/tree/supabase-auth/packages/auth
so I was playing with this a bit and I think creating a context provider, sign-in and sign-up components inside the auth package might be overkill. I would have to use native html elements (can't import design-system since it would introduce a circular dependency). Moreover, it would require adding props for additional styles similar to how Clerk does it. I think it would be easier to move those to the app package instead to keep it simpler and just expose the createClient functions for client/server instead. Thoughts?
I'm easy - but I think that tracks - the consumer (app) should decide how to style the UI for auth (since it can be different for a web client vs native) but the common client can be exposed from auth. although technically the types / client will live in db so not even sure auth is needed 🤷