A REST API for a grocery store.
- Python 3.8 - Scripting Language for Backend
- Django 3.2 - Framework for Backend
- SQLite3 - To store user information
The ER Diagram for this API can be found here.
https://drawsql.app/society-management/diagrams/grocery-store#
To reproduce this code you need to go through the following steps:
-
Creating a Virtual Environment:(OPTIONAL)
Write the following commands in your command line.- pip install virtualenv
- python3 -m virtualenv venv_name
- source venv_name/bin/activate
- pip install Django
- pip install djangorestframework
-
Setting up MySQL: (OPTIONAL if you are using sqlite)
- Check in grocery_store/grocery_store.settings.py
-
Setting up Django:
Enter the following commands in your command line.- python3 manage.py makemigrations
- python3 manage.py migrate
- python3 manage.py createsuperuser
- python3 manage.py create_groups
- python3 manage.py runserver
-
To check the Backend you can go to:
- 127.0.0.1:8000/admin/
- 127.0.0.1:8000/api/slug
The appropriate slug can be found in grocery_store/api/urls.py or in the Postman Workspace
- User is identified by mobile number.
- Grocery Items do not have taxes.
- Bills can not be deleted. (Unethical to delete the bills)
- Grocery Items are generally not identified by code, rather identified by name
- As soon as a bill is generated, the corresponding items are subtracted from the inventory.
- In case a bill is updated, the corresponding item quantity will also be updated.
- Owner can segregate his staff into groups and give specific permissions.
- Pagination provided. You can control pagination in grocery_store/grocery_store.settings.py
- Added Search and Filtering to Item and Account
- Total Price of the bill is adjusted according to the items.
https://www.postman.com/technical-geologist-31086137/workspace/grocery-store