Skip to content

temi-adediran/BucketList_API

Repository files navigation

iBucket API


[![Build Status](https://travis-ci.org/andela-tfowotade/BucketList_API.svg?branch=ch-add-badges-127970379)](https://travis-ci.org/andela-tfowotade/BucketList_API) [![Code Climate](https://codeclimate.com/repos/57ad1938981044008300051a/badges/83670248b534ff9a87e6/gpa.svg)](https://codeclimate.com/repos/57ad1938981044008300051a/feed) [![Coverage Status](https://coveralls.io/repos/github/andela-tfowotade/BucketList_API/badge.svg?branch=develop)](https://coveralls.io/github/andela-tfowotade/BucketList_API?branch=develop)

Overview

iBucket is an API that lets you manage a bucket list. A bucket list is simply a number of experiences or achievements that a person hopes to have or accomplish during their lifetime.

Getting Started

Visit the iBucket API Documentation. It is clearly written and easy to understand and use.

External Dependencies

All the dependencies can be found in the Gemfile.

Available End Points

Below is the list of available endpoints in the BucketList API. Some end points are not available publicly and hence, can only be accessed when you sign up and log in.
End Point Functionality Public Access
GET /api/v2/ Welcome user TRUE
POST /api/v2/auth/create_user Create a new user TRUE
POST /api/v2/auth/login Logs a user in TRUE
DELETE /api/v2/auth/logout Logs a user out FALSE
GET /api/v2/bucketlists List all the created bucket lists FALSE
POST /api/v2/bucketlists Create a new bucket list FALSE
GET /bucketlists/:id Get single bucket list FALSE
PUT /bucketlists/:id Update this bucket list FALSE
DELETE /bucketlists/:id Delete this single bucket list FALSE
GET /bucketlists/:id/items Lists all items in the single bucket list. FALSE
POST /bucketlists/:id/items Creates a new item in the bucket list FALSE
PUT /bucketlists/:id/items/:item_id Updates a bucket list item FALSE
DELETE /bucketlists/:id/items/:item_id Deletes an item in a bucket list FALSE

JSON Data Model

A typical bucket list requested by a user would look like this:
  {
    id: 1,
    name: “New Year Goals”,
    items: [
           {
               id: 1,
               name: “I to do this before the end of this year”,
               done: false
             }
           ]
    created_by: “John”
}

Pagination

The BucketList API comes with pagination by default, so the number of results to display to users can be specified when listing the bucket lists, by supplying the page and limit in the request to the API.

Example

Request:
GET https://ibucket.herokuapp.com/api/v2/bucketlists?page=2&limit=20

Response:

20 bucket list records belonging to the logged in user starting from the 21st gets returned.

Searching by Name Users can search for a bucket list by using it's name as the search parameter when making a GET request to list the bucketlists.

Example

Request:

  GET https://ibucket.herokuapp.com/api/v2/bucketlists?q="bucket1"
 

Response:

Bucket lists that include name “bucket1” gets returned

Versions

iBucket API currently has only one version and can be accessed via this link - https://ibucket.herokuapp.com/api/v2/

Running Test

The Bucket List API uses `rspec` for testing. Continuous Integration is carried out via Travis CI.

To test locally, go through the following steps.

  1. Clone the repo to your local machine.
$  git clone [email protected]:andela-tfowotade/BucketList_API.git
  1. cd into the BucketList_API folder.
$  cd BucketList_API
  1. Install dependencies
  $  bundle install
  1. Set up and migrate the database.
$ rake db:setup && rake db:migrate
  1. Run the tests.
$  bundle exec rspec

Limitations

The API might not be able to handle large requests but this will be reviewed as users increase.

About

A Rails API for a bucket list service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published