Skip to content

Combines beers in Alko's catalog with their matching Untappd scores

License

Notifications You must be signed in to change notification settings

penny-five/alkotappd

Repository files navigation

Alkotappd

Status

What is this?

Application that combines beers in Alko's catalog with their matching Untappd scores.

Screenshot

Instructions

How to setup project on Google Cloud

  1. Create a new project on Google Cloud
  2. Add Firebase (https://console.firebase.google.com/)
  3. Enable Cloud Firestore API

How to start local dev environment

  1. Install dependencies

    yarn install
  2. Login with Firebase

    yarn firebase:login
  3. Set active Firebase project

    yarn firebase:use [project_id]
  4. Init emulators

    yarn firebase:emulators:init
  5. Start dev environment

    yarn dev

    This will do the following things:

    • Start Firebase emulator
    • Compile functions in watch mode
    • Start Vite dev server

    Open http://localhost:8080 in browser.

How to run tasks in local dev environment

  1. Start local dev environment as instructed

  2. Start Firebase emulator functions shell

    yarn firebase:functions:shell
  3. In functions shell run

    syncProducts();

    This will fetch all products from Alko catalog and add them to local Firestore.

  4. In functions shell run

    updateRatings();

    This will fetch ratings for 30 beers and add them to local Firestore.

    Be careful: Untappd API has a rate limit of 100 requests per hour and running this function once will consume 60% of that hourly quota.

    BATCH_SIZE variable in functions/src/tasks/update-ratings.ts can be modified to use a smaller batch size, resulting in less requests.

How to deploy to production

  1. Install dependencies

    yarn install
  2. Login with Firebase

    yarn firebase:login
  3. Set active Firebase project

    yarn firebase:use [project_id]
  4. Deploy

    yarn firebase:deploy

License

MIT.

About

Combines beers in Alko's catalog with their matching Untappd scores

Resources

License

Stars

Watchers

Forks