A RESTful API for inventory management built with Django and Django REST Framework. This API will allow users to manage inventory items by adding, updating, deleting, and viewing current inventory levels, along with tracking of inventory changes.
- User Authentication & Authorization: Secure JWT-based authentication system
- Inventory Item Management: Complete CRUD operations for inventory items
- Category Management: Organize items by customizable categories
- Inventory Tracking: Monitor changes to inventory quantities with detailed logs
- Filtering & Searching: Advanced filtering options for inventory items (e.g., by category, price range, stock level).
- Pagination: Efficient handling of large datasets
- Stock Status: Real-time stock status (e.g., "In Stock", "Low Stock", "Out of Stock").
- Role-Based Access Control: Staff users can manage all items, while regular users can only manage their own items.
- Low Stock Alert: Send email alerts when item's stock level drops below a certain threshold.
- Interactive API Documentation: Swagger and ReDoc documentation for developers
The API is deployed and accessible at the following URL:
Base URL: https://namodynamic1.pythonanywhere.com/api/inventory/
-
Clone the repository:
git clone https://github.com/namodynamic/inventory-management-api.git cd inventory-management-api
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Apply database migrations:
python manage.py migrate
-
Create a superuser (optional):
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
- Register User:
/api/inventory/users/
(POST) - Obtain JWT Token:
/api/token/
(POST) - Refresh JWT Token:
/api/token/refresh/
(POST) - Login User:
/api/inventory/users/login/
(POST) - User Profile:
/api/inventory/users/me/
(GET) - Logout User:
/api/inventory/users/logout/
(POST)
- List Inventory Items:
/api/inventory/items/
(GET) - Create Inventory Item:
/api/inventory/items/
(POST) - Retrieve Inventory Item:
/api/inventory/items/{id}/
(GET) - Update Inventory Item:
/api/inventory/items/{id}/
(PUT) - Delete Inventory Item:
/api/inventory/items/{id}/
(DELETE) - Stock Level:
/api/inventory/items/level/
(GET) - Item Stock Level:
/api/inventory/items/{id}/level/
(GET) - Adjust Quantity:
/api/inventory/items/{id}/adjust_quantity/
(POST) - Low stock items:
/api/inventory/items/low-stock/
(GET)
- List Categories:
/api/inventory/categories/
(GET) - Create Category:
/api/inventory/categories/
(POST) - Retrieve Category:
/api/inventory/categories/{id}/
(GET) - Update Category:
/api/inventory/categories/{id}/
(PUT) - Delete Category:
/api/inventory/categories/{id}/
(DELETE) - Search Categories by Name:
/api/inventory/categories/search={name}/
(GET)
- List Inventory Logs:
/api/inventory/logs/
(GET) - Item Inventory Logs:
/api/inventory/logs/{id}/item/
(GET)
- List Suppliers:
/api/inventory/suppliers/
(GET) - Create Supplier:
/api/inventory/suppliers/
(POST) - Retrieve Supplier:
/api/inventory/suppliers/{id}/
(GET) - Update Supplier:
/api/inventory/suppliers/{id}/
(PUT) - Delete Supplier:
/api/inventory/suppliers/{id}/
(DELETE)
- List Inventory Item Suppliers:
/api/inventory/item-suppliers/
(GET) - Create Inventory Item Supplier:
/api/inventory/item-suppliers/
(POST) - Retrieve Inventory Item Supplier:
/api/inventory/item-suppliers/{id}/
(GET) - Update Inventory Item Supplier:
/api/inventory/item-suppliers/{id}/
(PUT) - Delete Inventory Item Supplier:
/api/inventory/item-suppliers/{id}/
(DELETE)
Interactive API documentation is available at Swagger and ReDoc.
You can also find the API documentation Postman.
- Backend: Django, Django REST Framework
- Database: PostgreSQL
- Authentication: Django REST Framework SimpleJWT
- API Documentation: drf-yasg (Swagger and ReDoc)