HexCore is a batteries-included Python SDK for teams building applications with hexagonal architecture and Domain-Driven Design. It provides the base classes, ports, and infrastructure adapters you need — so you can focus on your domain logic instead of scaffolding.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Indroic/HexCore/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Build a working CQRS app with HexCore in under 10 minutes.
Installation
Install HexCore with pip, with only the extras you need.
Core Concepts
Understand hexagonal architecture, DDD, and CQRS patterns.
API Reference
Complete reference for every public class and interface.
What HexCore Provides
HexCore is organized around the three layers of hexagonal architecture — domain, application, and infrastructure — and ships ready-to-use implementations for each.Domain Abstractions
BaseEntity, IBaseRepository, IUnitOfWork, DomainEvent, and BaseDomainService give you a consistent, DDD-idiomatic domain model.CQRS Buses
In-memory Command, Query, and Event buses with a middleware pipeline, handler registry, and smart routing to background workers.
Infrastructure Adapters
Drop-in SQLAlchemy and Beanie ODM repositories, Redis/PostgreSQL/RabbitMQ event buses, distributed locks, and cache backends.
Get Up and Running
Key Features
Smart Routing
Decorate commands and event handlers with
@background_command or @background_handler to transparently offload work to Celery or Procrastinate — no bus refactoring required.Pluggable Event Buses
Swap between in-memory, Redis Streams, PostgreSQL LISTEN/NOTIFY, and RabbitMQ event buses without changing your domain code.
Dynamic Scheduler
Run database-driven cron jobs that can be activated, deactivated, or rescheduled at runtime — with distributed locking to prevent duplicate execution.
CLI Scaffolding
Bootstrap hexagonal or vertical-slice projects, generate domain modules, and run migrations — all from the
hexcore CLI.