BYOB is a backend application with a queriable dataset derived from the UNHCR. This detaset includes 2017 Refugee Resettlement data. When queried, this API can yield the total number of refugees resettled into specific countries, the total number of refugees resettled from specific countries, and the total number of minors who were resettled from those specific countries.
See it live @ Heroku
This is a general guide to setting up a Refugee Resettlement Data development environment on your local machine.
The following guides provide more step-by-step instructions:
- Express
- Node
- PostgreSQL database
- Knex
If you are planning on contributing code to the project, begin by forking this repo using the Fork
button in the top-right corner of this screen. You should then be able to use git clone
to copy your fork onto your local machine.
git clone https://github.com/Haub/byob.git
cd byob
npm install
npm run test
git add .
git commit -m "Add a commit message describing your change here"
git push origin branch-name-here
Use the GitHub UI to submit a new pull request.
- Write tests for your code
- Make sure the whole test suite is passing
- Keep your PR small, with a single focus
- Maintain a clean commit history
- Use a style consistent with the rest of the codebase
GET
None
Code: 200
Content:
{ "id": 37, "dest_country": "Argentina", "grand_total": "105", "created_at": "2018-12-05T23:53:01.403Z", "updated_at": "2018-12-05T23:53:01.403Z" },
None
POST
dest_country
grand_total
Code: 200
Content:
{message: New country with id of 43 inserted successfully.}
Code: 422
Content: { error: Expected format: { dest_country: <String>, grand_total: <Number> }. You're missing a property.}
GET
id=[integer]
Code: 200
Content:
{ "id": 37, "dest_country": "Argentina", "grand_total": "105", "created_at": "2018-12-05T23:53:01.403Z", "updated_at": "2018-12-05T23:53:01.403Z" },
Code: 404
Content: { error: Could not find countries with id 15}
PUT
id=[integer]
Code: 202
Content:
{ message: Country with id of 12 changed successfully. }
Code: 404
Content:
{ error: Could not find countries with id 15 }
GET
None
Code: 200
Content:
{ "id": 37, "origin_country": "El Salvador", "individual_total": "1005", "total_minors": "340", "dest_country_id": "43"" "created_at": "2018-12-05T23:53:01.403Z", "updated_at": "2018-12-05T23:53:01.403Z" },
None
POST
origin_country
individual_total
total_minors
dest_country_id
Code: 201
Content:
{ message: New demograpics with id of 4 inserted successfully. }
Code: 422
Content: { error: Expected format: { origin_country: <String>, individual_total: <String>, total_minors: <String>, dest_country_id: <String> }. You're missing a required parameter property.}
GET
id=[integer]
Code: 200
Content:
{ "id": 37, "origin_country": "El Salvador", "individual_total": "1005", "total_minors": "340", "dest_country_id": "43"" "created_at": "2018-12-05T23:53:01.403Z", "updated_at": "2018-12-05T23:53:01.403Z" },
Code: 404
Content: { error: Could not find demographics entry with id 15}
GET
origin_country=[string]
Code: 200
Content:
{ "id": 40, "origin_country": "Sudan", "individual_total": "1005", "total_minors": "340", "dest_country_id": "43"" "created_at": "2018-12-05T23:53:01.403Z", "updated_at": "2018-12-05T23:53:01.403Z" }, { "id": 40, "origin_country": "Sudan", "individual_total": "3400", "total_minors": "1040", "dest_country_id": "72"" "created_at": "2018-12-05T23:53:01.403Z", "updated_at": "2018-12-05T23:53:01.403Z" }
Code: 404
Content: { error: Could not find demographics entry with id 41}
PUT
id=[integer]
Code: 202
Content:
{message: Demographics entry with id of 12 changed successfully.}
Code: 404
Content: { error: Could not find countries with id 15}