Skip to content

rittschapp/NodeJS-Covid-Graph-AWS-Lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

covid19

A simple Node.JS AWS lambda function to generate a daily graph of COVID-19 case 'counts' as reported by BCCDC since the start of the pandemic. It is imperfect data at both ends of the chart: testing couldn't keep up to start, tests today are no longer counted.

Please Note: Current implementation may take up to 30 seconds or more to download the data and process the chart. Once the image is generated, it is cached for up to 24 hours. Hence, subsequent requests should only take a second or two. Make sure to set the Timeout for the Lambda function to 30 seconds.

View the lambda output here!

Usage

The application is meant to be deployed as a lambda function with a Timeout of 30 seconds.

Deployment also requires Lambda process environment variables:

for the plotly library username and token are provided at https://www.plotly.com/

  • PLOTLY_USER: Username for the plotly library
  • PLOTLY_TOKEN: API token for the plotly library

for the AWS S3 storage bucket

  • REGION
  • BUCKET_NAME
  • BUCKET_KEY

Data Source

http://www.bccdc.ca/Health-Info-Site/Documents/BCCDC_COVID19_Dashboard_Case_Details.csv

Recent Improvements

  • Add to-from dates in Graph title
  • Caching image so it does not need to be generated every time
  • Added test cases

Future Improvements

  • Look into accelerated Lambda startup (snapstart)
  • Handle waiting on graph without need of global variable (using 'promise')
  • Auto test & deploy on commit
  • Improvements to error handling (allow retrieval of stale image)
  • Caching datafile so it doesn't need to download every time (takes too long)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published