Code Monkey home page Code Monkey logo

geo_tasks's Introduction

Geo Tasks

Geo based tasks tracker

Build a sinatra API to work with geo-based tasks. Use ruby 2.3 and mongoDB (recommended). All API endpoints should work with json body (not form-data). The result should be available as github repo with commit history and the code covered by specs. Please commit the significant step to git, we want to see how you evolved the code.

Each request will be authorized by token. You can use pre-defined tokens stored on backend side. Operate with tokens for two types of users:

  1. Manager
  2. Driver

Create tokens for more drivers and managers, not just 1-1.

Each task can be in 3 states

  1. New (when the task is created)
  2. Assigned (when a driver picks the task)
  3. Done (when the driver marked the task as completed)

Access

  • Manager can create tasks with two geo locations pickup and delivery
  • Driver can get list of tasks nearby (sorted by distance) by sending his current location
  • Driver can change status of task (to assigned/done).
  • Drivers can't create/delete tasks.
  • Managers can't change task status.

Workflow:

  1. Manager create task with location [lat1, long1]
  2. Driver gets the list of the nearest tasks by submitting current location [lat2, long2]
  3. Driver picks one task from the list (the task becomes assigned)
  4. Driver finishes the task (becomes done)

Bonus: (not required)

Create statistics report:

  1. Amount of tasks processed by driver
  2. Total distance by all tasks

Run

Fill database: rake db:seed

Start server: bundle exec rerun --background -- thin start --port=4567 -R config.ru

Console: bundle exec irb -r ./app.rb

geo_tasks's People

Contributors

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