[![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)
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.
Visit the iBucket API Documentation. It is clearly written and easy to understand and use.
All the dependencies can be found in the Gemfile.
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 |
{ 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” }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.
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.
Request:
GET https://ibucket.herokuapp.com/api/v2/bucketlists?q="bucket1"
Response:
Bucket lists that include name “bucket1” gets returnediBucket API currently has only one version and can be accessed via this link - https://ibucket.herokuapp.com/api/v2/ The Bucket List API uses `rspec` for testing. Continuous Integration is carried out via Travis CI.
To test locally, go through the following steps.
- Clone the repo to your local machine.
$ git clone [email protected]:andela-tfowotade/BucketList_API.git
cd
into theBucketList_API
folder.
$ cd BucketList_API
- Install dependencies
$ bundle install
- Set up and migrate the database.
$ rake db:setup && rake db:migrate
- Run the tests.
$ bundle exec rspec