Skip to content

Backend application that both consumes and exposes APIs for a potential front-end app to utilize for prospective users. It can display current/future forecasted weather details at a designated destination location, and populate an image of the said location.

Notifications You must be signed in to change notification settings

Aferencz1987/Sweater_Weather

Repository files navigation

Sweater Weather (version 1.0)

Mod3 final project

Learning Goals:

  • Expose an API created using multiple APIs that requires authentication
  • Expose an API for CRUD functionality

Endpoints

An API key can be generated by creating a POST request that includes login information

GET /api/v1/forecast required params: "location"
GET /api/v1/background required params: "location"
POST /api/v1/users body must include: "email", "password", and "password_confirmation"
POST /api/v1/sessions body must include: "email" and "password"
POST /api/v1/road_trip body must include: "origin", "destination", and "api_key"

Sample Requests
GET /api/v1/forecast?location=denver,co
Content-Type: application/json
Accept: application/json
GET /api/v1/backgrounds?location=denver,co
Content-Type: application/json
Accept: application/json
POST /api/v1/users
Content-Type: application/json
Accept: application/json

{
  "email": "[email protected]",
  "password": "password",
  "password_confirmation": "password"
}
POST /api/v1/sessions
Content-Type: application/json
Accept: application/json

{
  "email": "[email protected]",
  "password": "password"
}
POST /api/v1/road_trip
Content-Type: application/json
Accept: application/json

body:

{
  "origin": "Denver,CO",
  "destination": "Pueblo,CO",
  "api_key": "234ve3xxxx"
}

Versions

  • Ruby 2.7.2
  • Rails 5.2.6

Necessary Gems

Design Ideas

Sweater Weather use the REST design structure.

Database

  • PostgreSQL
  • Users model
  • Facade, Service, PORO framework for additional objects

Testing

API consumption

To run Sweater Weather run this in command line

  • git clone
  • cd sw_final
  • bundle install
  • rails db:create
  • rails db:migrate
  • bundle exec rspec
  • rails server

About

Backend application that both consumes and exposes APIs for a potential front-end app to utilize for prospective users. It can display current/future forecasted weather details at a designated destination location, and populate an image of the said location.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published