Code Monkey home page Code Monkey logo

sweater_weather's Introduction

Sweater Weather

Project Description

I am a back-end developer working on a team that is building an application to plan road trips. This app allows users to see the current weather as well as the forecasted weather at the destination.

The team is working in a service-oriented architecture. The front-end will communicate with the back-end through an API. This project exposes the API that satisfies the front-end team’s requirements.

sweater_weather's People

Contributors

antoniojacksonii avatar

Watchers

James Cloos avatar  avatar  avatar

sweater_weather's Issues

Registration

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

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

Response:

status: 201
body:

{
"data": {
"type": "users",
"id": "1",
"attributes": {
"email": "[email protected]",
"api_key": "jgn983hy48thw9begh98h4539h4"
}
}
}

Requirements:
A successful request creates a user and generates a unique api key associated with that user.
An unsuccessful request returns a 400 level status code and body with a description of why the request wasn’t successful. Potential reasons a request would fail: passwords don’t match, email has already been taken, missing a field, etc.

Retrieve Weather for a City

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

Response:
Use the wireframes to see what data is required on the front-end to decide what data should be included in your response. Use the Fast JSON API and the response should adhere to the JSON 1.0 spec.

Requirements:
Needs to pull out the city and state from the GET request and send it to MapQuest’s Geocoding API to retrieve the lat and long for the city (this can be its own story). Use of the MapQuest’s Geocoding API is a hard requirement.
Retrieve forecast data from the OpenWeather One Call API using the lat and long

Road Trip

Request:
POST /api/v1/road_trip
Content-Type: application/json
Accept: application/json
body:
{
"origin": "Denver,CO",
"destination": "Pueblo,CO",
"api_key": "jgn983hy48thw9begh98h4539h4"
}

Response:
Use the wireframes to see what data is required on the front-end to decide what you would like to include in your response.

Requirements:
API key must be sent
If no API key or an incorrect key is provided return 401 (Unauthorized)
You will use MapQuest’s Directions API: https://developer.mapquest.com/documentation/directions-api/
The structure of the response should be JSON API 1.0 Compliant.

Login

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

Response:
status: 200
body:
{
"data": {
"type": "users",
"id": "1",
"attributes": {
"email": "[email protected]",
"api_key": "jgn983hy48thw9begh98h4539h4"
}
}
}

Requirements:
A successful request returns the user’s api key.
An unsuccessful request returns a 400 level status code and body with a description of why the request wasn’t successful. Potential reasons a request would fail: credentials are bad.

Background Image for a City

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

Response:
This will return the url to an appropriate background image for a location.

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.