GithubHelp home page GithubHelp logo

fullstack-challenge's Introduction

Full Stack - Coding Challenge

The Tezla Motors is car company has a confusing API. It returns badly structured JSON which isn't always consistent. AygaCar needs to adapt the API into a cleaner format. Instructions

There are two API specifications provided below, the Tezla API and the AygaCar API Spec. Your task is to implement the AygaCar spec by making HTTPs requests to the Tezla API.

Your tasks are as follows:

  • Implement the AygaCar API and AygaCar Dashboard (Bonus) specification using any frameworks or libraries as necessary;
    • API: We'd like you to show your knowledge or superpowers with modern backend frameworks, eg: (ExpressJS) NodeJS, (Rails) Ruby or others.
    • Dashboard: You are free to show your superpowers - (Bonus).
  • Write your code to be well structured and documented;
  • Provide tests for implementation - (Bonus).
  • Please, send a Pull Request (PR) with your proposal.

The flow looks like this:

Client (Dashboard) --> AygaCar API --> Tezla API

The Tezla API server is running at https://my-json-server.typicode.com/kalicki/ayga-fullstack-internship. The documentation below provides more details on the exact request/responses. Here is an example:

$ curl https://my-json-server.typicode.com/kalicki/ayga-fullstack-internship/getVehicleInfo/1357
       -X GET
       -H 'Content-Type: application/json'

Tezla API

Available IDs: 1357, 2468, 3579

Vehicle Info

Request:

GET /getVehicleInfo/1357
Content-Type: application/json

Response:

{
  "id": "1357",
  "service": "getVehicleInfo",
  "status": "200",
  "data": {
    "color": {
      "type": "String",
      "value": "Metallic Silver"
    },
    "fourDoorSedan": {
      "type": "Boolean",
      "value": "True"
    },
    "twoDoorCoupe": {
      "type": "Boolean",
      "value": "False"
    },
    "driveTrain": {
      "type": "String",
      "value": "v8"
    }
  }
}

Security

Request:

GET /getSecurityStatus/1357
Content-Type: application/json

Response:

{
  "id": "1357",
  "service": "getSecurityStatus",
  "status": "200",
  "data": {
    "doors": {
      "type": "Array",
      "values": [
        {
          "location": {
            "type": "String",
            "value": "frontLeft"
          },
          "locked": {
            "type": "Boolean",
            "value": "False"
          }
        },
        {
          "location": {
            "type": "String",
            "value": "frontRight"
          },
          "locked": {
            "type": "Boolean",
            "value": "True"
          }
        }
      ]
    }
  }
}

Status

Request:

GET /getEnergyStatus/1357
Content-Type: application/json

Response:

{
  "id": "1357",
  "service": "getEnergyStatus",
  "status": "200",
  "data": {
    "tankLevel": {
      "type": "Number",
      "value": "30"
    },
    "batteryLevel": {
      "type": "Number",
      "value": "99"
    }
  }
}

Location

Request:

GET /getLocationStatus/1357
Content-Type: application/json

Response:

{
  "id": "1357",
  "service": "getLocationStatus",
  "status": "200",
  "data": {
     "location": {
      "type": "Array",
      "values": [
        {
          "latitude": {
            "type": "String",
            "value": "-71.056416"
          }
        },
        {
          "longitude": {
            "type": "String",
            "value": "42.351018"
          }
        }
      ]
    }
  }
}

AygaCar API

Request Endpoint Description
GET vehicles/:id You should describe here
GET vehicles/:id/doors You should describe here
GET vehicles/:id/battery You should describe here
GET vehicles/:id/fuel You should describe here
GET vehicles/:id/location You should describe here

Example

# vehicles/:id 
{
  "vin": "1357",
  "color": "Metallic Silver",
  "doorCount": 4,
  "driveTrain": "v8"
}
# vehicles/:id/doors
[
  {
    "location": "frontLeft",
    "locked": false
  },
  {
    "location": "frontRight",
    "locked": true
  },
  {
    "location": "backLeft",
    "locked": false
  },
  {
    "location": "backRight",
    "locked": false
  }
]
# vehicles/:id/battery
{
  "percent": 99
}
# vehicles/:id/fuel
{
  "percent": 50
}
# vehicles/:id/location
{
  "latitude":	"-43.9509",
  "longitude":	"-34.4618"
}

Documentation

>>> Describe here your ideas, documentation and anything extra

Installation

>>> Describe here how to run your code


Others: https://github.com/CollabCodeTech/backend-challenges

fullstack-challenge's People

Contributors

kalicki 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.