This is an API for a bucket list designed using flask framework for python
https://m2bucketlistapi.herokuapp.com/api/v1/
You should have git, python, pip, postgresql, virtualenv installed
- Open your terminal
- Clone the project using
git clone https://github.com/malmike/BucketlistAPI
- Run
createdb bucketlist_api_dev
andcreate test_db
- Change to the project directory using
cd BucketlistAPI
- Create a virtual environment for the project using the command
virtualenv .venv
and start it usingsource .venv/bin/activate
and using the commanddeactivate
to stop the virtual environment - Install packages using
pip install -r requirements.txt
- You can run tests using the command
nosetests tests --with-coverage --cover-erase --cover-package="myapp" --cover-package="instance" --cover-xml
- To launch the application you should first apply migrations in order to create the database whose process is shown below
- Run the application using
python manage.py runserver
- You can access the api documentation at
http://localhost:5000/api/v1
$ python manage.py db init $ python manage.py db migrate $ python manage.py db upgrade $ python manage.py db --help
EndPoint | Functionality | Public Access |
---|---|---|
POST /auth/login | Logs a user in | FALSE |
POST /auth/register | Register a user | FALSE |
POST /auth/logout | Logs a user out | TRUE |
POST /bucketlists/ | Create a new bucket list | TRUE |
GET /bucketlists/ | List all the created bucket lists | TRUE |
GET /bucketlists/<id> | Get single bucket list | TRUE |
PUT /bucketlists/<id> | Update this bucket list | TRUE |
DELETE /bucketlists/<id> | Delete this single bucket list | TRUE |
POST /bucketlists/<id>/items/ | Create a new item in bucket list | TRUE |
PUT /bucketlists/<id>/items/<item_id> | Update a bucket list item | TRUE |
DELETE /bucketlists/<id>/items/<item_id> | Delete an item in a bucket list | TRUE |
GET /bucketlists?limit=<number> | Gets a number of bucket lists relative to the value passed in number. Maximum records is 100 | TRUE |
GET /bucketlists?q=<bucketlist_name> | Search for bucket list with the same name as that passed in bucketlist_name | TRUE |