I am building an e-commerce store on React hosted on Firebase. The products have a high number of variations. How do I create a Firestore collection of product catalogue with these variations? Based on the permutations of the product variations, I would end up with ~20,000 unique products, each of which should have a unique productID. The tutorial I am taking suggested creating a .js array first and writeBatch
to create a Firestore collection, but this seems really unfeasible when I need to generate ~20,000 unique products based on the possible variations.
An example of the variations that one product could have:
- Colours: 9 different colours
- Size: Small, big
- Customisation A: Yes, No
- Customisation B: Yes, No
- Customisation C: Yes, No
- Customisation D: Yes, No
- If yes for customisation D, customisation E: Yes, No. If no for customisation D, customisation F: variation 1, 2 or 3.
How should I go about this? Appreciate any advice.