This cloud function does some logic to get the next hour's weather data from meteoblue for the basic endpoint and the clouds endpoint.
See here for more info on the meteoblue API documentation.
Planned architecture
graph LR
subgraph RedisClient
basic-weather-stats
cloud-weather-stats
end
subgraph meteoblue
meteoblueapi
end
subgraph meteoblueclient
basic-stats
cloud-stats
end
subgraph Hasura
precipitationData
cloudData
end
meteoblueapi-->basic-stats
meteoblueapi-->cloud-stats
basic-stats-->basic-weather-stats
cloud-stats-->cloud-weather-stats
basic-weather-stats-->precipitationData
cloud-weather-stats-->cloudData
Hasura-->graphQL
First, build the typescript:
yarn build
The above command will create a /dist folder with the built Javascript.
Ensure you've populated the .env.yaml for Google Cloud Functions v2 deployment.
Then, ensure your gcloud CLI is pointed at the correct GCP project and deploy the cloud function:
sh deploy.sh
Run local development server
yarn run start-dev
Run tests
yarn run test
To generate a code coverage report:
yarn run test -- --coverage
API keys need to be refreshed every year.