need advice with building e-commerce application
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 welcome3 Replies
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.
is medusa a good option and will there be any problem if I host it on subdomain
I never used medusa, but it definitely sounds interesting