<commit_before># Safe Water API

API server that back the [Safe Waters dashboards](https://github.com/developmentseed/safe-water/).
Set of public dashboards for dispensers for safe water project to provide insight into its KPI's.
The structure and build of our dashboards are aimed at different stakeholders of the project, including a donor base that is part of the effective altruism movement and seeks to understand the data behind the program.

### Requirements
These dependencies are needed to build the app.

- Node (v4.2.x) & Npm ([nvm](https://github.com/creationix/nvm) usage is advised)

> The versions mentioned are the ones used during development. It could work with newer ones.
  Run `nvm use` to activate the correct version.

### Setup<commit_msg>Update readme with content and data docs<commit_after># Safe Water API

API server that provides the [Dispenser Dashboards](https://github.com/evidenceaction/Dispensers-Dashboard) with data and content.

## Content
The copy of each section is stored in its own markdown file in the [app/content](https://github.com/evidenceaction/Dispensers-Dashboard-API/tree/master/app/content) folder. To edit the content, click on the file-name of the section and then on the edit button:

![image](https://cloud.githubusercontent.com/assets/751330/15194515/3f9d9520-1791-11e6-9e17-f9a1fee2248c.png)

Each file should have roughly the following structure:

```
---
title: Access
---
Number of people served by dispensers across the three countries of operation. 

We collect and verify data on the number of households using a waterpoint. The number of people per household is estimated based on monthly evaluations of randomly selected households.
```

The `title` property between the hyphens indicates the title. Anything else between the hyphens will be ignored by the site.

All the text after the second `---`, will be regarded as the body text and can be styled using Markdown. For more information about the Markdown format, please see [this cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).

## Data
The API is powered by a SQLite database that is generated by a worker script (`worker/index.js`). It fetches the data from two locations:

1. the Access, Usage and Reliability sections are based on operational data from the Progmis database
2. the Carbon data is stored in a JSON file in `app/data/carbon-data.json`

The data is updated every time a commit is made to the master branch of this repository. Travis detects the change, will run the worker script and deploy a new version of the database to the server.

### Updating the dashboards
To trigger a data update, you will have to make a dummy commit to the master branch of this repo. That can be a simple edit in the Readme. Once the edit is made, it may take a couple of minutes for Travis to deploy the changes.

### Requirements
These dependencies are needed to build the app.

- Node (v4.2.x) & Npm ([nvm](https://github.com/creationix/nvm) usage is advised)

> The versions mentioned are the ones used during development. It could work with newer ones.
  Run `nvm use` to activate the correct version.

### Setup
{'fraction_non_alphanumeric': 0.06826801517067003, 'fraction_numerical': 0.01327433628318584, 'mean_word_length': 4.355329949238579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2415823', 'n_tokens_mistral': 869, 'n_tokens_neox': 823, 'n_words': 439}