Giter Club home page Giter Club logo

express_sweater_weather's People

Contributors

joripeterson avatar

Watchers

 avatar  avatar

express_sweater_weather's Issues

User can remove locations from favorites' list

As a user, when I send a delete request to "/api/v1/favorites"
With a saved location and valid API key in the body of the request
I see a status code of "204"
And that location is no longer in my favorites' list

If I send an invalid API key, I get a request with a status code of "401"

Example Request:

DELETE /api/v1/favorites
Content-Type: application/json
Accept: application/json

body:

{
  "location": "Denver, CO",
  "api_key": "jgn983hy48thw9begh98h4539h4"
}

Example Response:

status: 204

Check the following:

  • Happy path testing is implemented
  • Story is tested in postman
  • Sad path is tested in postman
  • Finished story is deployed to Heroku
  • Finished story is tested on Heroku

User can request forecast for city

As user, when I send a get request to "/api/v1/forecast?location=denver,co"
And I send my API key key in the body,
An API call is made to Google Geocode that retrieves the longitude and latitude
The location, lat, and lng are stored in the database
And an API call is made to Darksky API with the lat and lng

Example Request:

GET /api/v1/forecast?location=denver,co
Content-Type: application/json
Accept: application/json

body:
{
  "api_key": "jgn983hy48thw9begh98h4539h4"
}

Check the following:

  • Happy path testing is implemented
  • Story is tested in postman
  • Sad path is tested in postman
  • Finished story is deployed to Heroku
  • Finished story is tested on Heroku

Update README

  • Introduction
  • Initial Setup
  • How to Use
  • Known Issues
  • Running Tests
  • How to Contribute
  • Core Contributors
  • Schema Design
  • Tech Stack List

User receives list of favorite locations and current weather

As user, if I send in a get request to "/api/v1/favorites"
With a valid API key in the body of the request
I receive a response with a "200" status code,
And a list of all cities favorited, associated with that API key,
And I see a current weather forecast for each favorite location

If I send in an invalid API key, I receive a response status of "401"

Example Request:

GET /api/v1/favorites
Content-Type: application/json
Accept: application/json

body:

{
  "api_key": "jgn983hy48thw9begh98h4539h4"
}

Example Response:

status: 200
body:
[
  {
    "location": "Denver, CO",
    "current_weather": {
      "summary": "Overcast",
      "icon": "cloudy",
      "precipIntensity": 0,
      "precipProbability": 0,
      "temperature": 54.91,
      "humidity": 0.65,
      "pressure": 1020.51,
      "windSpeed": 11.91,
      "windGust": 23.39,
      "windBearing": 294,
      "cloudCover": 1,
      "visibility": 9.12,
    },
    "location": "Golden, CO",
    "current_weather": {
      "summary": "Sunny",
      "icon": "sunny",
      "precipIntensity": 0,
      "precipProbability": 0,
      "temperature": 71.00,
      "humidity": 0.50,
      "pressure": 1015.10,
      "windSpeed": 10.16,
      "windGust": 13.40,
      "windBearing": 200,
      "cloudCover": 0,
      "visibility": 8.11,
    }
  }
]

Check the following:

  • Happy path testing is implemented
  • Story is tested in postman
  • Sad path is tested in postman
  • Finished story is deployed to Heroku
  • Finished story is tested on Heroku

Create User Table

Users should have:

email: string
password_digest: string
api_key: string

User can login for API key

As a user, when I send a post request to "/api/v1/sessions"
With my email and password in the body of the request
I receive a response with the status code of "200"
And I receive an API key in the body

Example Request:

POST /api/v1/sessions
Content-Type: application/json
Accept: application/json

{
  "email": "[email protected]",
  "password": "password"
}

Example Response:

status: 200
body:

{
  "api_key": "jgn983hy48thw9begh98h4539h4",
}

Check the following:

  • Happy path testing is implemented
  • Story is tested in postman
  • Sad path is tested in postman
  • Finished story is deployed to Heroku
  • Finished story is tested on Heroku

Create README Skeleton

  • Introduction
  • Initial Setup
  • How to Use
  • Known Issues
  • Running Tests
  • How to Contribute
  • Core Contributors
  • Schema Design
  • Tech Stack List

Current Roadblocks

Heroku!

Formatting (and consol logging) response from DarkSky

Add in user API key requirement

Look up location before first API call

User receives forecast for requested city

As a user, after sending a request (issue #14 )
if I send a valid API key
I will receive a response with the location
And a "currently", "hourly", and "daily" summary
The response should contain  at least 8 hourly objects and 7 daily objects

If I do not send in a valid API key, I receive a response with a status of "401"

Example Response:

{
  "location": "Denver, C0",
  "currently": {
      "summary": "Overcast",
      "icon": "cloudy",
      "precipIntensity": 0,
      "precipProbability": 0,
      "temperature": 54.91,
      "humidity": 0.65,
      "pressure": 1020.51,
      "windSpeed": 11.91,
      "windGust": 23.39,
      "windBearing": 294,
      "cloudCover": 1,
      "visibility": 9.12,
    },
  "hourly": {
    "summary": "Partly cloudy throughout the day and breezy this evening.",
    "icon": "wind",
    "data": [
      {
      "time": 1555016400,
      "summary": "Overcast",
      "icon": "cloudy",
      "precipIntensity": 0,
      "precipProbability": 0,
      "temperature": 54.9,
      "humidity": 0.65,
      "pressure": 1020.8,
      "windSpeed": 11.3,
      "windGust": 22.64,
      "windBearing": 293,
      "cloudCover": 1,
      "visibility": 9.02,
      },
    ]
  },
  "daily": {
    "summary": "No precipitation throughout the week, with high temperatures bottoming out at 58°F on Monday.",
    "icon": "clear-day",
    "data": [
      {
        "time": 1554966000,
        "summary": "Partly cloudy throughout the day and breezy in the evening.",
        "icon": "wind",
        "sunriseTime": 1554990063,
        "sunsetTime": 1555036947,
        "precipIntensity": 0.0001,
        "precipIntensityMax": 0.0011,
        "precipIntensityMaxTime": 1555045200,
        "precipProbability": 0.11,
        "precipType": "rain",
        "temperatureHigh": 57.07,
        "temperatureLow": 51.47,
        "humidity": 0.66,
        "pressure": 1020.5,
        "windSpeed": 10.94,
        "windGust": 33.93,
        "cloudCover": 0.38,
        "visibility": 9.51,
        "temperatureMin": 53.49,
        "temperatureMax": 58.44,
      },
    ]
  }
}

Check the following:

  • Happy path testing is implemented
  • Story is tested in postman
  • Sad path is tested in postman
  • Finished story is deployed to Heroku
  • Finished story is tested on Heroku

User can create an account

As a user, when I send a post request to '/api/v1/users'
With an email, password, and password confirmation in the body of the request,
And the password and confirmation match,
I should receive a response status code of '201'
And I should receive an API key in the response body

If the password and confirmation do not match, or if I am missing information
I receive error messages to let me know something went wrong

Example Request:

POST /api/v1/users
Content-Type: application/json
Accept: application/json

{
  "email": "[email protected]",
  "password": "password"
  "password_confirmation": "password"
}

Example Response:

status: 201
body:

{
  "api_key": "jgn983hy48thw9begh98h4539h4",
}

Check the following:

  • Happy path testing is implemented
  • Story is tested in postman
  • Sad path is tested in postman
  • Finished story is deployed to Heroku
  • Finished story is tested on Heroku

User can favorite a location

As a user, if I send a post request to "/api/v1/favorites"
With a location and valid API key in the body of the request
Then I see a response with a status of "200"
And in the body of the response I see:
"message": "Denver, CO has been added to your favorites"

If I do not send in a valid API key, I receive a response with a status of "401"

Example Request:

POST /api/v1/favorites
Content-Type: application/json
Accept: application/json

body:

{
  "location": "Denver, CO",
  "api_key": "jgn983hy48thw9begh98h4539h4"
}

Example Response:

status: 200
body:

{
  "message": "Denver, CO has been added to your favorites",
}

Check the following:

  • Happy path testing is implemented
  • Story is tested in postman
  • Sad path is tested in postman
  • Finished story is deployed to Heroku
  • Finished story is tested on Heroku

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.