henrikwallstrom / teamwall

An open source software used to build a wall of picture for your team

Home Page:http://teamwall.github.io/teamwall/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#teamwall

Travis status

An open source software used to build a wall of picture for your team

Contents

Prerequisites

You will need Leiningen 2.0.0 or above installed.

You will also need Mongo database running.

Running

To start a web server for the application, run:

lein run

The web server should be reachable at localhost:3000.

API

Login

First step is to login to retrieve an API token which will be used for every other request.

Path & Verb

To login, a GET request needs to be done against the path:

/login

Parameters

Params Type Description
email url param the email address used to register
password url param the password used to register

cURL example:

$ curl "localhost:3000/login?email=email&password=password"

Response

A JSON string representing a literal object with three keys:

  • token: a string representing the unique API token
  • user: a map representing the current user
  • ttl: the token time-to-live

Example:

{
	"token" : "JSzvjh_Qq0zGjLu7pL-9tvGrl84DwgMNT4vZ_F4IxC",
	"ttl"   : "3600000"
}

Note: ttl is in milliseconds, 3600000 is one hour.

Status

Cause Status
Success 200 OK
Error 403 Forbidden

Get current user

The route is used to provide information about the current logged user. It is mainly used when you log in back using the cookie stored token.

Path & Verb

To get all the team members, a GET request needs to be done against the path:

/current-user

Parameters

Params Type Description
token url param the API token received during the login

cURL example:

$ curl "localhost:3000/current-user?token=JSzvjh_Qq0zGjLu7pL-9tvGrl84DwgMNT4vZ_F4IxC"

Response

A JSON string representing a literal object. This object has two keys:

  • username
  • email

Example:

{
  "username" : "User 1",
  "email" : "user1@mycompany.com"
}

Status

Cause Status
Success 200 OK
Field token missing or invalid 403 Forbidden

Get team members

The route is used to provided information about the members of the team the logged user belongs to. The team is bound by a shared email domain.

Path & Verb

To get all the team members, a GET request needs to be done against the path:

/team-members

Parameters

Params Type Description
token url param the API token received during the login

cURL example:

$ curl "localhost:3000/team-members?token=JSzvjh_Qq0zGjLu7pL-9tvGrl84DwgMNT4vZ_F4IxC"

Response

A JSON string representing an array of literal objects. Each object has two keys:

  • username
  • email

Example:

[ {
  "username" : "User 1",
  "email" : "user1@mycompany.com"
}, {
  "username" : "User 2",
  "email" : "user2@mycompany.com"
} ]

Status

Cause Status
Success 200 OK
Field token missing or invalid 403 Forbidden

Upload a new photo

Route used to upload a new photo for the user linked to the provided token.

Path & Verb

To upload a new photo, a POST request needs to be done against the path:

/new-photo

Parameters

Params Type Description
token url param the API token received during the login
photo multipart/form-data the new photo to upload

cURL example:

$ curl --form photo=@photo.png "localhost:3000/new-photo?token=JSzvjh_Qq0zGjLu7pL-9tvGrl84DwgMNT4vZ_F4IxC"

Response

No response.

Status

Cause Status
Success 200 OK
Field token missing or invalid 403 Forbidden
Field photo missing 400 Bad Request

Get last photo of a user

This route is used to get the last photo of a giver user.

Path & Verb

To get the latest photo, a GET request needs to be done against the path:

/<email>/last-photo

Parameters

Params Type Description
email url segment the email address of one of your team member
token url param the API token received during the login

cURL example:

$ curl "http://localhost:3000/user1@mycompany.com/last-photo?token=JSzvjh_Qq0zGjLu7pL-9tvGrl84DwgMNT4vZ_F4IxC"

Response

Return an image. The url is made so it can be used as html image source.

Status

Cause Status
Success 200 OK
Email address not in the same team 400 Bad Request
Field token missing or invalid 403 Forbidden
No photo available 404 Not Found

License

Copyright © 2014 Benjamin Van Ryseghem <benjamin [dot] vanryseghem [at] gmail [dot] com>

About

An open source software used to build a wall of picture for your team

http://teamwall.github.io/teamwall/

License:GNU General Public License v3.0


Languages

Language:Clojure 89.6%Language:Ruby 7.7%Language:CSS 0.9%Language:Shell 0.9%Language:JavaScript 0.9%