- Glad you asked! Sweater Weather is an API backend client that has multiple endpoints to satisfy your need to look up weather at a certain location, find a road trip end point weather conditions and trip duration, as well as finding munchies along the way.
This app was implemented utilizing ruby V2.5.3.
-
System dependencies are:
- 'rails 6.1.1'
- 'figaro'
- 'faraday'
- 'fast_jsonapi'
- 'bcrypt', '~> 3.1.7'
-
Testing dependencies are:
- 'rspec'
- 'capybara'
- 'simplecov'
- 'shoulda-matchers'
- 'webmock'
- 'vcr'
- To install this app:
- Clone repository
- run 'bundle install' in CLI
- run 'rails db:{create,migrate}' in CLI
- run 'figaro install' in CLI
- navigate to config/application.yml and implement your API keys, you will need:
- WEATHER_API_KEY (provided from OpenWeather)
- LOCATION_API_KEY (provided from MapQuest API)
- IMAGE_API_KEY (provided from Bing services)
- BUISNESS_API_KEY (provided from Yelp - key includes 'Bearer' tag)
- run 'bundle exec rspec' in CLI and you should expect 55 passing tests
- acceptable parameters are 'location' (string - i.e. Denver,CO) and units (string - 'imperial' or 'metric') * this end point allows the requestor to find weather information for a specified location, sample output of this endpoint:
{
"data": {
"id": null,
"type": "forecast",
"attributes": {
"temp": 3.61,
"day_feels_like": 0.0,
"description": "broken clouds",
"date": "2021-01-19 14:43:10 -0700",
"clouds": 72,
"sunset": "2021-01-19 17:04:03 -0700",
"sunrise": "2021-01-19 07:17:07 -0700",
"humidity": 27,
"uvi": 0.59,
"visability": 10000,
"icon": "04d",
"hourly_weather": [
{
"time": "14:00:00",
"temp": 3.61,
"wind_speed": 2.32,
"wind_direction": "SSE",
"description": "broken clouds",
"icon": "04d"
}, ...
],
"daily_weather": [
{
"date": "2021-01-19",
"max_temp": 3.61,
"min_temp": -2.1,
"description": "overcast clouds",
"sunset": "2021-01-19 17:04:03 -0700",
"sunrise": "2021-01-19 07:17:07 -0700",
"icon": "04d"
}, ...
]
}
}
}
- acceptable parameters are 'location' (string - i.e. Denver,CO) * this end point allows the requestor to find a picture for a specified location, sample output of this endpoint:
{
"data": {
"id": null,
"type": "background",
"attributes": {
"bing_logo": "https://static.wikia.nocookie.net/logopedia/images/e/ee/Bing_2016.svg/revision/latest/scale-to-width-down/1000?cb=20160115161107",
"microsoft_privacy_agreement": "https://go.microsoft.com/fwlink/?LinkId=521839",
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Denver_skyline.jpg/1200px-Denver_skyline.jpg",
"width": 1200,
"height": 794,
"host_page": "https://en.wikipedia.org/wiki/Denver",
"host_page_display": "https://en.wikipedia.org/wiki/Denver",
"date_published": "2020-05-09T05:48:00.0000000Z"
}
}
}
- parameters must be sent as a json payload, acceptable parameters are email, password, password_confirmation (all strings)
- this end point allows the requestor generate a new user in the internal data base and build and associated api_key, sample response below:
- parameters must be sent as a json payload, acceptable parameters are email, password (all strings)
- this end point allows the requestor verify a user by their email and password - returns email and api_keys, sample response below:
- parameters must be sent as a json payload, acceptable parameters are 'origin' and 'destination' (string - i.e. Denver,CO), api_key (string provided from user data) and units (string - 'imperial' or 'metric')
- this endpoint allows the requestor to build a roadtrip that will return trip details, sample response below:
- acceptable parameters are 'origin' and 'destination' (string - i.e. Denver,CO), food (string - type of restaurant i.e. chinese) and units (string - 'imperial' or 'metric')
- this endpoint allows the requestor to fetch trip details similar to roadtrip but will include a restaurant of your food choice at the destination, sample response below:
- OpenWeather
- Yelp
- MapQuest
- Bing