A REST API for managing retail product inventory and variants. Built with FastAPI, SQLModel, and PostgreSQL, with structured JSON logging, centralised exception handling, and Docker support.
Live API: retail-inventory-api-yati.onrender.com/docs
- Python 3.11+
- uv
- Docker & Docker Compose
git clone https://github.com/chris-kechagias/retail-inventory-api.git
cd retail-inventory-apiCopy .env.example to .env and fill in the values:
cp .env.example .env# Local Docker
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
DB_PORT=5432
DB_NAME=retail_inventory_db
# Supabase (Cloud) — Transaction pooler
# DB_USERNAME=postgres.<your-project-ref>
# DB_PASSWORD=your_supabase_password
# DB_HOST=aws-1-<region>.pooler.supabase.com
# DB_PORT=6543
# DB_NAME=postgresInstall uv if you don't have it:
pip install uvInstall dependencies and start the database:
uv sync
docker compose up -d dbRun the development server:
task dev
# or manually:
uv run uvicorn main:app --reloadtask build
# or manually:
docker compose up --buildThe API will be available at http://localhost:8000.
Run the full test suite with:
uv run pytest -v29 tests covering all endpoints: products, variants, analytics, and health check. Uses SQLite in-memory database — no external dependencies required.
Special thanks to qquorum, Senior Software Developer, for code reviews, architectural guidance, and mentorship throughout this project.
Chris Kechagias
Transitioning from retail operations to AI engineering.
⭐ If you find this project helpful, consider giving it a star!