Skip to content

Down-Draft/downdraft-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Title

About

DownDraft is an application in which users can get beer recommendations based on the forecast (temperature) and elevation of a planned outing.

Table of contents

About | Versions | Setup | Endpoints | Examples | Tests | Deployment | Developers | Acknowledgements

Getting Started

Visit us on Heroku or on Local Host 3000 to get started with the steps below.

Versions

  • Ruby 2.5.3
  • Rails 5.2.5

Setup

If you are running this API locally, follow the steps below:

  1. Fork and clone this repo
  2. Install gem packages by running bundle
  3. Setup the database: rails db:(drop,create,migrate,seed) or rails db:setup
  4. 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.

Endpoints

The following are all API endpoints. Note, some endpoints have optional or required query parameters.

Trips:

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.

Beers:

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.

Forecast:

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.

Elevation:

Method URL Description
GET /api/v1/elevation?location=<location> Retrieves elevation for a given location.

Examples

A single day forecast for Denver, Colorado:

{
  "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"
    }
  }
}

The elevation in Denver, Colorado:

{
  "data": {
    "id": "70161284282460",
    "type": "elevation",
    "attributes": {
      "elevation": 5354.3308799999995
    }
  }
}

Running the Tests

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.

Deployment

Built Using

  • Ruby on Rails

Developers

~ feel free to contact us ~

Acknowledgments

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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •