pltfrm
is an AWS platform / portfolio application / demonstration site, and a chance to explore new
technologies and ideas. It pulls together various ideas I’ve been working on for a couple of years, providing a chance to build and maintain a reasonably complex application
Parts
- wthr : use a Weather API to build up data in a time series database.
- pltfrm-web : React/Vite front end for weather charts.
wthr
This stage is a simple weather application, which uses the OpenWeatherMap API to retrieve weather data for a given location - where I live. It exposes APIs to call for current and forecasted weather, and also stores data in Timestream, AWS’s time-series database, that allows me to (a) build up history, and also (b) see how forecasts can change over time.
Pipeline
The core part of wthr
is a processing pipeline - an Eventbridge
rule triggers a Lambda
to call the OpenWeather API to download forecasts. This data is processed (redundantly) in three ways - stored in it’s raw format in S3
, and then events are publised both an SNS
topic and an Event Bus. The payloads going to the EventBus are (for now) just published to an SQS queue (I wanted to learn how Event Bus) works; the topic is subscribed to by a queue, that in turn triggers another Lambda
which writes the data both to several DynamoDB
tables, and also to Timestream
, to be used for graphs.
App Sync
I also wanted to learn how to use App Sync and GraphQL, so there’s an AppSync
API querying the DynamoDB tables directly, and also has a Lambda
Resolver
for customized responses.
Data model
The OpenWeather API supports a single call to an endpoint that returns a lot of information. I split this up and store it as follows:
- a Timestream table
pltfrm-weather-day-table
which just holds hourly data points for temperature, with dimensions of the current weather as a word. I don’t really use this yet, but I have some extensions in mind for time series. - a DynamoDB table
PltfrmWeatherWeather
: this is the current snapshot of the weather, and has various metrics and like cloud and wind, plus an array of rain for each minute over the next hour. - a DynamoDB table
PltfrmWeatherForecastHour
with the detailed forecast for the next hour. - a DynamoDB table
PltfrmWeatherForecastDay
with the detailed forecast for the next day.
The latter tables are stored each hour and day respectively, which means I’m collecting a dataset which offers the chance for two projects I’ve been wanting to do for a while; (a) a little visualization showing how the forecast changes over time (on Monday it says it will be sunny on the weekend; did it change over the week ?) and (b) ML to predict tomorrow’s weather based on today.
pltfrm-web
pltfrm-web provides - currently - a very simple UI with some weather charts. This is pulling together a React/Vite application and a BFF API, as well giving me a quick chance to explore Netlify.
The back end is just an API Gateway
calling a Lambda
which in turn calls the OpenWeather API to download forecasts and current weather. It includes a nice block of descriptive text.
Future Extensions
- IoT sensors - I have a dozen Raspberry Pis lying around.