Next.js Discord

Discord Forum

need advice with building e-commerce app

Unanswered
Aditya Kirad posted this in #help-forum
Open in Discord
Hey folks I'm building E-commerce app for the first time obviously I will need an Storefront and Admin Dashboard for this considering I have this domain example.com Storefront will be hosted on example.com while Admin dashboard on subdomain admin.example.com first thing is this approach good or I should have entirely different domain for both thing and second thing I need help with how should I approach the auth for this a centralize approach with RBAC( Role Based Access Control ) where I implement the auth in admin dashboard and expose the REST API for customer auth or I should manage different auth setup for both app any additional advice are also welcome

14 Replies

Boerboel
@Aditya Kirad seperation the customer and admin is good
also regarding auth, would admin only be for one user? or multiple can be admin for different store
Boerboel
and for the store front, would you want the customers to log in
Boerboel
alright if that's the case, for our model user table maybe include a role="CUSTOMER" | "ADMIN", and you can give your self admin
that way you can have one auth system
that handles for both
not sure if your planning to use jwt or other auth library
so it all depends.
if you use clerk you can assign role in the clerk dashboard itself
or supabase
@Boerboel not sure if your planning to use jwt or other auth library
I'm planning to use better-auth
any other advice @Boerboel