YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Drex
Python monorepo for microservices and shared libraries.
Services communicate via gRPC and Kafka. All data contracts live in a single shared schema library.
Architecture Overview
βββββββββββββββββββ
HTTP clients ββββΆ β Gateway β routing + aggregation only
ββββββββββ¬βββββββββ
β gRPC
ββββββββββββββββββββΌβββββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Service A β β Service B β β Service C β
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
ββββββββββββββββββββΌβββββββββββββββββββ
βββββββββββ
β Kafka β event bus
βββββββββββ
Shared: libs/schema Β· libs/util Β· libs/feature
All services import schemas from drex.schema and helpers from drex.util.
No business logic lives in the Gateway. No domain crosses its bounded context.
Repository Layout
drex/
βββ libs/
β βββ schema/ # Single source of truth β Pydantic models, Protobuf defs
β βββ util/ # Infra helpers β Kafka wrappers, gRPC clients, config
β βββ feature/ # Reusable business logic (no transport / DB wiring)
βββ services/
β βββ example_service/ # Scaffold for a real microservice
βββ gateway/ # API Gateway (routing + aggregation only)
βββ docs/
β βββ adr/ # Architecture Decision Records
β βββ worklog/ # Task worklogs (per-session)
β βββ features/ # Long-lived feature documentation
βββ AGENTS.md # AI agent operating rules
βββ CONTRIBUTING.md
βββ CHANGELOG.md
βββ LICENSE
βββ .env.example
βββ .env.test
βββ pyproject.toml # Root workspace config (Poetry / Hatch)
Microservices
| Service | Purpose | Docs |
|---|---|---|
gateway |
HTTP β gRPC routing and aggregation | gateway/README.md |
services/example_service |
Scaffold / reference implementation | services/example_service/README.md |
Shared Libraries
| Library | Purpose |
|---|---|
libs/schema |
Pydantic models, Protobuf definitions, event schemas |
libs/util |
Kafka producer/consumer wrappers, gRPC client helpers, config loader |
libs/feature |
Portable business logic with no side-effects |
Quick Start
# 1. Clone
git clone https://github.com/swordenkisk/Drex.git && cd drex
# 2. Copy environment files
cp .env.example .env
# 3. Start infrastructure (Kafka + databases)
docker compose up -d
# 4. Install all packages (from workspace root)
poetry install
# 5. Run a service
cd services/example_service
poetry run python -m example_service
Running Tests
# All tests (real Kafka + DB via test containers)
pytest
# Async tests only
pytest -m asyncio
# A single service
pytest services/example_service/tests/
See CONTRIBUTING.md for testing conventions.
Documentation Index
- AGENTS.md β AI agent operating rules
- docs/adr/ β Architecture Decision Records
- docs/features/ β Long-lived feature docs
- CHANGELOG.md
Β© 2025 swordenkisk β All Rights Reserved
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support