Commit c684d7cb authored by Cédric Bonhomme's avatar Cédric Bonhomme

Switch back to line feed (LF).

parent 4d7123f2
{
"directory" : "src/web/static/lib"
}
{
"directory" : "src/web/static/lib"
}
Cédric Bonhomme <cedric@cedricbonhomme.org>, Luxembourg Institute of Science and Technology
Damien Nicolas <damien.nicolas@list.lu>, Luxembourg Institute of Science and Technology
Cédric Bonhomme <cedric@cedricbonhomme.org>, Luxembourg Institute of Science and Technology
Damien Nicolas <damien.nicolas@list.lu>, Luxembourg Institute of Science and Technology
<<<<<<< HEAD
Shelter Database project news
0.3 (2016-08-02)
......@@ -10,9 +9,3 @@ Shelter Database project news
0.1 (2016-04-10)
* first stable prototype with base functionalities.
=======
Shelter Database project news
0.1 (2015-03-30)
- initial release.
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
The MIT License (MIT)
Copyright (c) 2016 CHARISM
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2016 CHARISM
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Shelter Database
================
# Presentation
The goal of this application is to list the shelters deployed around the world.
The official instance is available [here](https://shelter-database.org).
Read the [documentation](https://git.list.lu/charism/shelter-database/tree/master/documentation)
for information about the deployment of the application.
# Documentation
To generate the documentation in HTML format:
./documentation$ sudo pip install sphinx
./documentation$ make html
The result will be in the *_build* folder.
# License
This application is under MIT license.
# Contact
[Luxembourg Institute of Science and Technology](http://www.list.lu)
Shelter Database
================
# Presentation
The goal of this application is to list the shelters deployed around the world.
The official instance is available [here](https://shelter-database.org).
Read the [documentation](https://git.list.lu/charism/shelter-database/tree/master/documentation)
for information about the deployment of the application.
# Documentation
To generate the documentation in HTML format:
./documentation$ sudo pip install sphinx
./documentation$ make html
The result will be in the *_build* folder.
# License
This application is under MIT license.
# Contact
[Luxembourg Institute of Science and Technology](http://www.list.lu)
{
"name": "shelter-database",
"version": "0.0.2",
"authors": [
"Cédric Bonhomme <cedric.bonhomme@list.lu>",
"Maarten van der Veen <mvanderveen@redcross.nl>"
],
"license": "MIT",
"ignore": [
"**/.*"
],
"dependencies": {
"jquery": "~1.11.3",
"bootstrap-select": "~1.7.5",
"bootstrap": "~3.3.6",
"font-awesome": "4.6.3",
"datatables.net": "~1.10.10",
"datatables.net-bs": "~1.10.10",
"tinymce": "^4.3.12",
"bootstrap-datepicker": "^1.6.1",
"lightbox2": "lightbox#^2.8.2"
}
}
{
"name": "shelter-database",
"version": "0.0.2",
"authors": [
"Cédric Bonhomme <cedric.bonhomme@list.lu>",
"Maarten van der Veen <mvanderveen@redcross.nl>"
],
"license": "MIT",
"ignore": [
"**/.*"
],
"dependencies": {
"jquery": "~1.11.3",
"bootstrap-select": "~1.7.5",
"bootstrap": "~3.3.6",
"font-awesome": "4.6.3",
"datatables.net": "~1.10.10",
"datatables.net-bs": "~1.10.10",
"tinymce": "^4.3.12",
"bootstrap-datepicker": "^1.6.1",
"lightbox2": "lightbox#^2.8.2"
}
}
<p><span style="font-size: medium;">Hundreds of thousands of shelters are built throughout the world every year in response to disasters, by a multitude of shelter actors. </span></p>
<p><span style="font-size: medium;">Confronted with the reality of rising numbers of disasters where sheltering presents a key component of the humanitarian assistance the Humanitarian Shelter Sector is challenged to deliver more, efficient and sustainable responses in very different contexts. </span></p>
<p><span style="font-size: medium;">Within the Red Cross Movement and other Organisations active in sheltering there exists extensive experience in the implementation of emergency, transitional and permanent shelters.</span></p>
<p><span style="font-size: medium;">To consolidate and make available this knowledge the IFRC-SRU is tasked to build up an inventory of shelter solutions documented in a systematic, methodological manner that particularly captures technical details, construction practices, climatic conditions, availability and suitability of materials and techniques and other information for the planning process that helps save time and resources.</span></p>
<p><span style="font-size: medium;">The Shelter Database is conceived to be a resource for the wider shelter sector, that can help to deliver humanitarian shelter more time- and cost efficient and better adapted to the respective context. The collected data can also serve for technical analysis as well as longer term evaluation of shelter solutions and to identify and share best practices.<br /> The IFRC-SRU has the ambition to systematically map shelter projects in responses where the Shelter Cluster was activated and led by IFRC, however we invite all shelter actors to participate in building up this resource by entering their shelter project using the online format (to enter a shelter, create your profile under &#8220;join&#8221;).</span></p>
<p><span style="font-size: medium;">Hundreds of thousands of shelters are built throughout the world every year in response to disasters, by a multitude of shelter actors. </span></p>
<p><span style="font-size: medium;">Confronted with the reality of rising numbers of disasters where sheltering presents a key component of the humanitarian assistance the Humanitarian Shelter Sector is challenged to deliver more, efficient and sustainable responses in very different contexts. </span></p>
<p><span style="font-size: medium;">Within the Red Cross Movement and other Organisations active in sheltering there exists extensive experience in the implementation of emergency, transitional and permanent shelters.</span></p>
<p><span style="font-size: medium;">To consolidate and make available this knowledge the IFRC-SRU is tasked to build up an inventory of shelter solutions documented in a systematic, methodological manner that particularly captures technical details, construction practices, climatic conditions, availability and suitability of materials and techniques and other information for the planning process that helps save time and resources.</span></p>
<p><span style="font-size: medium;">The Shelter Database is conceived to be a resource for the wider shelter sector, that can help to deliver humanitarian shelter more time- and cost efficient and better adapted to the respective context. The collected data can also serve for technical analysis as well as longer term evaluation of shelter solutions and to identify and share best practices.<br /> The IFRC-SRU has the ambition to systematically map shelter projects in responses where the Shelter Cluster was activated and led by IFRC, however we invite all shelter actors to participate in building up this resource by entering their shelter project using the online format (to enter a shelter, create your profile under &#8220;join&#8221;).</span></p>
<p><strong>Please Note: this is work in progress, any comments and corrections are most welcome. Please contact us under <a href="mailto:ifrc-sru@croix-rouge.lu">ifrc-sru@croix-rouge.lu</a></strong></p>
\ No newline at end of file
<p><span style="font-size: medium;">Des centaines de milliers d'abris sont construits à travers le monde chaque année en réponse aux catastrophes, par une multitude d'acteurs du logement.</span></p>
<p><span style="font-size: medium;">Face à la réalité du nombre croissant de catastrophes où le recouvrement présente une composante clé de l'aide humanitaire du secteur du logement humanitaire est mis au défi de fournir plus de réponses, efficaces et durables dans des contextes très différents.</span></p>
<p><span style="font-size: medium;">Dans le Mouvement de la Croix-Rouge et d'autres organisations actives dans l'abri, il existe une vaste expérience dans la mise en œuvre d'urgence, de transition et des abris permanents.</span></p>
<p><span style="font-size: medium;">Pour consolider et mettre à la disposition de cette connaissance la FICR-SRU est chargé de mettre en place un inventaire des solutions d'hébergement documentés d'une manière méthodologique systématique qui capte particulièrement les détails techniques, les pratiques de construction, les conditions climatiques, la disponibilité et les qualités des matériaux et des techniques et d'autres informations pour le processus de planification qui permet d'économiser du temps et des ressources.</span></p>
<p><span style="font-size: medium;">La base de données de Shelter est conçu pour être une ressource pour le secteur du logement plus large, qui peut aider à fournir un abri humanitaire plus de temps et de coûts efficace et mieux adaptée au contexte respectif. Les données recueillies peuvent également servir à l'analyse technique ainsi que évaluation à long terme des solutions d'hébergement et d'identifier et de partager les meilleures pratiques.</span></p>
<p><span style="font-size: medium;">La FICR-SRU a l'ambition de cartographier systématiquement les projets de logement dans les réponses où le Shelter Cluster a été activé et dirigé par la FICR, mais nous invitons tous les acteurs du logement pour participer à la construction de cette ressource en entrant leur projet d'abris en utilisant le format en ligne (pour entrer un abri, créez votre profil sous "join").</span></p>
<p><span style="font-size: medium;">S'il vous plaît noter: ce travail est en cours, tous les commentaires et corrections sont les bienvenues. S'il vous plaît nous contacter sous <a href="mailto:ifrc-sru@croix-rouge.lu">ifrc-sru@croix-rouge.lu</a></span></p>
<p><span style="font-size: medium;">Des centaines de milliers d'abris sont construits à travers le monde chaque année en réponse aux catastrophes, par une multitude d'acteurs du logement.</span></p>
<p><span style="font-size: medium;">Face à la réalité du nombre croissant de catastrophes où le recouvrement présente une composante clé de l'aide humanitaire du secteur du logement humanitaire est mis au défi de fournir plus de réponses, efficaces et durables dans des contextes très différents.</span></p>
<p><span style="font-size: medium;">Dans le Mouvement de la Croix-Rouge et d'autres organisations actives dans l'abri, il existe une vaste expérience dans la mise en œuvre d'urgence, de transition et des abris permanents.</span></p>
<p><span style="font-size: medium;">Pour consolider et mettre à la disposition de cette connaissance la FICR-SRU est chargé de mettre en place un inventaire des solutions d'hébergement documentés d'une manière méthodologique systématique qui capte particulièrement les détails techniques, les pratiques de construction, les conditions climatiques, la disponibilité et les qualités des matériaux et des techniques et d'autres informations pour le processus de planification qui permet d'économiser du temps et des ressources.</span></p>
<p><span style="font-size: medium;">La base de données de Shelter est conçu pour être une ressource pour le secteur du logement plus large, qui peut aider à fournir un abri humanitaire plus de temps et de coûts efficace et mieux adaptée au contexte respectif. Les données recueillies peuvent également servir à l'analyse technique ainsi que évaluation à long terme des solutions d'hébergement et d'identifier et de partager les meilleures pratiques.</span></p>
<p><span style="font-size: medium;">La FICR-SRU a l'ambition de cartographier systématiquement les projets de logement dans les réponses où le Shelter Cluster a été activé et dirigé par la FICR, mais nous invitons tous les acteurs du logement pour participer à la construction de cette ressource en entrant leur projet d'abris en utilisant le format en ligne (pour entrer un abri, créez votre profil sous "join").</span></p>
<p><span style="font-size: medium;">S'il vous plaît noter: ce travail est en cours, tous les commentaires et corrections sont les bienvenues. S'il vous plaît nous contacter sous <a href="mailto:ifrc-sru@croix-rouge.lu">ifrc-sru@croix-rouge.lu</a></span></p>
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,25 +21,25 @@ Examples of requests to the Web Service
# Get the translations of a string
$ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
=======
Web Services
============
Example of requests to the Web Service
--------------------------------------
.. code-block:: shell
# Get the list of root categories
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_null"}]}
# Get the list of child categories
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"}]}
# Get information about the child category "Walls & Frame"
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"},{"name":"name","op":"eq","val":"Walls %26 frame"}]}
# Get information about an attribute
$ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Landform"}]}
$ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Main hazards in country"}]}
# Get the translations of a string
$ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
Web Services
============
Example of requests to the Web Service
--------------------------------------
.. code-block:: shell
# Get the list of root categories
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_null"}]}
# Get the list of child categories
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"}]}
# Get information about the child category "Walls & Frame"
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"},{"name":"name","op":"eq","val":"Walls %26 frame"}]}
# Get information about an attribute
$ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Landform"}]}
$ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Main hazards in country"}]}
# Get the translations of a string
$ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
......@@ -42,47 +42,47 @@ Examples
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type/open fire
#get all shelters which have a specific attribute value
=======
Web Services
============
Usage of the development API v0.1
---------------------------------
request parameters:
**attribute**: pass one or more attribute names, such as `<attribute=Name,Vegetation>`
NOTE: Currently the attribute names may contain capital letters and spaces.
Spaces should be substituted as `<%20>` int the URL, for example
`<Climate%20Zone>`. An alternative "coding-friendly" attribute naming will be implemented shortly,
as unique strings for each attribute whithout spaces and upper case letters.
**format**: use `<format=prettytext>` to get the nicely formatted attribute names in the JSON,
instead of the "coding-friendly" attribute names.
Examples:
.. code-block:: shell
http://0.0.0.0:5000/api/v0.1
# Welcome message and version info
http://0.0.0.0:5000/api/v0.1/shelters
# Get all shelters and their attributes
http://0.0.0.0:5000/api/v0.1/shelters/3
# Get a specific shelter via shelter ID
http://0.0.0.0:5000/api/v0.1/shelters?attribute=Vegetation
# Get all shelters which have an atttribute value for "Vegetation"
http://0.0.0.0:5000/api/v0.1/shelters?attribute=vegetation&format=prettytext
# Get all shelters which have an atttribute value for "Vegetation", with nicely formatted attribute names
http://0.0.0.0:5000/api/v0.1/attributes/Climate zone
# Get all available values of an attribute
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type
#get all shelters which have a specific attribute
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type/open fire
#get all shelters which have a specific attribute value
Web Services
============
Usage of the development API v0.1
---------------------------------
request parameters:
**attribute**: pass one or more attribute names, such as `<attribute=Name,Vegetation>`
NOTE: Currently the attribute names may contain capital letters and spaces.
Spaces should be substituted as `<%20>` int the URL, for example
`<Climate%20Zone>`. An alternative "coding-friendly" attribute naming will be implemented shortly,
as unique strings for each attribute whithout spaces and upper case letters.
**format**: use `<format=prettytext>` to get the nicely formatted attribute names in the JSON,
instead of the "coding-friendly" attribute names.
Examples:
.. code-block:: shell
http://0.0.0.0:5000/api/v0.1
# Welcome message and version info
http://0.0.0.0:5000/api/v0.1/shelters
# Get all shelters and their attributes
http://0.0.0.0:5000/api/v0.1/shelters/3
# Get a specific shelter via shelter ID
http://0.0.0.0:5000/api/v0.1/shelters?attribute=Vegetation
# Get all shelters which have an atttribute value for "Vegetation"
http://0.0.0.0:5000/api/v0.1/shelters?attribute=vegetation&format=prettytext
# Get all shelters which have an atttribute value for "Vegetation", with nicely formatted attribute names
http://0.0.0.0:5000/api/v0.1/attributes/Climate zone
# Get all available values of an attribute
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type
#get all shelters which have a specific attribute
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type/open fire
#get all shelters which have a specific attribute value
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
This diff is collapsed.
Database migrations
===================
Add a new migration script
--------------------------
.. code-block:: shell
python3.5 src/manager.py db revision -m "comment about the changes"
Then edit appropriately the generated file.
Update the database to the last version
---------------------------------------
.. code-block:: shell
python3.5 src/manager.py db upgrade
See the history of the migrations on the current database
---------------------------------------------------------
.. code-block:: shell
python3.5 src/manager.py db history
Database migrations
===================
Add a new migration script
--------------------------
.. code-block:: shell
python3.5 src/manager.py db revision -m "comment about the changes"
Then edit appropriately the generated file.
Update the database to the last version
---------------------------------------
.. code-block:: shell
python3.5 src/manager.py db upgrade
See the history of the migrations on the current database
---------------------------------------------------------
.. code-block:: shell
python3.5 src/manager.py db history
Database schema
===============
.. figure:: _static/uml_graph.png
:align: center
Database diagram
Database schema
===============
.. figure:: _static/uml_graph.png
:align: center
Database diagram
This diff is collapsed.
This diff is collapsed.
......@@ -42,45 +42,45 @@ Web Services
api
api_v0.1
=======
.. Shelter Database documentation master file, created by
sphinx-quickstart on Sun Jun 19 21:53:46 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Presentation
============
The goal of this application is to list the shelters deployed around the world.
The official instance is available `here <https://shelter-database.org>`_.
Deployment
==========
.. toctree::
:maxdepth: 3
deployment
pdf-generation
test-server
Database
========
.. toctree::
:maxdepth: 2
database-schema
database-migrations
Web Services
============
.. toctree::
:maxdepth: 2
api
.. Shelter Database documentation master file, created by
sphinx-quickstart on Sun Jun 19 21:53:46 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Presentation
============
The goal of this application is to list the shelters deployed around the world.
The official instance is available `here <https://shelter-database.org>`_.
Deployment
==========
.. toctree::
:maxdepth: 3
deployment
pdf-generation
test-server
Database
========
.. toctree::
:maxdepth: 2
database-schema
database-migrations
Web Services
============
.. toctree::
:maxdepth: 2
api
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
This diff is collapsed.
PDF generation
==============
If you want to enable the generation of PDF you will need to install the
following requirements.
Requirements
------------
.. code-block:: shell
sudo apt-get install libxml2-dev libxslt-dev libcairo-dev libffi-dev libpango1.0-dev
# to include JPEG images in PDF files
sudo apt-get install libgdk-pixbuf2.0-dev
sudo pip3.5 install cairocffi weasyprint
PDF generation
==============
If you want to enable the generation of PDF you will need to install the
following requirements.
Requirements
------------
.. code-block:: shell
sudo apt-get install libxml2-dev libxslt-dev libcairo-dev libffi-dev libpango1.0-dev
# to include JPEG images in PDF files
sudo apt-get install libgdk-pixbuf2.0-dev
sudo pip3.5 install cairocffi weasyprint
This diff is collapsed.
#! /usr/bin/env sh
# drop completely the db (with the sequences)
sudo -u postgres dropdb shelter
sudo -u postgres createdb shelter --no-password
echo "ALTER USER pgsqluser WITH ENCRYPTED PASSWORD 'pgsqlpwd';" | sudo -u postgres psql
echo "GRANT ALL PRIVILEGES ON DATABASE shelter TO pgsqluser;" | sudo -u postgres psql
#! /usr/bin/env sh
# drop completely the db (with the sequences)
sudo -u postgres dropdb shelter
sudo -u postgres createdb shelter --no-password
echo "ALTER USER pgsqluser WITH ENCRYPTED PASSWORD 'pgsqlpwd';" | sudo -u postgres psql
echo "GRANT ALL PRIVILEGES ON DATABASE shelter TO pgsqluser;" | sudo -u postgres psql
This diff is collapsed.
This diff is collapsed.
"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
def upgrade():
${upgrades if upgrades else "pass"}
def downgrade():
${downgrades if downgrades else "pass"}
"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
def upgrade():
${upgrades if upgrades else "pass"}
def downgrade():
${downgrades if downgrades else "pass"}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.