Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added starter design doc

  • Loading branch information...
commit 0ee9d2980efa4d7afdd9eaa83d97262557bdc037 1 parent 7a4b294
Yuvi Panda yuvipanda authored

Showing 1 changed file with 50 additions and 0 deletions. Show diff stats Hide diff stats

  1. +50 0 design.txt
50 design.txt
... ... @@ -0,0 +1,50 @@
  1 +# wtfimb Reboot
  2 +
  3 +## Introduction
  4 +
  5 +This is busroutes.in done right, but not so right that it'll never ship. It is designed with the following goals in mind:
  6 +
  7 +1. Make it easy for anyone to start an instance for their own city.
  8 +2. Make the entire data *user editable*, so that minor edits are absolutely painless.
  9 +3. Have an API + several clients (web/mobile/sms), so that work does not get repeated
  10 +4. Make it easy to keep data in sync with official sources, in cases where official sources are actually provided
  11 +
  12 +We've picked **GTFS** to be the standard data import/export format, and **GeoJSON** to be the API transport format.
  13 +
  14 +## API
  15 +
  16 +The API provides read/write access to the data, along with routing information. People need to be logged in to make write calls to the API. The API design should be as minimal as possible, and hide all implementation details.
  17 +
  18 +POST login
  19 + In: Username/Password.
  20 + Out: An access token (valid for a day or so?) on success. Should be included with all future requests
  21 + Alternative: Cookie based logins too!
  22 +POST logout
  23 + In: An access token
  24 + Logs out the user by invalidating the access token
  25 +GET stop?id=$id
  26 + In: Stop ID
  27 + Out: Returns a FeatureList containing a single point that is the stop of this particular id
  28 +GET stop?name=$name
  29 + In: Stop Name
  30 + Out: Returns a FeatureList containing possibly multiple points that have a name that matches the inbuilt name
  31 +POST stop?id=$id
  32 + In: A Point GeoJSON that should be used to populate given ID
  33 + Out: Id of stop updated
  34 + Leave Id empty to create
  35 +GET route?id=$id
  36 + In: Route ID
  37 + Out: Returns a FeatureList containing a single point that is the stop of this particular id
  38 +GET stop?name=$name
  39 + In: Stop Name
  40 + Out: Returns a FeatureList containing possibly multiple points that have a name that matches the inbuilt name
  41 +POST stop?id=$id
  42 + In: A Point GeoJSON that should be used to populate given ID
  43 + Out: Id of stop updated
  44 + Leave Id empty to create
  45 +GET/POST route?id=$id&name=$name
  46 + FeatureList of Points that are part of the given Route (identified by id or name)
  47 +GET path?from=$from_id&$to=$to_id
  48 + FeatureList of GeometryCollections that are changeoverpoints
  49 +GET stopsnear?lat=$lat&lon=$lon&distance=$dist&type=$type
  50 + FeatureList of Points that represent stops near the given location

0 comments on commit 0ee9d29

Arunmozhi

This should be done the Oauth way. Why should the access token be "valid for a day or so?" Let there be a acess key and secret available with the client app always

Yuvi Panda

Point taken. Do you want to write up that part?

Arunmozhi

Sure! On a quick thought, can we make this OpenID? Good idea or otherwise?

Yuvi Panda
Arunmozhi

Ya you are right, I was thinking bout something and posted this :P Anyways, I will do that OAuth part. Deal done

Please sign in to comment.
Something went wrong with that request. Please try again.