Skip to content

Our Story

From CRUD Frustration to AI-Powered DDD: The Castlecraft Engineer & Architect Story

Many technical leaders have faced the allure of rapid development offered by CRUD-centric frameworks. The initial velocity is tempting, allowing teams to scaffold database tables and basic UIs quickly. However, this path often leads to a familiar challenge: as domain complexity grows, these frameworks can impose rigid abstractions, hindering true alignment with business needs and accumulating significant technical debt. The "golden hammer" of quick scaffolding can, over time, become the shackle that limits a project's evolution.

Our journey began with this very frustration. We recognized that while the intent was to avoid boilerplate, the long-term cost was often an architecture ill-suited for complex, evolving domains. Even initial attempts to build a custom framework risked repeating these patterns, leading to potential database bottlenecks and a disconnect from core Domain-Driven Design (DDD) principles.

Inspired by the power of DDD, CQRS (Command Query Responsibility Segregation), and Event Sourcing to model and solve complex business problems, we sought a better way for the Python ecosystem. This led to the creation of Castlecraft Engineer: a minimal, contract-based Python framework designed from the ground up to support DDD. Engineer provides the foundational building blocks—clear contracts for Aggregates, Repositories, Commands, Queries, and Event Sourcing—empowering developers to choose their underlying database and infrastructure while adhering to sound architectural principles like Dependency Inversion (DI). We also integrated core concerns: robust user authentication via OIDC, and a flexible AuthorizationService contract. This contract allows developers to define and enforce permissions by implementing custom authorization logic or by integrating with sophisticated external engines, including systems like Casbin, OPA, SpiceDB or OpenFGA.

However, we understood a critical adoption barrier: even the best-designed framework can face resistance if it introduces excessive boilerplate. To address this, and leveraging the foundation of Castlecraft Engineer, we also developed Castlecraft Architect—an intelligent scaffolding and development acceleration tool. While Engineer provides the open-source building blocks, Architect explores how AI can further streamline the development process on top of such a DDD-centric framework.

Castlecraft Architect transforms the developer experience by:

  1. Facilitating Domain Exploration: It can generate context suitable for Large Language Models (LLMs), enabling richer, AI-assisted discussions with domain experts and team members to collaboratively define and refine system components.
  2. Intelligent Scaffolding: Based on these insights, Architect generates DDD-aligned boilerplate for your application, creating a well-structured foundation that embodies best practices from the outset.
  3. AI-Powered Code Generation & Guidance: With an understanding of your project's structure and DDD principles, Architect, in conjunction with LLMs, can suggest contextually relevant code additions. This AI assistance respects the Dependency Inversion Principle and helps maintain architectural integrity as your project grows.

The synergy between Castlecraft Engineer's robust DDD foundation and Castlecraft Architect's AI-driven acceleration aims to bridge the gap between sophisticated software design and pragmatic development. Our goal is to empower teams to build complex, maintainable, and scalable systems more efficiently, moving beyond the limitations of traditional approaches and truly harnessing the power of Domain-Driven Design with the assistance of modern AI.