Awesome Bucketlist API
A Bucketlist is a list of items, activities or goals you want to achieve before you "kick the bucket" this is an API to allow you create a new user account, login into your account, create, update, view or delete bucketlists and bucketlist items.
- API Documentation - http://docs.awesomebucketlist.apiary.io/
- Heroku Instance - https://awesome-bucketlist.herokuapp.com/api/v1/
- Bucketlist Frontend - http://awesomebucketlist.herokuapp.com/
Installation and Set Up
Clone the repo from GitHub:
git clone https://github.com/brayoh/bucket-list-api
Fetch from the develop branch:
git fetch origin develop
Navigate to the root folder:
cd bucketlist-api
Install the required packages:
pip install -r requirements.txt
Initialize, migrate, and upgrade the database:
python manage.py db init
python manage.py db migrate
python manage.py db upgrade
Create .env file for your environmental variables
touch .env
open .env in your editor and add the following variables
export FLASK_APP=run.py
export ENV=development
export DATABASE_URI="your_database_url"
export TEST_DATABASE_URI="database_url_for_testing"
export SECRET="generate a random string"
export TOKEN_SECRET="generate a random string"
Launching the Program
Run python run.py
. You may use Postman for Google Chrome to test the API.
API Endpoints
Resource URL | Methods | Description | Requires Token |
---|---|---|---|
/api/v1/auth/register/ |
POST | User registration | FALSE |
/api/v1/auth/login/ |
POST | User login | FALSE |
/api/v1/bucketlists/ |
GET, POST | A user's bucket lists | TRUE |
/api/v1/bucketlists/<id>/ |
GET, PUT, DELETE | A single bucket list | TRUE |
/api/v1/bucketlists/<id>/items/ |
GET, POST | Items in a bucket list | TRUE |
/api/v1/bucketlists/<id>/items/<item_id>/ |
GET, PUT, DELETE | A single bucket list item | TRUE |
Method | Description |
---|---|
GET | Retrieves a resource(s) |
POST | Creates a new resource |
PUT | Updates an existing resource |
DELETE | Deletes an existing resource |
Sample Requests
register a new user
login user
create a bucket list
get all bucket list
create a bucket list item
get all bucket list items
get single bucket list item
Testing
To run tests locally, run the following command: nosetests