Giter Site home page Giter Site logo

tw_api's Introduction

Therewhere API

Setup

  1. Develop on Mac OSX Yosemite or later
  2. Use ruby 2.2.0
  3. Use http://postgresapp.com/ for Postgres. It includes Postgis, which we need.
  4. Don't forget to create Postgis extension in your database:
$ psql <database_name>
CREATE EXTENSION Postgis;

Tests

Run tests automatically with:

bundle exec guard

Leave it open. It will run on changes.

Location Gems

We use RGeo with the AR Postgis adapter.

API Design guide

Try to make things easy.

Remember to only return useful error messages if authorised. Otherwise you're creating security issues.

Test all code. It's a pain in the ass to have untested code around. Ruby is too easy to not write untested code.

API

Prepend everything with /api/v1

Current User

post /location/:x:y:z:m

Set location x, y, z (optional), m (optional) of current user.

Pre-auth implementation: add param id to specify user.

get /location

Get last stored location of current user.

Pre-auth implementation: add param id to specify user.

get /friends

Get friends of current user.

post /friends

Adds one or more friends by phone_nrs in an array.

Params:

  • phone_nrs (Array with Strings)

For example:

post /api/v1/users/1/friends?phone_nrs=['12345']

Users

get /users/:id

Returns user with :id.

get /users

Returns all users.

post /users

Creates a user.

Params:

  • first_name
  • last_name
  • email

put /users/:id

Update a user.

delete /users/:id

Delete a user.

Meetups

get /users/:id/meetups

Returns all pending meetups.

post /users/:id/meetups/:friend_id

Request a meetup if none is outstanding.

Accept a meetup if one is outstanding.

tw_api's People

Contributors

jobv avatar mlebrefv avatar marcelolebre avatar

Watchers

James Cloos avatar  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.