ShoppingListApi
An api to make shopping quick, easy and fun by organizing and keeping track of your lists
The api can be accessed here and the documentation here
- Python 3.5
- Flask
- Postgres
sudo su - postgres
psql
CREATE USER test_user with password 'secret';
CREATE DATABASE shoppinglist owner test_user encoding 'utf-8';
CREATE DATABASE shoppinglist_test owner test_user encoding 'utf-8';
Clone this repo, switch in the repo and create an environment
git clone https://github.com/JeanAbayo/ShoppingListApi.git
cd ShoppingListApi
virtualenv venv
Create a .env file and export it like source .env
source venv/bin/activate
export FLASK_APP="run.py"
export SECRET="Your choosen secret key"
export APP_SETTINGS="development"
export DATABASE_URL="postgresql://db_username:db_password@localhost/db_name"
Install used packages
pip install -r requirements.txt
Initialize, migrate and update the database:
python manage.py db init
python manage.py db migrate
python manage.py db upgrade
python manage.py test
with coverage
coverage run --source=app -m py.test && coverage report
flask run
Resource URL | Methods | Description | Requires Token |
---|---|---|---|
/auth/register | POST | User Registration | FALSE |
/auth/login | POST | User Sign in | FALSE |
/shoppinglists | POST | User create a shoppinglist | TRUE |
/shoppinglists | GET | User can view all shoppinglists | TRUE |
/shoppinglist/<list_id> | GET | User view a single shoppinglist | TRUE |
/shoppinglist/<list_id> | PUT | User Edit a single shoppinglist | TRUE |
/shoppinglist/<list_id> | DELETE | User Delete a single shoppinglist | TRUE |
/shoppinglist/<list_id>/items | POST | User create item in shoppinglist | TRUE |
/shoppinglist/<list_id>/items | GET | User list items in a shoppinglist | TRUE |
/shoppinglist/<list_id>/item/<item_id> | GET | User view an item in a shoppinglist | TRUE |
/shoppinglist/<list_id>/item/<item_id> | PUT | User Edit an item in a shoppinglist | TRUE |
/shoppinglist/<list_id>/item/<item_id> | DELETE | User delete an item in a shoppinglist | TRUE |
This project is licensed under the MIT License - see the LICENSE.md file for details