Cannot your two front end client “sides” (lets call them web for admins and mobile for users) connect to the same backend api and that connects to one database?
I suggest one uses the standard GraphQL api for the admin and Supabase providers.
The mobile one can connect to the api using serverless functions which can then talk to the same services – but in the serverless function you consume the event (which has headers and cookies) and authenticate your mobile/phone users there … but not using the “auth.js” helpers.
Conceptually, this isn’t much different than a Webhook getting validated based on its headers.
That is a good way out of this pickle… And it’s a pattern I use already when some of my admin side calls AWS lambdas.
So I would have the [authenticated] /api side of the mobile app forward it’s requests to the /api side of the admin app with a server-to-server token for authentication. I would not have any actual db code in the mobile /api folders
Thanks for pointing out the obvious, I was circling the drain…
So I’m going to be running and developing on two Redwood apps at the same time - how can I change the port on one?
Are there any good ways to share some of the /web code between the apps?