MCPcopy Index your code
hub / github.com/duyet/pricetrack

github.com/duyet/pricetrack @v1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0 ↗ · + Follow
160 symbols 356 edges 86 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Price Track Project (inprogress)

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://abc@sentry.io/1362210 firebase functions:config:set pricetrack.cronjob_key=696969 firebase functions:config:set pricetrack.apiKey=xxxxxxooooooKMgWKRhUdY91 firebase functions:config:set pricetrack.admin_token=xxxxxxxxxx firebase functions:config:set pricetrack.gmail_email=pricetrack.apps@gmail.com 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 pricetrack.admin_email=lvduit08@gmail.com

    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. Setup the cronjob for /pullData: https://cron-job.org

    Cronjob pulling

  8. 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, ...

Core symbols most depended-on inside this repo

resError
called by 34
functions/utils/index.js
urlFor
called by 17
functions/utils/formater.js
getConfig
called by 9
functions/utils/config.js
regexProcess
called by 9
functions/utils/parser/utils.js
navigate
called by 8
hosting/src/components/Header/addUrlForm.js
normalizeUrl
called by 7
functions/utils/formater.js
withAuthentication
called by 7
hosting/src/components/Session/withAuthentication.js
select
called by 6
functions/config/vinabook.com.js

Shape

Function 63
Method 53
Class 44

Languages

TypeScript100%

Modules by API surface

hosting/src/pages/index.js13 symbols
functions/utils/parser/utils.js12 symbols
hosting/src/pages/my_product.js11 symbols
hosting/src/pages/add.js11 symbols
hosting/src/components/Session/withAuthentication.js10 symbols
hosting/src/components/Session/withAuthorization.js7 symbols
hosting/src/components/Block/SubscribeBox.js7 symbols
functions/utils/formater.js7 symbols
hosting/src/components/Session/withEmailVerification.js6 symbols
hosting/src/pages/cashback.js5 symbols
hosting/src/components/Block/FlashMessage.js5 symbols
hosting/src/pages/profile.js4 symbols

For agents

$ claude mcp add pricetrack \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact