This repository contains code for a project that involves scraping product data from online stores and storing it in a Firebase Firestore database. The code consists of two main components:
-
Cloud Functions for Firebase: This directory contains Python code for Firebase Cloud Functions responsible for handling HTTP requests to add products to the Firestore database and delete products from it.
-
Frontend: This directory contains frontend code for the project, built using React.js. It includes Node modules and source files necessary for running the frontend application.
This Python script contains Cloud Functions for Firebase responsible for adding and deleting products from the Firestore database.
- Description: This function takes an HTTP request containing URLs of products and adds them to the Firestore database. It returns a response containing a message confirming the addition, the list of products added, and a custom ID for the collection.
- Description: This function takes an HTTP request containing the ID of a product to delete and deletes it from the Firestore database. It returns a response containing a message confirming the deletion, the ID of the deleted product, and the custom ID of the collection.
This Python script contains utility functions for scraping product data from online stores.
- Description: Retrieves products.json from a given store URL and page number.
- Description: Converts products.json to a Pandas DataFrame.
- Description: Extracts image links from the 'src' field in the 'images' column of the DataFrame.
- Description: Retrieves all products from a store and selects required fields to create a DataFrame.
- Description: Saves products from the provided URL into a JSON file and returns the products DataFrame along with the domain name.
This directory contains frontend code for the project, built using React.js.
To start the frontend, run the following commands:
npm install
npm start
To deploy the frontend, run the following commands:
npm run build
firebase deploy --only hosting
Ensure you have a .env
file with the REACT_APP_API_KEY
and REACT_APP_APP_ID
. Contact the developers for these keys if needed.
- https://2degrees.sg/collections/all
- https://kurasu.sg/collections/coffee-beans-1
- https://homegroundcoffeeroasters.com/collections/filter-coffee
- https://homegroundcoffeeroasters.com/collections/espresso-coffee
- https://latamcoffee.com/collections/all
- https://www.parchmen.co/collections/roasted-coffee-beans
- https://littlewolf.coffee/collections/coffee
- https://september.coffee/collections/coffee
- https://dayglow.coffee/collections/craft-coffee-1
- https://www.subtext.coffee/collections/filter-coffee-beans
- https://ethicaroasters.com/collections/filter-coffee
- https://shaughnessycafe.com/collections/coffee-beans
- https://rossocoffeeroasters.com/collections/coffee
- https://pilotcoffeeroasters.com/coffee
- https://onyxcoffeelab.com/collections/coffee
- https://counterculturecoffee.com/collections/coffee
For any queries or issues related to the keys or functionality, please contact the developers.