The innovative bucketlist app is an application that allows users to record and share things they want to achieve or experience before reaching a certain age meeting the needs of keeping track of their dreams and goals. This is the backend API for enabling users to perform crud operations on bucketlists and items with user persistence.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Just clone this repository by typing:
https://github.com/Lemmah/BucketList-API.git
- Switch to project directory:
cd BucketList-API
- Install project requirements using python pip. But wait, you have to have some stuff before you get to this point. So these are:
- Python3.5 and above
- Python virtual environment Just type:
python -V
in your terminal and if its not greater than or equal to 3.5, you're not in big trouble, there are tons of tutorials to get up up and running with these. Just grub one then come back when done.
Now, you have python3 and a way of running a virtual environment. Lets set up the project environment.(remember we're still in the app directory)
- Create your virtual environment. Usually, without any wrappers:
python -m venv my_venv
- Start your virtual environment:
source my_venv/bin/activate
- Install the project requirements specified in the requirements.txt file. Usually,
pip install -r requirements.txt
- Do Migrations. This application uses postgresql. If you don't have psql you may install it here.
Create a
flask_api
database to be used by the application while running on your localhost. Then, you can do migrations as:
python manage.py db init
python manage.py db migrate
python manage.py db upgrade
This is enough to get you started. You can now run the application using:
python runapi.py
Easy, just:
pytest tests/
You can use postman or even curl to reach out to the following api endpoints:
URL Endpoint | HTTP Request | Resource Accessed | Access Type |
---|---|---|---|
/api/bucketlists/auth/register | POST | Register a new user | publc |
/api/bucketlists/auth/login | POST | Login and retrieve token | public |
/api/bucketlists/auth/logout | POST | Logout and thus deactivate token | public |
/api/bucketlists/auth/reset-password | PUT | Reset your password when logged in | private |
/api/bucketlists | POST | Create a new Bucketlist | private |
/api/bucketlists | GET | Retrieve all bucketlists for user | private |
/api/bucketlists/<buckelist_id> | GET | Retrieve a bucketlist by ID | private |
/api/bucketlists/<bucketlist_id> | PUT | Update a bucketlist | private |
/api/bucketlists/<bucketlist_id> | DELETE | Delete a bucketlist | private |
/api/bucketlists/<bucketlist_id>/items/ | GET | Retrive items in a given bucket list | private |
/api/bucketlists/<bucketlist_id>/items/ | POST | Create items in a bucketlist | private |
/api/bucketlists/<bucketlist_id>/items/<item_id> | DELETE | Delete an item in a bucketlist | prvate |
/api/bucketlists/<bucketlist_id>/items/<item_id> | PUT | update a bucketlist item details | private |
This app is ready for Heroku. You can deploy your copy of this app by:
heroku create <your_url_name>
(where <your_url_name> is what you want to call your app)
git push heroku master
..and boom, you're done! You can chat me on gitter in case of any problems.(gitter link is on badge above)
If you have never worked with Heroku, you can learn how to Deploy Python Applications on Heroku
- Python Flask - The web framework used for this API
You can create your pull request. :D
For the versions available, see the tags on this repository.
- James Lemayian - Kickstarting the project - @Lemmah
This project is currently under the Creative Commons attribution.
- Andela Kenya - Inspiring the idea.