{"id":25403514,"url":"https://github.com/saopayne/grocery_store_api","last_synced_at":"2025-04-12T15:14:02.311Z","repository":{"id":39841471,"uuid":"157677146","full_name":"saopayne/grocery_store_api","owner":"saopayne","description":"This is an API repository of a grocery store.","archived":false,"fork":false,"pushed_at":"2022-12-08T00:47:06.000Z","size":203,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T15:13:59.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saopayne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-15T08:25:46.000Z","updated_at":"2018-11-19T19:55:22.000Z","dependencies_parsed_at":"2023-01-24T05:00:20.903Z","dependency_job_id":null,"html_url":"https://github.com/saopayne/grocery_store_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgrocery_store_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgrocery_store_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgrocery_store_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgrocery_store_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saopayne","download_url":"https://codeload.github.com/saopayne/grocery_store_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586241,"owners_count":21128998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-16T02:39:47.579Z","updated_at":"2025-04-12T15:14:02.282Z","avatar_url":"https://github.com/saopayne.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RideCo Grocery Project API\n\nThis is the RESTful API for the Grocery App, the app that allows you to make and edit grocery list. \n\n## Dependencies\n1. Flask version 0.12+\n2. Python version 3.6\n3. MySQL 5.7\n\n## How to run flask application\n1. Clone the repository to your computer\n2. Activate your virtualenv\n3. In your terminal, enter the directory Rideco_grocery_api\n4. run the following command to install the app package into your virtualenv (Don't forget the dot at the end)\n\n    ``` pip install -r requirements.txt ```\n\n5. To start the app, run the following commands in succession still in the same directory\n\n    ```export FLASK_APP=flask_app/run.py```\n\n    ```export FLASK_DEBUG=true ```\n\n    ```export DATABASE_URL=\"sqlite://\"```\n\n    ```export APP_SETTINGS=\"development\"```\n\n    ```export SECRET=\"the-development-key-secret-hide-very-far\"```\n\n    ```flask run ```\n\n    _On windows, use 'set' instead of 'export'_\n\n## How to test the flask appliaction\n1. Clone the repository to your computer\n2. Ensure you have the dependencies on your system\n3. Install Coverage.py in your virtualenv using your terminal\n\n\n    ``` pip install coverage```\n\n4. run command in the folder Grocery List API\n\n    ``` \n    sh -c 'python manage.py test --coverage \u0026\u0026 coverage report' \n    ```\n\n5. Observe the output in your terminal\n\n## API Documentation\n\n\nBase URL: https://guarded-brook-31463.herokuapp.com\n\n### Current endpoints\n\n1. **Register user**\n\n    Endpoint:\n    ```\n    /auth/register\n    ``` \n        \n    Example POST payload :\n    ```json\n    {\n        \"username\": \"any-you-want\",\n        \"name\": \"Your name\",\n        \"email\": \"youremail@example.com\",\n        \"password\": \"password\"\n    }\n    ```\n2.  **Login** \n\n    Endpoint:\n\n    ```\n    /auth/login\n    ``` \n    Methods = ['POST']\n        \n    Example POST payload :\n    ```json\n    {\n        \"username\": \"any-you-want\",\n        \"password\": \"password\"\n    }\n    ```\n3.  **Grocery lists**\n\n    Endpoint:\n    ```\n     /grocerylists/\n    ``` \n\n    Search by title:\n\n    ```\n    /grocerylists/?q=placeholder\n    ```\n    Example GET Pagination:\n    ```\n    /grocerylists/?page=3\u0026limit=4\n    ```\n\n    Methods = ['POST', 'GET']\n\n    Authentication header:\n    ```\n    Authorization: Bearer \u003cyour access token\u003e\n    ```\n        \n    Example POST payload :\n    ```json\n    {\n        \"title\": \"your new grocery list title\",\n        \"description\": \"whatever description\"\n    }\n    ```\n\n    Example response to GET:\n    ```json\n    [\n        {\n            \"title\":\"whatever title\",\n            \"description\":\"whatever description\"\n        },\n        {\n            \"title\":\" another title\",\n            \"description\":\"another description\"\n        },\n\n        ...\n\n    ]\n    ```\n\n4.  **Single Grocery List**\n\n    Endpoint:\n    ```\n     /grocerylists/\u003cid\u003e\n    ``` \n\n    Methods = ['PUT', 'GET', 'DELETE']\n\n    Authentication header:\n    ```\n    Authorization: Bearer \u003cyour access token\u003e\n    ```\n        \n    Example PUT payload :\n    ```json\n    {\n        \"title\": \"your modified grocery list title\",\n        \"description\": \"whatever new description\"\n    }\n    ```\n    Example response to GET:\n    ```json\n    {\n        \"title\":\"whatever title\",\n        \"description\":\"whatever description\"\n    }\n    ```\n\n5.  **Items in a Grocery list**\n\n    Endpoint:\n    ```\n     /grocerylists/\u003cid\u003e/items/\n    ``` \n    Search by name:\n    ```\n    /grocerylists/\u003cid\u003e/items/?q=whatever_name_you_want\n    ```\n    Example GET Pagination:\n    ```\n    /grocerylists/\u003cid\u003e/items/?page=3\u0026limit=4\n    ```\n\n    Methods = ['POST', 'GET']\n\n    Authentication header:\n    ```\n    Authorization: Bearer \u003cyour access token\u003e\n    ```\n        \n    Example POST payload :\n    ```json\n    {\n        \"name\": \"name of new item\",\n        \"quantity\": 50,\n        \"unit\": \"baskets\"\n    }\n    ```\n    Example response to GET:\n    ```json\n    [\n        {\n            \"name\":\"whatever name\",\n            \"quantity\":8,\n            \"unit\": \"whatever units\"\n        },\n        {\n            \"name\":\"baking flour\",\n            \"quantity\":8,\n            \"unit\": \"kg\"\n        },\n        \n        ...\n\n    ]\n    ```\n\n6.  **Single Item of Grocerylists**\n\n    Endpoint:\n    ```\n     /grocerylists/\u003cid\u003e/items/\u003citem_id\u003e\n    ``` \n\n    Methods = ['PUT', 'GET', 'DELETE']\n\n    Authentication header:\n    ```\n    Authorization: Bearer \u003cyour access token\u003e\n    ```\n        \n    Example PUT payload :\n    ```json\n    {\n        \"name\": \"modified name of item\",\n        \"quantity\": 500,\n        \"unit\": \"NGN\"\n    }\n    ```\n    Example response to GET:\n    ```json\n    {\n            \"name\":\"baking flour\",\n            \"quantity\":8,\n            \"unit\": \"kg\"\n    }\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaopayne%2Fgrocery_store_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaopayne%2Fgrocery_store_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaopayne%2Fgrocery_store_api/lists"}