antho1404
TTCTheo's Typesafe Cult
•Created by Børge on 4/20/2025 in #questions
What would you recommend?
I now try to go by default server component + server actions, and then build internal APIs with tanstack query only if needed (I try to avoid at all costs). If there are too many internal APIs, because sometimes you just don't have a choice, then I'll consider TRPC, but something to keep in mind, TRPC is great for query and mutation as long as it is internal, if you plan to give this API access to users, then avoid TRPC.
So, depending on your needs, try to have an idea of the number of internal APIs for query you will need, if it's significant trpc, if not server component is fine
4 replies
TTCTheo's Typesafe Cult
•Created by Aditya Kirad on 4/19/2025 in #questions
need advice with building e-commerce application
I never used medusa, but it definitely sounds interesting
5 replies
TTCTheo's Typesafe Cult
•Created by sukhesh on 4/17/2025 in #questions
How to await params?
I noticed that a lot of models still push on this function signature and not the one with Promise, which is a recent change in next 15 if I remember correctly.
Any
params
or headers
now need to be a promise4 replies
TTCTheo's Typesafe Cult
•Created by Aditya Kirad on 4/19/2025 in #questions
need advice with building e-commerce application
Hey Aditya,
TLDR: 2 subdomain, 2 separate apps, 2 different auth, 1 single database.
First of all, having a subdomain is a good idea. This way, you can have 2 separate apps and the flexibility to have 2 auth systems, possibly.
I personally always try to keep things simple, and having the same auth for 2 different audiences that have completely different needs can be painful, and if these users are always either admin or customer, then it doesn't make sense to merge them into a similar auth system.
For the API part, this might not be necessary. Maintaining public APIs is more complicated than it looks, so if you can avoid it and simply use your database (or whatever data layer) you have (that will be shared between storefront and admin) right in the storefront, that will be a lot simpler.
Also keep in mind, there are solutions out there already for the whole backend, database, api for an ecommerce like shopify and others.
5 replies