This is an application that enables the discovery of rock climbing locations and rock climbers around the world. You can browse the climbers featured in this application and see which climbing locations they have been to.
This application is powered by an API that conforms to the REST architectural style. The API returns JSON-encoded responses and uses standard HTTP response codes.
Visit the following URL to see the app in action:
This app connects to a Postgres server hosted in Heroku. Anyone can view the climbing locations and climbers. An account login with specific permissions is needed in order to add, edit, and remove climbing locations and climber profiles. These are specified below.
Administrator login (can add, edit, and remove climbing locations and climber profiles):
- email: ********
- password: ********
Climber login (can add, edit, and remove climber profiles only):
- email: ********
- password: ********
Run this in the terminal:
cd YOUR_PROJECT_DIRECTORY_PATH/
virtualenv --no-site-packages env OR virtualenv env
source env/bin/activate (MacOS/Linux) OR source env/Scripts/activate (Windows)
Additional instructions can be found here.
In the project folder, run the following:
pip install -r requirements.txt OR pip3 install -r requirements.txt
In the project folder, run the following:
python app.py
The app connects to a Postgres database hosted in Heroku, so there is no need to run the database server locally.
Multiple tests have been created in order to test that the behavior of the endpoints are as expected.
Assuming the virtual environment has been initlaized / activated and the dependencies have been installed based on the instructions above, run the following in the project folder:
python test_app.py
This test also connects to a Postgres database hosted in Heroku, so there is no need to run the database server locally.
200 - OK (The request has succeeded)
400 - Bad Request (The server cannot process the request due to a client error)
401 - Unauthorized (The request requires user authentication)
403 - Forbidden (The server understood the request, but is refusing to fulfill it)
404 - Not Found (The requested resource doesn't exist)
/climbing-spots
/climbing-spots
Request requirements (id is optional)
body:
{
'id' : '[SPOT ID]',
'name' : '[SPOT NAME]',
'location' : '[SPOT CITY AND STATE]'
}
headers:
{
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + [ACCESS TOKEN]
}
/climbing-spots/[SPOT ID]
Request requirements
body:
{
'name' : '[SPOT NAME]',
'location' : '[SPOT CITY AND STATE]'
}
headers:
{
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + [ACCESS TOKEN]
}
/climbing-spots/[SPOT ID]
Request requirements
headers:
{
'Authorization': 'Bearer ' + [ACCESS TOKEN]
}
/climbers
/climbers
Request requirements (id is optional)
body:
{
'id' : '[CLIMBER ID]',
'name' : '[CLIMBER NAME]',
'state' : '[CLIMBER STATE]',
'visited_spots' : '[SPOT IDS SEPARATED BY COMMA]'
}
headers:
{
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + [ACCESS TOKEN]
}
/climbers/[CLIMBER ID]
Request requirements
body:
{
'name' : '[CLIMBER NAME]',
'state' : '[CLIMBER STATE]',
'visited_spots' : '[SPOT IDS SEPARATED BY COMMA]'
}
headers:
{
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + [ACCESS TOKEN]
}
/climbing-spots/[CLIMBER ID]
Request requirements
headers:
{
'Authorization': 'Bearer ' + [ACCESS TOKEN]
}
This documentation was created by Joshua Kagawa