Skip to content

lsst-epo/weather-client-function

Repository files navigation

Cloud Function for the Meteoblue API

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.

Architecture

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
    
Loading

Deployment

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

Development

Start Development Server

Run local development server

yarn run start-dev

Testing

Run tests

yarn run test

To generate a code coverage report:

yarn run test -- --coverage

Notes

API keys need to be refreshed every year.

About

Google Cloud Function to obtain weather data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published