Table of Contents
Whether, Sweater? is a 5 day solo project during Mod 3 of 4 for Turing School's Back End Engineering Program.
The objective of Whether, Sweater? is to expose an API for a front-end team to consume in a service-oriented architecture. The app is for planning road trips and allows a user to have weather information for the current location and destination.
Learning Goals:
- Expose an API that aggregates data from multiple external APIs
- Expose an API that requires an authentication token
- Expose an API for CRUD functionality
- Determine completion criteria based on the needs of other developers
- Research, select, and consume an API based on your needs as a developer
route | description |
---|---|
GET /api/v1/forecast?location=LOCATION | Get forecast information for a specific location |
GET /api/v1/background?location=LOCATION | Get a background image for a specific location |
POST /api/v1/users | Enter email, password, and password confirmation to create a new user |
POST /api/v1/sessions | Return user along with api key from login information |
POST /api/v1/road_trip | Enter origin and destination to receive road trip information |
- Ruby 2.7.2
- Rails 5.2.6
- PostgreSQL
- RSpec
- SimpleCov
- Factory Bot/Faker
- Fast JSON API
- Rubocop
This project requires Ruby 2.7.2.
- Fork this repository
- Clone the fork
- From the command line, install gems and set up your DB:
bundle install
rails db:{create,migrate,seed}
- Run the test suite with bundle exec rspec.
- Run your development server with rails s to see the app in action.
-
Ruby version
$ ruby -v ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin20]
-
$ rails -v Rails 5.2.6
-
Database creation
$ rails db:{drop,create,migrate} Created database 'wether_sweater_development' Created database 'wether_sweater_test'
-
How to run the test suite
$ bundle exec rspec -fd
-
Local Deployment, for testing:
$ rails s => Booting Puma => Rails 5.2.6 application starting in development => Run `rails server -h` for more startup options Puma starting in single mode... * Version 3.12.6 (ruby 2.7.2-p137), codename: Llamas in Pajamas * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://localhost:3000 Use Ctrl-C to stop
-
MapQuest API
- MapQuest Developer Page
- Click Sign Up in Navigation menu
- Fill in information to create account
- Redirects to a page with a section for My Keys
- Install Figaro gem
- Add key to config/application.yml as the value for MAPQUEST_KEY
-
OpenWeather API
- OpenWeather Sign Up Page
- Fill in information to create account
- Redirects to a page with to view API key
- Make sure Figaro has been installed
- Add key to config/application.yml as the value for OPENWEATHER_KEY
-
Unsplash API
- Unsplash Registration
- Fill in information to create account
- Add new application
- Make sure Figaro has been installed
- Add Access key to config/application.yml as the value for UNSPLASH_KEY
Project Link: Whether, Sweater?