The Inventory is a comprehensive, open-source inventory management system built with Django REST Framework. It provides a robust backend API for managing products, stock levels, locations, and inventory movements across multiple tenants.
Key Features:
The Inventory is a backend API only. It provides all the inventory management logic and data persistence. You’ll need a frontend application to interact with it.
Frontend Repository: the-inventory-ui (Next.js)
Yes! The Inventory is production-ready. It includes:
See Deployment Guide for production setup instructions.
Minimum Requirements:
Recommended for Production:
See Getting Started for detailed setup.
Follow the Getting Started Guide for step-by-step installation instructions.
Quick Start:
# Clone the repository
git clone https://github.com/Ndevu12/the_inventory.git
cd the_inventory
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment
cp .env.example .env
# Run migrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Start development server
python manage.py runserver
For Development: SQLite (default, no setup needed)
For Production: PostgreSQL 12+
See Environment Variables for database configuration.
See Getting Started - Database Setup for detailed PostgreSQL installation and configuration.
Not recommended. SQLite is suitable for development and testing only. For production, use PostgreSQL.
Why?
Use the seeding commands:
# Seed all data
python manage.py seed_database
# Seed specific data
python manage.py seed_database --seeders=tenant,user,product
See Seeding Guide for more options.
See Test Users for a list of pre-seeded test accounts and their credentials.
The Inventory uses JWT (JSON Web Tokens) for authentication.
Authentication Flow:
/api/auth/login/Authorization: Bearer <token> headerSee API Reference - Authentication for detailed examples.
See Integration Guide for step-by-step frontend integration instructions.
Key Points:
Development: http://localhost:8000/api/
Production: Depends on your deployment (e.g., https://api.example.com/api/)
The API returns standard HTTP status codes and error messages:
400 Bad Request — Invalid input401 Unauthorized — Missing or invalid authentication403 Forbidden — Insufficient permissions404 Not Found — Resource not found500 Server Error — Internal server errorSee API Reference - Error Handling for details.
The API uses cursor-based pagination for large result sets.
Query Parameters:
limit — Number of results per page (default: 20, max: 100)offset — Number of results to skip (default: 0)Example:
GET /api/products/?limit=50&offset=100
See API Reference - Pagination for more details.
Use query parameters to filter results:
GET /api/products/?category=electronics&in_stock=true
See API Reference - Filtering for available filters per endpoint.
A tenant is an isolated organization or business unit. Each tenant has:
See Architecture - Multi-Tenancy for details.
Use the admin interface or API:
# Via Django admin
python manage.py createsuperuser
# Then visit http://localhost:8000/admin/
# Via API
POST /api/tenants/
{
"name": "My Organization",
"slug": "my-org"
}
See Operations Guide - Tenant Management for details.
Core Features:
See Features for a complete list.
Yes! Every stock movement is recorded with:
See API Reference - Stock Movements for details.
Set the reorder_point on each product:
PATCH /api/products/{id}/
{
"reorder_point": 10
}
The system will automatically flag products below this level.
See Features - Low Stock Alerts for details.
Yes! Create stock locations and track inventory per location:
POST /api/stock-locations/
{
"name": "Warehouse A",
"location_type": "warehouse"
}
See API Reference - Stock Locations for details.
Use the search endpoint:
GET /api/products/?search=laptop
Searches across product name, SKU, and description.
See API Reference - Search for advanced search options.
See Deployment Guide for comprehensive deployment instructions covering:
See Operations Guide - Monitoring for:
See Operations Guide - Backups for:
See Operations Guide - Scaling for:
See Deployment Guide - Updates for:
See Troubleshooting Guide for:
Yes! The Inventory includes:
See Security Guide for detailed security information.
See Security Guide - Reporting Vulnerabilities for responsible disclosure procedures.
The Inventory stores:
See Security Guide - Data Protection for details.
Data is protected through:
See Security Guide - Data Protection for details.
Yes! Use the API to export data:
GET /api/products/?format=csv
GET /api/stock-movements/?format=json
See API Reference - Export for available formats.
See Development Guide for:
# Run all tests
pytest
# Run specific test file
pytest tests/api/test_products.py
# Run with coverage
pytest --cov=src
See Development Guide - Testing for more options.
See Contributing Guide for:
src/
├── api/ # REST API endpoints
├── core/ # Core models and business logic
├── inventory/ # Inventory management
├── procurement/ # Procurement features
├── audit/ # Audit trails
└── the_inventory/ # Django settings
See Development Guide - Code Organization for details.
See Development Guide - Debugging for:
See Development Guide - Adding Features for:
The API supports multiple languages through the language query parameter:
GET /api/products/?language=en
GET /api/products/?language=es
GET /api/products/?language=fr
See Internationalization Guide for supported languages.
See Internationalization Guide - Adding Languages for:
See Internationalization Guide - Translation Workflow for:
See Operations Guide - Performance Tuning for:
See Operations Guide - Monitoring for:
The Inventory can handle millions of products. Performance depends on:
See Operations Guide - Scaling for optimization strategies.
See Troubleshooting - API Won’t Start for:
See Troubleshooting - Authentication Errors for:
See Troubleshooting - Database Connection for:
See Troubleshooting - Performance Issues for:
Resources:
If you can’t find the answer here:
We’re here to help! 🚀