Git Product home page Git Product logo

compare-cart's Introduction

Compare Cart

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:

  1. 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.

  2. 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.

Cloud Functions for Firebase

functions/main.py

This Python script contains Cloud Functions for Firebase responsible for adding and deleting products from the Firestore database.

add_products_callable

  • 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.

delete_product_callable

  • 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.

functions/fn_scraper.py

This Python script contains utility functions for scraping product data from online stores.

get_json

  • Description: Retrieves products.json from a given store URL and page number.

to_df

  • Description: Converts products.json to a Pandas DataFrame.

extract_image_links

  • Description: Extracts image links from the 'src' field in the 'images' column of the DataFrame.

get_products

  • Description: Retrieves all products from a store and selects required fields to create a DataFrame.

return_products_as_json_string_and_domain

  • Description: Saves products from the provided URL into a JSON file and returns the products DataFrame along with the domain name.

Frontend

frontend

This directory contains frontend code for the project, built using React.js.

Running the Frontend

To start the frontend, run the following commands:

npm install
npm start

Deploying the Frontend

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.


Tested Links for the Web App


For any queries or issues related to the keys or functionality, please contact the developers.

compare-cart's People

Contributors

angjustin avatar googlercolin avatar gracerxw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.