Sweater Weather is a backend Rails API for a hypothetical weather & trip planning app that connects to the Mapquest, Open Weather, and Pixabay exernal APIs.
This project was completed during the end of Module 3 of the Backend Engineering Program at Turing, which focuses on building and consuming API's.
Original Project Page
Technical Requirements
- Ruby 2.5.3
- Rails 6.0.3
- PostgreSQL database
- RSpec for testing
- Fork & clone the repo
- Run
bundle install
- Run
rails db:{create,migrate}
- Run
bundle exec figaro install
- Add your API keys to the newly created
config/application.yml
file. Reference the API Keys section below for compatible environment variable key naming. - To run local test suite:
bundle exec rspec
- All API responses in test suite are mocked using
webmock
andvcr
gems with the exception of the tests underspec/services
which test the original external API connections to three different sources.
Add these to your application.yml
file:
Mapquest API
GEOCODING_API_KEY: <api_key>
Open Weather API
OPEN_WEATHER_API_KEY: <api_key>
Pixabay API
PIXABAY_API_KEY: <api_key>
- Make sure to spin up a local server for Sweater Weather before trying to run the requests in Postman.
- From the project directory, run
rails s
. - The Postman collection below uses
http://localhost:3000
as the base domain.