Skip to content

Development Setup

This guide covers local development workflows for the loryth-grocery service.

Prerequisites

  • Python 3.13+
  • uv for dependency management
  • Docker & Docker Compose (for PostgreSQL and RabbitMQ)

Initial Setup

cd server/services/loryth-grocery

# Create virtualenv and install all dependencies
make setup

# Start PostgreSQL, RabbitMQ, and run migrations
make docker-up

Running the Service

# Start with hot-reload (port 8000)
make dev

Testing

Tests are full integration tests using testcontainers (PostgreSQL). Docker must be running.

# Run the full test suite
make test

# Run a specific test
.venv/bin/python -m pytest tests/api/test_catalog.py::test_create_ingredient -v

Linting & Formatting

# Check linting (ruff + mypy)
make lint

# Auto-format code
make format

Database

# Start infrastructure containers + run migrations
make docker-up

# Stop containers and remove volumes
make docker-down

# Open a psql shell
make docker-db

Migrations are pure SQL files in the migrations/ directory (v00-v08).

Docs Workflow

From server/services/loryth-grocery/:

make docs-serve          # Serve docs locally
make docs-build          # Build static docs
make docs-lint           # Lint docs
make docs-docker-build   # Build docs Docker image

OpenAPI Generation

Generate the OpenAPI schema used by the docs:

make openapi-generate