This is an API for managing the inventory and suppliers of an online store. It allows employees to add, view, update, and remove items from the inventory, manage suppliers, and establish relationships between items and suppliers.
- Inventory Item Management
- Supplier Management
- Item-Supplier Relationship Management
- Secure endpoints using Knox tokens
- API Documentation using Swagger
- Pagination and Filtering of inventory items
- Django
- Django REST Framework
- PostgreSQL
- Docker
- Knox for token-based authentication
-
Clone the repository:
git clone https://github.com/Komatech/online_store_inventory_api.git cd online_store_inventory_api -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Set up the PostgreSQL database:
- Install PostgreSQL and create a new database and user.
- Update the env with your database credentials.
-
Create migrations:
python manage.py makemigrations
-
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Clone the repository:
git clone https://github.com/Komatech/online_store_inventory_api.git cd online_store_inventory_api -
Build and run the containers:
docker-compose up --build
To run the tests, use the following command:
python manage.py test inventory.testThe API documentation is generated using Swagger. You can access it at the following URLs once the server is running:
- Swagger UI: http://localhost:8000/swagger/
- ReDoc: http://localhost:8000/redoc/
You can find the Postman documentation for this API at the following URL: