-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/restore-db-script
- Loading branch information
Showing
7 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ __pycache__/ | |
|
||
.DS_Store | ||
|
||
*.pg_restore | ||
venv/ | ||
coverage.xml | ||
|
||
*.pg_restore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Contributing | ||
|
||
The Humanitarian API (HAPI) is being developed by a team from the [Centre for Humanitarian Data](https://centre.humdata.org/). | ||
|
||
HDX developers are using [Visual Code](https://code.visualstudio.com/) as a standard IDE for this project with development taking place inside Docker containers. | ||
|
||
The following needs to be run once to setup the Docker containers for testing: | ||
|
||
```shell | ||
cd docker | ||
docker-compose up -d | ||
docker-compose exec -T hapi sh -c "apk add git" | ||
docker-compose exec -T hapi sh -c "pip install --upgrade -r requirements.txt" | ||
docker-compose exec -T hapi sh -c "pip install --upgrade -r dev-requirements.txt" | ||
cd .. | ||
./initialize_test_db.sh | ||
``` | ||
|
||
Tests can either be run from the Visual Code test runner or with: | ||
|
||
```shell | ||
docker-compose exec -T hapi sh -c "pytest --log-level=INFO --cov=. --cov-report term --cov-report xml:coverage.xml" | ||
``` | ||
|
||
A local copy of HAPI can be run by importing a snapshot of the database using the following shell script invocation in the host machine. | ||
|
||
```shell | ||
./restore_database.sh https://github.com/OCHA-DAP/hapi-pipelines/raw/db-export/database/hapi_db.pg_restore hapi | ||
``` | ||
|
||
The HAPI application can then be launched using the `start` launch configuration in Visual Code, this serves the documentation at `http://localhost:8844/docs` and the API at `http://localhost:8844/api` in the host machine. | ||
|
||
The HAPI database can be accessed locally with the following connection details: | ||
|
||
``` | ||
URL: jdbc:postgresql://localhost:45432/hapi | ||
username: hapi | ||
password: hapi | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Overview | ||
|
||
This GitHub repository implements the Humanitarian API (API), this includes the API endpoints themselves, API documentation and documentation on readthedocs. | ||
|
||
This project is currently in development and the outputs are not yet public except for the `readthedocs` documentation: | ||
|
||
* HAPI documentation | ||
* HAPI endpoint root | ||
* [readthedocs](https://hdx-hapi.readthedocs.io/en/latest/) | ||
|
||
# Related repositories | ||
|
||
1. [Schema for HAPI database in SQLAlchemy](https://github.com/OCHA-DAP/hapi-sqlalchemy-schema) | ||
2. [HDX HAPI smoke tests](https://github.com/OCHA-DAP/hdx-hapi-smoke-tests) | ||
3. [Pipelines to populate the HAPI database](https://github.com/OCHA-DAP/hapi-pipelines) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters