BucketList API is a simple application built using the flask microframework. It's an application that helps users track what they want to do in the future. It is an API that can be consumed by other applications.
User Registration/Login.
User create a bucketlist.
User can delete/ edit an existing bucketlist.
User can add items to an existing bucketlist.
User can delete/ edit items of a bucketlist
-
Create a folder.
-
Clone the repository into the given folder.
https://github.com/andela-amutava/Bucketlist.git
-
Navigate to the project folder.
Bucketlist
-
Install project dependencies in your virtual environment.
pip install -r requirements.txt
5.Set up project development. Run db migrations.
python manage.py db init python manage.py db migrate python manage.py db upgrade
6. Run the server.
python manage.py runserver
- Intergrate your google chrome browser with post-man plugin.
- Run your api url on postman.
- Choose the appropriate method.
- POST - For creating a resource.
- GET - To obtain resources from the server.
- PUT - Editing an existing resource.
- DELETE - Deleting an existing resource.
- Pass the required data for the particular methods for appropriate responses.
To achieve secure endpoints on login a user is issued with a token that expires in 10minutes. This token is used during reaching the bucketlist and bucketlists' items endpoints. This is an authorization security mechanism.
URL Endpoint | HTTP Methods | Summary |
---|---|---|
/auth/register |
POST |
Register a new user |
/auth/login |
POST |
Login and retrieve token |
/api/bucketlists |
POST |
Create a new Bucketlist |
/api/bucketlists |
GET |
Retrieve all bucketlists for user |
/api/bucketlists/?limit=2&page=1 |
GET |
Retrieve one bucketlist per page |
/api/bucketlists/<id> |
GET |
Retrieve bucketlist details |
/api/bucketlists/<id> |
PUT |
Update bucket list details |
/api/bucketlists/<id> |
DELETE |
Delete a bucket list |
/api/bucketlistitems/<id>/items |
POST |
Create items in a bucket list |
/api/bucketlistitems/<id>/items/<item_id> |
DELETE |
Delete a item in a bucket list |
/api/bucketlistitems/<id>/items/<item_id> |
PUT |
update a bucket list item details |
You can run the tests nosetests --with-coverage