DownDraft is an application in which users can get beer recommendations based on the forecast (temperature) and elevation of a planned outing.
About | Versions | Setup | Endpoints | Examples | Tests | Deployment | Developers | Acknowledgements
Visit us on Heroku or on Local Host 3000 to get started with the steps below.
- Ruby 2.5.3
- Rails 5.2.5
If you are running this API locally, follow the steps below:
- Fork and clone this repo
- Install gem packages by running
bundle
- Setup the database:
rails db:(drop,create,migrate,seed)
orrails db:setup
- Run command
rails s
and navigate to http://localhost:3000 to consume API endpoints below
If you are running the API via Heroku, simply consume endpoints below.
The following are all API endpoints. Note, some endpoints have optional or required query parameters.
- All endpoints run off base connector http://localhost:3000 on local or https://downdraft-backend.herokuapp.com/ on Heroku
Method | URL | Description |
---|---|---|
GET |
/api/v1/trips |
Retrieve all trips for a logged in user. |
GET |
/api/v1/trips/<trip_id> |
Retrieve a single trip. |
POST |
/api/v1/trips |
Create a trip. beer. |
DELETE |
/api/v1/trips/<trip_id> |
Delete a trip. |
Method | URL | Description |
---|---|---|
GET |
/api/v1/beers |
Retrieve all beers. |
GET |
/api/v1/beers/search?name=<beer_name> |
Retrieve all beers with a given name fragment. |
GET |
single beer id? |
Retrieve single beer. |
Method | URL | Description |
---|---|---|
GET |
/api/v1/1-day-forecast?location=<location> |
Retrieve a one day forecast for a given location. |
GET |
/api/v1/3-day-forecast?location=<location> |
Retrieve a three day forecast for a given location. |
Method | URL | Description |
---|---|---|
GET |
/api/v1/elevation?location=<location> |
Retrieves elevation for a given location. |
{
"data": {
"id": "70161319870140",
"type": "forecast",
"attributes": {
"location_name": "Denver",
"location_state": "Colorado",
"date": "2021-06-09",
"max_temp": 89.4,
"min_temp": 67.8,
"description": "Partly cloudy",
"icon": "//cdn.weatherapi.com/weather/64x64/day/116.png"
}
}
}
{
"data": {
"id": "70161284282460",
"type": "elevation",
"attributes": {
"elevation": 5354.3308799999995
}
}
}
Run all tests in application with bundle exec rspec
. When test is complete, run open coverage
to see where tests are being run and where they are not.
- To run this app locally, run
rails s
and navigate tohttp://localhost:3000/
in your browser. - To run this app on Heroku, go to https://downdraft-backend.herokuapp.com/
- Ruby on Rails
- Logan Anderson GitHub • LinkedIn
- Gaelyn Cooper GitHub • LinkedIn
- Joey Haas GitHub • LinkedIn
- Joe Mecha GitHub • LinkedIn
- Klaudia Stewart GitHub • LinkedIn
~ feel free to contact us ~
Thank you to Weather and Open Topo Data for allowing us to use your API's. Also, thanks to Open Beer DB for your CSV database. We'd like to thank you for checking out this project!