Code Monkey home page Code Monkey logo

sweater-weather's Introduction

Sweater Weather

languages rspec simplecov

Table of Contents

Background and Description

This app exposes six different endpoints to an imaginary Front End which allows users to get weather forecasts for road-trip destinations. The app allows users to see the current weather as well as the forecasted weather at the destination, at their ETA.

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
  • Research, select, and consume an API based on your needs as a developer

Requirements and Setup (for Mac):

Ruby and Rails Versions

  • Ruby Version 2.7.4
  • Rails Version 5.2.8

Gems Utilized

APIs Consumed

Setup

  1. Clone this repository: On your local machine open a terminal session and enter the following commands for SSH or HTTPS to clone the repositiory.
  • using ssh key
$ git clone [email protected]:johnny-bowman/sweater-weather.git
  • using https
$ git clone https://github.com/johnny-bowman/sweater-weather.git

Once cloned, you'll have a new local copy in the directory you ran the clone command in.

  1. Change to the project directory:
    In terminal, use $cd to navigate to the backend Application project directory.
$ cd sweater_weather
  1. Install required Gems utilizing Bundler:
    In terminal, use Bundler to install any missing Gems. If Bundler is not installed, first run the following command.
$ gem install bundler

If Bundler is already installed or after it has been installed, run the following command.

$ bundle install
  • There should be be verbose text diplayed of the installation process that looks similar to below. (this is not an actual copy of what will be output).
Click to see example!

$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.10
...
...
...
Using simplecov_json_formatter 0.1.4
Using simplecov 0.21.2
Using spring 2.1.1
Using spring-watcher-listen 2.0.1
Using standard 1.12.1
Bundle complete! 23 Gemfile dependencies, 94 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.


  • If there are any errors, verify that bundler, Rails, and your ruby environment are correctly setup.
  1. Figaro installation
  • Follow the figaro installation with the docs and get your api keys. Add all keys to your newly created config/application.yml file and add it to your .gitignore file if it wasn't automatically created. Be sure to read the all the docs for a deeper undestanding of the app and how to properly use the endpoints.
$ bundle exec figaro install
  1. Database Migration
    Before using the web application you will need to setup your databases locally by running the following command
$ rails db:{:drop,:create,:migrate}
  1. Startup and Access
    Finally, in order to use the web app you will have to start the server locally and access the app through a web browser.
  • Start server
$ rails s

At this point you should be able to access the endpoints with postman.

Endpoints provided

Click to see example!

                Prefix Verb URI Pattern                            Controller#Action
           api_v1_weather GET  /api/v1/weather(.:format)          api/v1/forecast#index
       api_v1_backgrounds GET  /api/v1/backgrounds(.:format)      api/v1/backgrounds#index
       api_v1_book_search GET  /api/v1/book-search(.:format)      api/v1/book_search#index
             api_v1_users POST /api/v1/users(.:format)            api/v1/users#create
          api_v1_sessions POST /api/v1/sessions(.:format)         api/v1/sessions#create
              api_v1_trip POST /api/v1/trip(.:format)             api/v1/trip#create


Contributors


Johnny Bowman (he/him)


This project follows the all-contributors specification.

sweater-weather's People

Contributors

johnny-bowman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.