The Internet Health Report is a Mozilla's "initiative to document and explain what’s happening to the health of the Internet combining research from multiple sources".
This repository contains the code for the report of the year 2018.
In order to run this project on your machine, you need the following programs:
Here are the steps to run the project for the first time:
- Clone the repository:
git clone git@github.com:Vizzuality/internet-health-report.git
- Go to the folder:
cd internet-health-report
- Install the dependencies:
yarn
- Copy
.env.sample
, rename the copy.env
and set the variables (see below) - Build the project:
yarn build
- Build and run the Docker image in a terminal:
docker-compose -f docker-compose.yml build && docker-compose -f docker-compose.yml up
- Run the development server in another:
yarn dev
- Go to http://localhost:3000 and create an account in Wordpress
- Change the theme to "Internet Health Report 2018"
Later on, you just need to run these steps:
- Run the image in a terminal:
docker-compose -f docker-compose.yml up
- Run the development server in another:
yarn dev
- Go to http://localhost:3000
The package.json
file contains 3 scripts:
yarn dev
: run a proxy server with Browsersync, listen to changes in the files and compile/transpile themyarn build
: build the project for productionyarn test
: run the linter on the Javascript files
The source files are located in /src
and the output folder is /www/wp-content/themes/ihr-2018
. The development server runs a proxy of the Docker one to allow refreshes of the page whenever a file of the source folder is modified. The Sass files are compiled in a CSS stylesheet, the ES6 files transpiled into an ES5 script, the PHP files are just copied to the destination folder and the images are minified and also copied to the destination. By default, the Javascript code is not minified and the source maps are enabled.
When running yarn build
, the same process is run but the JS files are minified and no source map is generated. Note that there is no server in this case.
A .env
file is located at the root of the project. It contains the environment variables the Javascript code needs.
Here is a list of them:
- No variable yet