The world has been hit by novel coronavirus pretty badly. Cities around the world have been locked down to prevent the spreading of novel coronavirus. Covid19 is the disease created by this novel coronavirus.
I have created a website where people can compare historical data of covid19 situations among different countries.
I wanted to show covid19 related data of countries visually. Also, an important target was to let people compare data of different countries in the same timeline.
I faced some challenges in my journey. Here I am explaining those.
The first problem was data. Data is the most important thing. There are lots of different APIs where you can get various types of data. Some APIs are open for all. Some are not.
We now have a very sweet problem in the software industry. There are too many programming languages, frameworks and libraries out there. We now have to choose technology very carefully considering our skills and desired work.
I wanted this website to be either server-side rendered website or a static one. These types of websites perform better in the case of SEO.
I will be explaining my choice more in the next section.
NextJs supports both static site generation per page and also server-side rendering. With its 9.3 version release, NextJs has gone to a different level. New methods like
getServerSideProps etc. are helping NextJs to become a true hybrid framework.
GatsbyJs, on the other hand, is a Static Site Generator. GatsbyJs also allows us to make API calls on the fly. It is a great framework packed with various out of the box plugins. It utilizes modern technologies like GraphQl, React, etc.
Now, for hosting option, I wanted to use a serverless hosting solution. This would help me to worry less about managing servers. There are a lot of serverless hosting solutions like Zeit, Netlify, Firebase etc.
I have a full-time job. And after office hours, I spend a lot of time with family. So, I needed a way to build this website fast without affecting my normal routine.
I choose GatsbyJs for creating the website. Although NextJs has some pretty good static site generation options, GatsbyJs is built for Static sites. You can deploy GatsbyJs in almost any kind of servers and hosting services. NextJs can be deployed in Zeit's serverless hosting solution. But, GatsbyJs has far more alternatives.
Also, GatsbyJs has a vast array of plugins and starters. This plugins and starters help you to build website fast.
For hosting solution, Zeit was an obvious solution for me. For personal projects, Zeit maybe has the most generous free tier. They literally offer unlimited bandwidth, build time, custom domains and projects for personal websites. With the help of webhooks and their CLI, deployment is something, you do not need to even worry about with Zeit. So, I did not much time to setup domain, CI/CD and other deployment-related works.
In the Challenges section, I listed 3 sources from where I fetched data. I needed to modify JSON output from those APIs. I chose Google Cloud Platform's Cloud Functions for this task. For small jobs like this, GCP functions, AWS lambda, etc. could be a very fast and convenient option.
And for the visual representations, I chose ChartJs. ChartJs is very easy and straight forward. So, to complete the website in a minimum time possible, I used ChartJs.