This is a project that will send regular updates to the subscribers about coronavirus statistics in their country.
- A web app where visitors can subscribe for regular updates and/or check the current stats.
- Subscribers will recieve emails daily about the stats in their country.
- The information is gathered and updated in real time from Worldometers which collects this data from reliable sources such as Governments' communication channels.
- Frontend: HTML, CSS, JS, React
- Backend: Python (Flask framework)
- Database: AWS RDS (MySQL)
- Hosting: AWS EC2 instance
git clone https://github.com/g-bhagwanani/coronavirus-updates.git
virtualenv myvenv
source myvenv/bin/activate
pip install -r requirements.txt
cd frontend
npm install
You will need to create a MySQL database (We have used MySQL Commmunity Engine of Amazon RDS which comes under AWS free tier).
Open the file local_settings.py
in the root directory of the project.
Theese are the variables that need to be set in order to store data of subscribers, and send them email updates.
In the root directory,
source myvenv/bin/activate
python run.py
You need node and npm installed on your machine in order to run the react server.
In the root directory,
cd frontend
npm start
The following commands are used to populate the CSV files that supply data to the frontend
In the root directory,
source myvenv/bin/activate
python refresh_csv.py
python daily_stats.py
It is expected to setup cron jobs for these commands. daily_stats.py
is used to store the history of stats of each country. So, this file should be run once a day. refresh_csv.py
is used to store the current stats of each country, so this file should be run at small intervals so that the stats remain up-to-date.
The following command is used to send emails to subscribers about the stats in their country.
In the root directory,
source myvenv/bin/activate
python send_mail.py
A cron job can be set to run this command at the same time every day to send stats to the users.