Skip to content

The main goal of Covid-19 Overview project is to demonstrate the usage of Flask web framework by building a simple application/website with a timely topic - Covid-19 virus

Notifications You must be signed in to change notification settings

p17griv/covid-19-overview-flask-project

 
 

Repository files navigation

Covid-19 Overview

Description

'Covid-19 Overview' is a Python Flask student project for "Internet Technologies" course of department of Informatics - Ionian University, made by Pashalis Grivas and Nemanja Jevtić. The main goal of this project is to demonstrate the usage of Flask web framework by building a simple application/website with a timely topic - Covid-19 virus.

The app fetches " COVID-19 cases worldwide " (JSON) dataset with Covid-19 data from EU Open Data Portal.


Features

Users are able to:

  • watch global total cases and deaths (until current day),
  • track total cases and deaths by continent (until current day),
  • be informed about total cases and deaths of all countries (until current day),
  • track cases and deaths for a specific country between two dates,
  • compare cases and deaths of two countries between two dates,
  • see the top N countries with the most cases/deaths for a specific N (until current day) and
  • watch the virus spread percentage per country (until current day).

All options are either visualized with tables or charts or both.


Installation - Instructions

  1. Run git clone (url of the repository) into a directory in order to download the project.

  2. Install python dependencies (Install Python 3 if you haven't)

    • pip3 install Flask (just pip on Windows)
    • pip3 install mysql-connector-python
    • pip3 install requests
  3. Create a user account in your MySQL server with: (use XAMPP with phpMyAdmin or install MySQL on your system)

    • username: user1
    • password: user1
    • host name (local): localhost
    • all data & structure rights

    Or change the host, user and passwd arguments in 'create_database.py' and 'json_to_database.py' files to match your server credentials.

    Follow the instructions below of how to create a new user (Linux)

  4. Start your MySQL server. (if you already haven't)

  5. Run the 'main.py' with:

    • python3 main.py command (it may take a while the first time)
  6. Open site with your browser using the following address:

Notes:

  • Safari and Internet Explorer 11 (or earlier) do not support HTML date input.

  • FIX ERROR (if raised):

    • "SELECT list is not in GROUP BY clause and contains nonaggregated column … incompatible with sql_mode=only_full_group_by"

    by running: SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY','')); command on your MySQL server.


Creating a new user on MySQL server (Linux)
  1. Connect to MySQL as root:

    • sudo mysql -h localhost -u root
  2. Create user running:

    • mysql> CREATE USER 'user1'@'localhost' IDENTIFIED BY 'user1';
  3. If ERROR 1819 (HY000) run:

    • mysql> SET GLOBAL validate_password_policy=LOW;

    and run again step 2.

    Remember to reset this value after you're done.

  4. Give privileges to the user:

    • mysql> GRANT ALL PRIVILEGES ON * . * TO 'user1'@'localhost';
  5. Run:

    • mysql> FLUSH PRIVILAGES;

    to reload privileges.

  6. Log out:

    • mysql> quit
  7. Connect as the new user (test):

    • mysql -u user1 -p user1

Database Schema

Image of the database schema

About

The main goal of Covid-19 Overview project is to demonstrate the usage of Flask web framework by building a simple application/website with a timely topic - Covid-19 virus

Topics

Resources

Stars

Watchers

Forks

Languages

  • HTML 63.9%
  • Python 32.0%
  • CSS 2.8%
  • JavaScript 1.3%