Giter VIP home page Giter VIP logo

marsrover's Introduction

Mars Rover (Case Study) Restful API

This project has builded with PHP Laravel 8 Framework.

Requirements

Docker
docker-compose
git

Installation

git clone https://github.com/krmckr61/marsRover.git

To build docker containers

./vendor/bin/sail up -d

Requests

base url : http://localhost/api/v1/

Request Endpoint Method Body Return
Create Plateue plateau POST
{
    "x": coordinate
    "y": coordinate
}
Plateau
Get Plateaus plateau GET PlateauCollection
Get Plateau From Id plateau/{plateauId} GET Plateau
Create Rover rover POST
{
    "plateau_id": plateau_id,
    "x": coordinate,
    "y": coordinate,
    "d": direction
}
Rover
Get Rovers rover GET RoverCollection
Get Rover From Id rover/{roverId} GET Rover
Send Commands To Rovers rover/{roverId} POST
{
    "commands": commandlist
}
RoverCollection

Parameters

Parameter Type Accepted Values Example
coordinate decimal (-1000, 1000) -950.45654
direction char in ('W', 'N', 'E', 'S') S
command char in ('L', 'R', 'M') M
commandList string in ('L', 'R', 'M') LMRLMRLMRLRLMRLMRLMRMLRMMMMMM

Partial View Examples

Plateau

{
    "x": 100,
    "y": 999,
    "updated_at": "2021-09-11T10:28:15.000000Z",
    "created_at": "2021-09-11T10:28:15.000000Z",
    "id": 13
}

Rover

{
    "plateau_id": 2,
    "x": 124.67987,
    "y": -50.67987,
    "d": "N",
    "updated_at": "2021-09-11T10:28:35.000000Z",
    "created_at": "2021-09-11T10:28:35.000000Z",
    "id": 15
}

To run tests

./vendor/bin/sail artisan test


Kerem Çakır
Software Engineer
[email protected]
https://www.linkedin.com/in/krmckr/

marsrover's People

Contributors

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