DevonGifford / BulkBasics

This is one of my portfolio projects - a fully fledged ecommerce website
3 stars 0 forks source link

Storing the data on the backend - [Setting up FireStoreDB & Utilizing in FrontEnd] #8

Closed DevonGifford closed 1 year ago

DevonGifford commented 1 year ago
DevonGifford commented 1 year ago

Storing the data on the backend - Setting up FireStoreDB



  1. Adding some new mock data

    • As a test run I am going to add a bit more mock data with different types (i.e. Mens, Jackets, Shoes etc.)
    • Updating the shop-data json file
    • Reflecting changes in products.context (Temporarily breaks the shop page but after pushing the data up we will access the data via FireSotre)


  1. Creating a way to push this data to the FireStore DB

In the FireBase.utils;


In the Products.Context ;


  1. Pulling our data from the FireBase DB ;

In the FireBase.utils;


In the Products.Context ;



Implementing new FireStore Database



  1. Utilizing the CategoryMap data


  1. Updating the shop.component return structure

    • updated to reflect name change of ProductsContext
    • Created a method to map through data from FireStore db.
    • Used Fragment to wrap the entire return
    • Used Object.keys to turn keys into an array
    • Then mapped over the array to find the title
    • Passed the tile into another fragment
      • created heading for category item
      • copy pasted the old mapping function for each product
        • Updated naming convention to utilise categoriesMap