Small Business Inventory System

A comprehensive FastAPI-based inventory management system designed for small businesses to track products, manage stock levels, and monitor supplier relationships.

Features

  • Product Management: Complete CRUD operations for products with SKU tracking
  • Category Management: Organize products into categories
  • Supplier Management: Track supplier information and relationships
  • Inventory Tracking: Real-time stock level monitoring with low-stock alerts
  • Stock Movements: Track all inventory movements (IN/OUT/ADJUSTMENTS)
  • Reporting: Stock reports and analytics
  • API Documentation: Auto-generated OpenAPI documentation

Quick Start

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
uvicorn main:app --reload
  1. Access the API documentation at: http://localhost:8000/docs

API Endpoints

Products

  • GET /products/ - List all products (with filtering options)
  • POST /products/ - Create a new product
  • GET /products/{product_id} - Get product by ID
  • GET /products/sku/{sku} - Get product by SKU
  • PUT /products/{product_id} - Update product
  • DELETE /products/{product_id} - Delete product

Categories

  • GET /categories/ - List all categories
  • POST /categories/ - Create a new category
  • GET /categories/{category_id} - Get category by ID
  • PUT /categories/{category_id} - Update category
  • DELETE /categories/{category_id} - Delete category

Suppliers

  • GET /suppliers/ - List all suppliers
  • POST /suppliers/ - Create a new supplier
  • GET /suppliers/{supplier_id} - Get supplier by ID
  • PUT /suppliers/{supplier_id} - Update supplier
  • DELETE /suppliers/{supplier_id} - Delete supplier

Inventory

  • POST /inventory/stock-movement - Record stock movement
  • GET /inventory/stock-movements - List stock movements
  • GET /inventory/low-stock - Get low stock products
  • GET /inventory/stock-report - Get stock analytics
  • PUT /inventory/adjust-stock/{product_id} - Adjust stock levels

System

  • GET / - API information and links
  • GET /health - Health check endpoint

Database

The system uses SQLite database with the following storage structure:

  • Database file: /app/storage/db/db.sqlite

Environment Variables

No environment variables are required for basic operation. The system uses SQLite with default paths.

Development

Database Migrations

The project uses Alembic for database migrations:

# Run migrations
alembic upgrade head

# Create new migration
alembic revision --autogenerate -m "description"

Code Quality

The project uses Ruff for linting and formatting:

# Install ruff
pip install ruff

# Run linting
ruff check .

# Auto-fix issues
ruff check . --fix

Project Structure

├── main.py                 # FastAPI application entry point
├── requirements.txt        # Python dependencies
├── alembic.ini            # Alembic configuration
├── alembic/               # Database migrations
├── app/
│   ├── db/                # Database configuration
│   ├── models/            # SQLAlchemy models
│   ├── schemas/           # Pydantic schemas
│   └── routers/           # API route handlers
└── storage/
    └── db/                # SQLite database storage
Description
Project: Small Business Inventory System
Readme 42 KiB
Languages
Python 98%
Mako 2%