0

I am trying to use firebase to build an e-commerce application. In the application, there will be normal customers that can buy items from a store. A store will have its own page where there will be a list of all the products that the store is selling. However, some people own multiple stores, so I want to be able to create a way for them to have an overview of all their stores too. For example, a customer named John can buy a product from a store named 'John's Electronics store'. John is a business owner that owns 'John's Electronics' and 'John's Sporting Goods'. John has managers at each store that should be able to handle the store's account, but John should be able to grant and revoke access for the managers.

Is there a name for this sort of architecture? I am unsure of the best way to model the data and permissions. I am building this application with Firebase's Cloud Firestore. I have thought of using custom claims. Any advice on how to go about doing this would be greatly appreciated as I am a beginner with this stuff.

Eric
  • 5
  • 2
  • Effective data modeling in Firestore is more about satisfying queries for the data to suit the needs of your app, and less about the relationships between any entities. There are no names of modeling techniques - there are just models that you come up with that are effective for you specific use cases. – Doug Stevenson Jun 30 '22 at 21:30
  • @DougStevenson Ok thanks. Can you recommend any resources that could help with effective data modelling in firestore? I have watched many of the tutorials on youtube including 'get to know cloud firestore' which is by the official firebase channel and a few other videos. – Eric Jun 30 '22 at 21:48