Code Monkey home page Code Monkey logo

covidashit's Introduction

COVID-19 Italy Monitor | #StayAtHome

Versione Italiana qui

A simple dashboard to monitor the COVID-19 outbreak in Italy, using the dataset provided by the Civil Protection (CP)

Preview

Mobile Desktop
alt_text alt_text
The app is deployed on Heroku → here
The data is taken from the CP repo → here

For developers

The WebApp uses a Flask server and gunicorn in front of it, and it only requires Python3.6+. Furthermore, it employs Flask-babel for the italian translation. The script make_pot.sh creates the needed files. A Batch version of the script is provided for Windows users. The website's language is decided upon the client request. The back-end retrieves the data and it serves it to the front-end chart and cards. I'm not using any db as, luckily enough, there isn't too much data to store, and hopfully there will not be, ever.

The front-end is under covidashit/templates and it uses a simple JS to create the chart object, which is built using HighCharts. Additionally, bar chart races are produced every day with a scheduled cron job that runs a script from BCR2Mongo.

Thanks to the bar-chart-race library maintainers.

Setup a local version

  • create and activate a virtual environment (follow this)
  • install the requirements in requirements.txt
Development

Clone the repo, cd into it, and

$ export FLASK_ENV=development
$ export FLASK_DEBUG=1
$ python -m flask run

Flask will be listening at http://127.0.0.1:5000

Production

The provided Dockerfile is ready to be used to deploy the app on Heroku. To test the production environment locally, uncomment L18 and L31 of the Dockerfile, and run

$ docker build --tag covidashit:latest . 
$ docker run --name covidashit -d -p 80:5000 covidashit

The docker container will be listening at http://127.0.0.1

Additional note

The app can be deployed on Heroku either as a docker container or simply using the Procfile

Donation

If you liked this project or if I saved you some time, feel free to buy me a beer. Cheers!

paypal

covidashit's People

Contributors

fabriziomiano avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.