Application that combines beers in Alko's catalog with their matching Untappd scores.
- Create a new project on Google Cloud
- Add Firebase (https://console.firebase.google.com/)
- Enable Cloud Firestore API
-
Install dependencies
yarn install
-
Login with Firebase
yarn firebase:login
-
Set active Firebase project
yarn firebase:use [project_id]
-
Init emulators
yarn firebase:emulators:init
-
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.
-
Start local dev environment as instructed
-
Start Firebase emulator functions shell
yarn firebase:functions:shell
-
In functions shell run
syncProducts();
This will fetch all products from Alko catalog and add them to local Firestore.
-
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 infunctions/src/tasks/update-ratings.ts
can be modified to use a smaller batch size, resulting in less requests.
-
Install dependencies
yarn install
-
Login with Firebase
yarn firebase:login
-
Set active Firebase project
yarn firebase:use [project_id]
-
Deploy
yarn firebase:deploy
MIT.