Skip to content

jnicho02/healthsites

 
 

Repository files navigation

Welcome to the healthsites code base!

Join the chat at https://gitter.im/healthsites/healthsites

Healthsites is a framework for capturing, publishing and sharing critical health and sanitation related data to help make these facilities more accessible and relevant to the communities they serve. Our framework does not limit our endeavours to these domains and in the future we plan to support additional domains where it is helpful in humanitarian work.

Please note that this project is in the early phase of its development.

You can visit a running instance of healthsites at healthsites.io.

Status

These badges reflect the current status of our development branch:

Tests status: Build Status

Coverage status: Coverage Status

Development status: Stories in Ready Stories in Ready

License

Data: Open Database License Code: Free BSD License

Out intention is to foster wide spread usage of the data and the code that we provide. Please use this code and data in the interests of humanity and not for nefarious purposes.

Setup instructions

Healthsites infrastructure is using docker, with django platform and has 2 database. The database are django database for django that contains all healthsites data, and another one is for docker osm database. Healthsites has docker osm mirror and needs it as main architecture. But all setup are easy to be done.
To setup the server, please follow the instruction.

Check out the source

First checkout out the source tree:

git clone git://github.com/healthsites/healthsites.git

Production setup

To start production setup, follow this steps

cd healthsites/deployment
make deploy

It will run all of architecture automatically and wait it until this error shows

django.db.utils.ProgrammingError: relation "django_site" does not exist
LINE 1: SELECT (1) AS "a" FROM "django_site" LIMIT 1

This is because database in the docker osm needs to be created. This database is created automatically by container of docker osm To fix it, just wait until the container done on creating database by checking it periodically. To check it

docker logs dockerosm_imposm

and see if it is creating database in logs like this

[Feb 16 09:15:13] [INFO] Imposm took: 1m49.293342244s
Import PBF successful : /home/settings/country.pbf
Installing QGIS styles.
SET
SET
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE

The estimation is about >3 hours for earth data.

After it is done, redo

cd healthsites/deployment
make deploy

and server is ready to be used. Server can be accessed in

http://localhost:49362

Creating admin user

Currently admin can't be accessed because it doesn't had admin user yet. To do it

cd healthsites/deployment
make shell
python manage.py createsuperusr

and fill the instruction shows on the terminal

I have initial database

If we already has initial backups database, we need to restore this database into server. To do it

cd healthsites/deployment
make dbrestore

Healthsites is using cache to fasten the process. To generate this process, some process needs to be done

cd healthsites/deployment
make shell
python manage.py gen_cluster_cache 48 46
python manage.py generate_countries_cache

Now, we want to link our data into docker osm data, to do that

cd healthsites/deployment
make shell
python manage.py check_localities_osm_id

This will taking a lot of time because docker osm is quite a big list.

Country data extraction

When we access page per country, there will be button to download shapefile. The generation of shapefile will be done in background for every 24 hours. But if we want to run it manually, we can do

python manage.py generate_shapefile_v2

Development setup

This development setup is just for PyCharm IDE. Please follow this steps.

cd healthsites/deployment
make devweb

After that, open projects at the pycharm. Right click django_project folder and Mark Directory as Source Root

Project settings

Next step is setup our project settings

1. Go to File -> settings
2. Go to Project: Healthsites -> Project Interpreter
3. Click `gear` icon and click `SSH Interpreter`
4. Fill host=localhost, username=root and port=49363
5. Next and fill password=docker
6. Next and change interpter to `/usr/bin/python`
7. Change sync folder with remote folder=healthsite folder/django_project and remote folder=/home/web/django_project
8. and click finish

Django settings

Next step is setup our django settings

1. Go to File -> settings
2. Go to languages & framework -> django
3. enable `Enable django support`
4. Django project root= locate this (<your healthsites folder>/django_project)
5. settings=core/settings/dev_docker.py
6. Click OK

Run configurations

Now project settings is setup, our next step is setup run configuration to run our development server.

1. Go to Run -> Edit Configuration
2. Click + icon and select django server
3. on the right, fill name with anything
4. Host=0.0.0.0
5. Port=8080
6. Python interpreter= Select the one that we create, which has sentences `localhost:49363`
7. Click OK and run!

About

Building an open data commons of health facility data with OpenStreetMap

Resources

License

Unknown, ODbL-1.0 licenses found

Licenses found

Unknown
LICENSE-CODE.txt
ODbL-1.0
LICENSE-DATA.txt

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 41.6%
  • JavaScript 18.2%
  • PLSQL 16.3%
  • HTML 15.5%
  • CSS 6.3%
  • Makefile 1.4%
  • Other 0.7%