OpenBeta Graph API allows other applications to access the OpenBeta climbing database using any standard GraphQL clients.
Endpoint:
- Production: https://api.openbeta.io
- Development: https://stg-api.openbeta.io
We recommend using an online playground to explore the API.
Get all sub-areas at Smith Rock
query Example1 {
areas(name: "Smith Rock") {
area_name
children {
area_name
metadata {
lat
lng
}
}
}
}
# Result
{
"data": {
"areas": [
{
"area_name": "Smith Rock",
"children": [
{
"area_name": "Aggro Gully",
"metadata": {
"lat": 44.36724,
"lng": -121.14238
}
},
{
"area_name": "Angel Flight Crags",
"metadata": {
"lat": 44.5672,
"lng": -122.1269
}
},
...
]
}
]
}
}
- Add '127.0.0.1 mongodb' entry to your
/etc/hosts
file (or C:\Windows\System32\drivers\etc\hosts on Windows)
127.0.0.1 mongodb
- Launch mongodb dev stack: database server and mongo-express (web-based admin console for mongo):
docker compose up -d
- Seed the development database
yarn install
yarn refresh-db # download USA data files locally and import
yarn update-stats # update statistics
- Start the GraphQL server
yarn serve
-
Fix "permissions on /opt/keyfile/keyfile are too open" error This error appears because the keyfile is required to be read-only
chmod 400 keyfile
-
Fix "error opening file: /opt/keyfile/keyfile: bad file" error This may appear after you update the keyfile to read-only access. The file needs to be owned by the same owner of the mongodb process
chown 999:999 keyfile
-
Browse the database: http://localhost:8081
-
GraphQL online playground: https://graphiql-online.com/
-
Full stack development
Connect your frontend dev env to this local server
# Run this in open-tacos project yarn dev-local
-
Make sure to include
.js
when importing other files:... import { getClimbModel } from '../db/ClimbSchema.js' // .js is required ...
Why? See this issue for an explanation.
-
Advanced database commands:
# Download & import USA data files. Also create all other countries. yarn refresh-db full # Remove 'full' to import only a small dataset # Re-import USA from previously downloaded data files (cache dir: ./tmp) # Note: this command will drop and recreate the 'areas' and 'climbs' collection. yarn seed-usa # Add all countries (except for USA) yarn add-countries # Update area statistics (can be rerun as needed) yarn update-stats
-
MongoDB playground: https://mongoplayground.net/
This project is under active development. Join us on Discord!
The source code is licensed under the Affero GPL v3.0 license.
Thanks goes to these wonderful people (emoji key):
Kendra Gibbons 💻 🤔 |
Paul Phillips 🤔 |
admanny 💻 |
Colin Gale 💻 🤔 |
Brendan Downing 💻 🤔 |
Darren Lew 🤔 💻 |
Sundev 💻 🤔 |
Siman Shrestha 💻 🤔 |
Silthus 🤔 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!