Giter Club home page Giter Club logo

fuber's Introduction

fuber

fuber is an online call taxi service

Requirements

  • ruby - 2.4.1
  • rails - 5.1
  • postgres

Setting up

  • Clone the Repo

     git clone [email protected]:tessie/fuber.git
     cd fuber
    
  • Install the gems

     bundle
    
  • Copy database.yml.example to database.yml.

    cp config/database.yml.example config/database.yml
    
  • Create and migrate the database.

    rake db:create
    rake db:migrate
    
  • Seed the database

    rake db:seed
    
  • Runnning local

    rails s
    

Test

    rails test

API Doc

GET /cabs

Response:

     {
       "status":"success",
       "cabs":[
          {
             "id":4,
             "registration_number":"KL452304",
             "status":"available",
             "color":null,
             "modelname":null,
             "lat":10.057906,
             "long":76.346362,
             "created_at":"2017-08-20T18:15:01.811Z",
             "updated_at":"2017-08-20T18:15:01.811Z"
          },
          {
             "id":3,
             "registration_number":"KL451334",
             "status":"available",
             "color":null,
             "modelname":null,
             "lat":9.99848,
             "long":9.99848,
             "created_at":"2017-08-20T18:15:01.804Z",
             "updated_at":"2017-08-20T18:15:01.804Z"
          },
          {
             "id":1,
             "registration_number":"KL452134",
             "status":"available",
             "color":null,
             "modelname":null,
             "lat":9.99709,
             "long":76.302815,
             "created_at":"2017-08-20T18:15:01.785Z",
             "updated_at":"2017-08-20T18:15:01.785Z"
          }
       ]
    }

POST /cabs/book-nearest

Request

   {
      "lat" : 1,
      "long" : 1
      "customer_id" : 1
      "color" : "pink"
   }

Response

    {
       "status":"success",
       "cab":{
          "lat":9.99709,
          "status":"booked",
          "id":1,
          "registration_number":"KL452134",
          "color":"pink,
          "modelname":null,
          "long":76.302815,
          "created_at":"2017-08-20T18:15:01.785Z",
          "updated_at":"2017-08-20T18:30:50.209Z"
       },
       "trip_id": 5,
       "message":"Booking Success"
    }

Response Failure:

 {
   "status":"failure",
   "message":"Sorry no cabs are available"
}

POST /trips/1/start

Request

    {
      "lat":1,
      "long": 1
    }

Response Success

  {
     "status":"success",
     "message":"Ride Started"
  }

Failure(when attempting to start a trip ie to yet scheduled)

 {
   "status":"failure",
   "message":"Sorry.trip could not be started"
}

POST /trips/1/end

Request (same as start trip)

Response Success

{
   "status":"success",
   "message":"Ride End",
   "amount":"4.87 Dogecoin"
}

Response Failure

{
   "status":"failure",
   "message":"Sorry.Could mot end trip"
}

fuber's People

Contributors

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