Git Product home page Git Product logo

pricetrack's Introduction

Price Track Project (inprogress)

GitHub top language Website Uptime Robot ratio (7 days)

Deploy Functions Deploy Hostings

Auto collect, visualize and alert for product items.

Live: https://pricetrack.web.app or https://tracker.duyet.net

Support

Home page Home page Home page Home page Raw API

Installation

  1. Set up Node.js and the Firebase CLI You'll need a Node.js environment. This project is written with Nodejs 8.x. After that, install the Firebase CLI via npm:

    npm install -g firebase-tools
    

    To initialize project: Run firebase login to log in via the browser and authenticate the firebase tool.

    Setup packages: cd functions/ && npm install

  2. Go to https://console.firebase.google.com and create new project.

  3. Setup env variables, copy and modify env.example.sh to env.local.sh

    firebase functions:config:set pricetrack.sentry_dsn=https://[email protected]/1362210
    firebase functions:config:set pricetrack.cronjob_key=696969
    firebase functions:config:set pricetrack.api_key=xxxxxxooooooKMgWKRhUdY91
    firebase functions:config:set pricetrack.admin_token=xxxxxxxxxx
    firebase functions:config:set [email protected]
    firebase functions:config:set pricetrack.gmail_password=xxxxxxxxxx
    firebase functions:config:set pricetrack.hosting_url=https://tracker.duyet.net
    firebase functions:config:set pricetrack.accesstrade_deeplink_base=https://fast.accesstrade.com.vn/deep_link/4557459014401077484
    firebase functions:config:set [email protected]
    firebase functions:config:set pricetrack.worker_custom_domain=
    

    Run: bash ./env.local.sh

  4. Test in local: https://firebase.google.com/docs/functions/local-emulator

    • Export local configs: firebase functions:config:get > functions/.runtimeconfig.json
    • Start firebase: firebase serve
    • Start hosting local: cd hosting && npm run develop
    • Open UI: http://localhost:8000
  5. Deploy serverless functions and hosting to Firebase

    firebase deploy
    

    You can also start this project locally via: firebase serve

    All functions will be list at Firebase Dashboard:

    Firebase Dashboard

  6. Test your API

    Add new URL: https://<your-project>.cloudfunctions.net/addUrl?url=<your-url>

    Test API

    List: https://<your-project>.cloudfunctions.net/listUrls

    Test API

    Pull data: https://<your-project>.cloudfunctions.net/pullData?url=<your-url>

    Test API

    Query in raw data: https://<your-project>.cloudfunctions.net/query?url=<your-url>&fields=datetime,price&limit=100

    Test API

  7. Check out the UI: https://tracker.duyet.net

    Home page

Technology

  • UI Website for result (Gatsby.js, React.js)
  • Cronjob: Firebase Cloud Scheduler
  • Deployment:
    • API: Firebase Functions
    • Database: Firebase Firestore
    • Web: Firebase Hosting, GatsbyJS
  • CICD: Github Workflows

Next Step

  • Support for more ecommerce websites.
  • Move worker pullData to another services (worker.dev, Google App Scripts, ...) to reduce cost.
  • Auto trigger BUY, Add to cart, ...

pricetrack's People

Contributors

renovate-bot avatar duyet avatar dependabot[bot] avatar imgbotapp avatar azure-pipelines[bot] 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.