amcguire17 / whether_sweater

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues LinkedIn


Whether, Sweater?

Table of Contents
  1. About The Project
  2. Setup
  3. Contributing

About The Project

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

Endpoints

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

Built With

  • Ruby 2.7.2
  • Rails 5.2.6
  • PostgreSQL
  • RSpec
  • SimpleCov
  • Factory Bot/Faker
  • Fast JSON API
  • Rubocop

Setup

This project requires Ruby 2.7.2.

Installation

  1. Fork this repository
  2. Clone the fork
  3. From the command line, install gems and set up your DB:
    • bundle install
    • rails db:{create,migrate,seed}
  4. Run the test suite with bundle exec rspec.
  5. Run your development server with rails s to see the app in action.

Project Configurations

  • Ruby version

    $ ruby -v
    ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin20]
  • System dependencies

    $ 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
    

API Keys

  • MapQuest API

    1. MapQuest Developer Page
    2. Click Sign Up in Navigation menu
    3. Fill in information to create account
    4. Redirects to a page with a section for My Keys
    5. Install Figaro gem
    6. Add key to config/application.yml as the value for MAPQUEST_KEY
  • OpenWeather API

    1. OpenWeather Sign Up Page
    2. Fill in information to create account
    3. Redirects to a page with to view API key
    4. Make sure Figaro has been installed
    5. Add key to config/application.yml as the value for OPENWEATHER_KEY
  • Unsplash API

    1. Unsplash Registration
    2. Fill in information to create account
    3. Add new application
    4. Make sure Figaro has been installed
    5. Add Access key to config/application.yml as the value for UNSPLASH_KEY

Contact

Amanda McGuire

Project Link: Whether, Sweater?

About


Languages

Language:Ruby 99.6%Language:HTML 0.4%