Do I have the right idea?

I am trying to figure out the structure and tech I should use for my personal project. I am thinking of using T3 for the main application and then creating express servers for every new service I would want to include in to my app. My questions: - Is using express with tRpc a good solution for creating easy to integrate microservices into the T3 app? - I assume, that this is a good approach to an easy to expand structure, but I know that I lack experience in this, so any opinion would be helpful. (Not a question, I know) - What would be the best way to write the microservices so, maybe in the future, I could rewrite them, for example in Rust, for a more performant service? - If I am going to want to create a React Native app that consumes the API exposed by my Next app, what AUTH solution should I consider using?
16 Replies
JulieCezar
JulieCezar2y ago
- Is using express with tRpc a good solution for creating easy to integrate microservices into the T3 app? Generally it's not needed. If you plan to deploy on vercel and everything you want to do can be deployed on lambdas/edge then you don't even need express servers since vercel will scale all your endpoints as much as needed. However, if have needs outside of what Vercel covers, then yes Express is a good starting solution. However, I don't know if you can easily connect your express app to another next project via trpc... Try maybe ts-rest.... - I assume, that this is a good approach to an easy to expand structure, but I know that I lack experience in this, so any opinion would be helpful. (Not a question, I know) Generally yes... but you are gonna run into problems at scale. E.g. depending how you structure it you will need to scale each of these microservices separately... Again, if you can just use Vercel's lambdas go for it! - What would be the best way to write the microservices so, maybe in the future, I could rewrite them, for example in Rust, for a more performant service? There is no one good answer here. If you are going to be rewriting them then just make sure you document everything properly so the devs later on know how to port it over to rust or w/e. Except mybe some data types and the logic, basically everything else you can throw away when rewriting in another language. However, if you use Vercel or some similar service that can scale, you will probably never reach such a point. - If I am going to want to create a React Native app that consumes the API exposed by my Next app, what AUTH solution should I consider using? Clerk.
Swamp 2077
Swamp 2077OP2y ago
Thank you for your reply. ❤️ Regarding the first point: Does Vercel offer a way for me to host a service for listening to events and acting on them? (I still have to learn AWS stuff to really understand this kind of stuff, I think) And regarding Clerk: I have seen people complaining about the outrageous prices of Clerk at the higher scale. I understand, that for a personal project with little traffic it would be a problem far in the future, but I always like to think positively poohheh . What other service, maybe even self-hosted, I could use? @juliecezar
Oscar T.
Oscar T.2y ago
Instead of Clerk, NextAuth: https://create.t3.gg/en/usage/next-auth
Create T3 App
NextAuth.js 🚀 Create T3 App
The best way to start a full-stack, typesafe Next.js app.
JulieCezar
JulieCezar2y ago
Yes but, he said for React Native. I'm pretty sure NextAuth doesn't work with it I can't recommend any except Clerk ,because I've been using only Clerk and NextAuth for now maybe this helps
JulieCezar
JulieCezar2y ago
Medium
Top 5 Auth Solutions for React Native
Get to know 5 Auth Providers for React Native to get a head start with your Authentication flow
JulieCezar
JulieCezar2y ago
As far as I know no they dont... You say it's expensive, but any Auth service is expensive 😂
JulieCezar
JulieCezar2y ago
JulieCezar
JulieCezar2y ago
meanwhile
JulieCezar
JulieCezar2y ago
JulieCezar
JulieCezar2y ago
The first one is Auth0, the second Clerk
Swamp 2077
Swamp 2077OP2y ago
Surely they must've changed their pricing tiers though? It seems like it wasn't always like that
JulieCezar
JulieCezar2y ago
Yea they did I just noticed too They had like 20$ every 5k users or smth after hobby After this I don't see any reason to user other stuff lol
Swamp 2077
Swamp 2077OP2y ago
There we go. This actually gives a lot of confidence in the project too, they seem to be mindful of what the people are thinking about
JulieCezar
JulieCezar2y ago
True true
Swamp 2077
Swamp 2077OP2y ago
Thank you
JulieCezar
JulieCezar2y ago
Np and good luck
Want results from more Discord servers?
Add your server