Before we start this weekend build and learn, I would like to take a moment to thank you, all my readers, who always support me and provide me with some suggestions and guidance.

Image for post

Photo by Pro Church Media on Unsplash

You are the most important motivation for me to keep this journey going. If you like my weekend build and learn series, please follow me on Medium.

Use cases

Covid-19 has changed many of our daily life; with the new normal situation, we think and do things differently.

Every day, my wife and son are trying to get the latest update from the internet about the Covid-19 net new case growth in Ontario, Canada, which has become their daily routine.

This week, my son is busy with his school work. So he misses his routine. When my wife asks him about the number, he suddenly realizes that he forgets this essential daily activity. When he rushed out to the computer and started searching for the number, one of his words catches my attention.

Will be awesome if can get some push notification about those daily number!

“Right! What you give me a new idea for my next weekend, build and learn series. Thank you, son.”

The idea always comes from our daily life.

Image for post

Photo by AbsolutVision on Unsplash

Non-functional Requirements

Let’s see what we want to build before putting our hands on the keyboard, which is an important step.

  1. Rust lang.
  2. Cost-efficient.
  3. For push notification, let’s use the SMS for initial use cases, which Twilio provides some out of box feature. And most importantly, there is a free subscription too.
  4. Capability to scale to different use cases, such as email notification or even further chatbot implementation — design Pattern. (Dependency Inversion Principle and Open/Closed Principle)
  5. Timely scheduler — Cron job.
  6. Easy to build and deploy — My favorite Heroku.
  7. Accurate data source — Canada government website provided some open and trustable data sources.

Architecture & Dataflow

After some first-hand analysis:

  1. The data available on the website is the CSV file.
  2. The data will update daily at 7 PM EDT. Some time expect a 1-hour delay.
  3. That schema covered all we need, such as date, total new case number per Province, etc. For simplicity, we only focus on the entire new case number and total unique death number.
  4. When we finish processed, we need to clean up the tmp file. Mitigate un-necessary space and operational overhead.

#rust #covid19 #heroku #sms #canada

Build an SMS Alert System for Canada Covid-19 Cases over the weekend with Rust
1.10 GEEK