Cross platform authentication

What would you recommend for authentication in a cross platform (web / mobile) application? tRPC will be used for BE and for DB I'm not certain but leaning towards a postgres db handled through Prisma
94 Replies
Scot
Scot•3y ago
You authenticate on server, I'd recommend drawing up your architecture it's really useful for questions like this. Also I don't really recommend prisma but that may be a hot take around here
Wezter
WezterOP•3y ago
I've mainly looked at what type of stack I want to utilise. This is what I'm considering using right now: FE Related:
- Solito
- React Query
- Zustand (If I need anything more than low velocity data providers)
- NativeBase (Only thing I've found so far that seems to work okey for both web and mobile)
- Potentially Dripsy for styling things outside of NativeBase
- Moti
- Solito
- React Query
- Zustand (If I need anything more than low velocity data providers)
- NativeBase (Only thing I've found so far that seems to work okey for both web and mobile)
- Potentially Dripsy for styling things outside of NativeBase
- Moti
BE Related: (I've worked more with FE so this is a more of a black hole for me)
- tRPC
- Prisma
- Supabase / Planetscale / Something else for db?
- Supabase Auth / Auth0 / Userbase / Something else for auth?
BE Related: (I've worked more with FE so this is a more of a black hole for me)
- tRPC
- Prisma
- Supabase / Planetscale / Something else for db?
- Supabase Auth / Auth0 / Userbase / Something else for auth?
Other things
- Zod
- AppCenter
- Vercel
- Github
- Sentry
- Fastlane
- Expo
- Zod
- AppCenter
- Vercel
- Github
- Sentry
- Fastlane
- Expo
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Wezter
WezterOP•3y ago
If you're used to working in React Native its very intuitive imo. When It comes to UI sharing it's most of the time super simple. Why don't you think it's a right decision other than you not thinking it's intuitive? I've heard that they don't really have support for mobile but that might be wrong?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Wezter
WezterOP•3y ago
That's why I'll be using NativeBase since they have already done a lot of the thinking for me to support both web and mobile with their component library. They also say that their performance will have improved quite a lot with 3.5 release.
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Wezter
WezterOP•3y ago
Yeah it's a component lib. I'm mainly using NativeBase to test it out to see if we could base a design system on top of theirs to have a single design system for both web and mobile
shaaah
shaaah•3y ago
Have you looked into Expo for react native and web instead of Solito btw?
Wezter
WezterOP•3y ago
Yeah I've tried that out before but Solito has been way smoother for me at least.
shaaah
shaaah•3y ago
Interesting, do you know someone or company who has successfuly deployed their app with Solito to the playstore and web? For authentication you could also go completely passwordless too, this way you dont have to worry about cross platform issues
Wezter
WezterOP•3y ago
https://beatgig.com/ https://showtime.xyz/ These are some that I'm aware of being built with it.
Wezter
WezterOP•3y ago
Yeah I think I'd like having phone number authentication with OTP potentially email link on web and OTP on mobile
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Wezter
WezterOP•3y ago
yeah I don't expect kids to use my platform. bankID would be the preferred solution if I wanted to pay for auth ^^ (Swedish authentication method)
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Wezter
WezterOP•3y ago
OTP is probably the one I'd be most interested in if I could get it for free but I'm only aware of Firebase having that for "free". If I go with Google then I have to add Apple as well on iOS
shaaah
shaaah•3y ago
firebase has it for Free? 😮
Wezter
WezterOP•3y ago
Yeah I think up to like 10k or so iirc.
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Wezter
WezterOP•3y ago
Yeah we use Firebase with .NET API and RN app in one of the projects I'm working on (I'm glad I don't have to touch any of the .NET stuff though 😄 )
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
Firebase is google So make sense why it isnt open sourced
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
wait why xD
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
Gotchya, Yeah I just used firebase in react native for Notification , Google, Facebook auth and some Deep Linking tbh. I havent used their DB ever, not planning too either Hows Supabase? Do they also have all these services firebase provides?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
ah I see, So supabse is just a Db only? unlike firebase that provides a bunch of service
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
That's interesting, need to checkout this Supabase soon @An7 At what point do you come out of BaaS? Once it starts scaling ?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
What scales well?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
Modern compute is pretty easy to scale in a lot of cases, it's the db that's the problem aha
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
I'm skeptical on writing API in NextJs, So I stick to Nodejs currently
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
Prisma is just an orm right? It's the backing db that matters
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
Right which is mysql
shaaah
shaaah•3y ago
yeah thats what I thought too
Scot
Scot•3y ago
God I hate orms
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
I'm hardcore front end + mobile dev, but watching theo's stream inspired me to start backend
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
Yeah I looked into Prisma, Its a game changer tbh
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
What about scaling to multiple apps or when you need to update the sql directly
shaaah
shaaah•3y ago
To be on the same page from a backend newbie, what is Edge or Edge Functions lol
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
You should do some systems architecture designs 😄 really helps think about all that stuff
shaaah
shaaah•3y ago
I believe you could always write custom sql even if you use prisma?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
I just always prefer to write custom sql so the orms don't bring much benefit and have caused me so much headache
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
Isnt migration a pain? Prisma eases that beautifully
Scot
Scot•3y ago
Like migration scripts? Not really I use flyway which runs sql Migrations should 100% be written in sql
shaaah
shaaah•3y ago
So basically my login endpoint is a function you mean? and we call that edge?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
Most of my thoughts are for industry and businesses, they don't apply as much to personal projects btw If its just you working on something go wild on whatever makes you fast and you enjoy aha
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
dang, so many buzz words, I'll need to look into all these words in depth haha
Scot
Scot•3y ago
Ah have you not ran into any? It is definately useful
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
You can learn some in advance
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
Because then you can join companies with the same problems
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
But you should know some stuff right? You can learn a lot Also knowing what you don't know is important
shaaah
shaaah•3y ago
I feel bad for ashley, we just completely diverted the topic 😂
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
right, so the conclusion is you recommended next-auth?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
yes and firebase auth is free atleast it was the last time i used it
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
speaking of bases,I heard there is something called Pocketbase and its open source I believe it also has Auth
shaaah
shaaah•3y ago
PocketBase - Open Source backend in 1 file
Open Source backend in 1 file with realtime database, authentication, file storage and admin dashboard
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
Imagine AWS introducing AWS Auth xD
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
shaaah
shaaah•3y ago
S3 is bad? I just told my client 2days ago to get Ec2 and S3 LOL they were using azure, and aint no way I'm using that after just getting into backend
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Wezter
WezterOP•3y ago
You mean Cognito? ^^ https://aws.amazon.com/cognito/
Amazon Web Services, Inc.
Customer Identity and Access Management – Amazon Cognito – Amazon W...
Amazon Cognito is a developer-centric and cost-effective customer identity and access management (CIAM) service that scales to millions of users.
shaaah
shaaah•3y ago
oh wow 50,000 active users free per month? 😮 I'm waiting for Cloudflares S3 alternate to come out, I believe its in beta right now It might destroy S3 For free, I used to use Cloudinary, but hella expensive
Scot
Scot•3y ago
Don't think you can destroy s3
shaaah
shaaah•3y ago
@An7 btw speaking of Fastify , Expressjs still has 27M downloads a week So I dont think fastify is going to be popuplar as express anytime soon
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Scot
Scot•3y ago
Express is good enough for most things, if you architecture your app nicely it should also be trivial to swap over
chocolatebananarhino
Hi @An7 I am trying out your draft PR and almost have it working. I am running into an issue where the expo app is trying to connect to connect to http://localhost:3000/api/auth/proxy when signing in instead of the serverUrl I have set http://192.168.0.132:3000. I have tried a few things like set the .env NEXTAUTH_URL=http://192.168.0.132:3000 in the expo app as well as used <SessionProvider baseUrl={serverUrl}> but it still seems to be connecting to localhost. I have used @albastru repo https://github.com/DavidIlie/t3-all-inclusive as a guide as well. Any idea on how I can go about setting the serverBaseUrl correctly?
GitHub
GitHub - DavidIlie/t3-all-inclusive: Best monorepo (mobile+web) for...
Best monorepo (mobile+web) for the T3 Stack! Contribute to DavidIlie/t3-all-inclusive development by creating an account on GitHub.
Albastru
Albastru•3y ago
serverUrl for expo you can find in the constants file in lib if i remember correctly
chocolatebananarhino
That did not work for me. I was able to fix it by adding this to app.json
"extra": {
"nextAuthUrl": "http://192.168.0.132:3000"
}
"extra": {
"nextAuthUrl": "http://192.168.0.132:3000"
}
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
chocolatebananarhino
OK that makes sense thanks. Now you can still make use of the env file
Want results from more Discord servers?
Add your server