Skip to content

mcka1n/labadee-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Events API

Labadee - Events API takes its name from a port/beach located on the northern coast of Haiti.

I started this small project while I was visiting this beautiful beach in Haiti, I got inspired by the warm blue waters, the hundreds of events and tours near the beach and of course by the friendly people from the flea markets.

API Resources

Current version: v1

Users

Events

Attendees

Installation

Notes

Make sure you have MongoDB installed and running on your computer (or server).

  1. Clone the repo.

    git clone https://github.com/mcka1n/labadee-api.git
    
  2. bundle install.

  3. run rake db:seed in order to 'install' the default values for users and clients.

  4. rake db:mongoid:create_indexes

  5. rails s

Getting started with the API

Authentication

I'm using a simple way to authenticate Clients (other apps or scripts) and Users.

Client Authentication (key)

For testing and debugging purposes you can run the seeds to create a default client, this will give you a client key which is required in every call to the API.

As a developer you have to send this client key as a get param on every request you make, no exceptions.

User Authentication (token)

Each and every user will have a token field, this token contains a value used for authentication. Every time you sign in with email & password, the token will be refreshed and a new one will be returned.

As a developer you have to send as query params both client key and user's token on each request, except:

  • Sign in
  • Sign up

Authentication Examples

 POST http://localhost:3000/v1/users/sign_in?key=Bnb@fUCodG_j-ywdnty

Params:

  {
    "user": {
      "email": "[email protected]",
      "password": "1234%678P"
    }
  }

Response:

Status: 200 OK

{
  "success": true,
  "auth_token": "W00tszBmuqdw4tsPY_rY",
  "email": "[email protected]"
}

About

Labadee REST API for events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published