A library of RIDDL models organized by industry sector, plus reusable patterns for domain-driven design with RIDDL.
RIDDL (Reactive Interface to Domain Definition Language) is a domain-specific language for defining event-driven systems using Domain-Driven Design principles.
riddl-models/
├── patterns/ # Reusable DDD/Reactive patterns
├── technology/ # SaaS, DevOps, Platform services
├── investment/ # VC, Private Equity, Asset Management
├── finance/ # Banking, Payments, Trading
├── insurance/ # P&C, Life, Reinsurance
├── commerce/ # E-commerce, Retail, Marketplace
├── hospitality/ # Hotels, Restaurants, Travel
├── entertainment/ # Media, Gaming, Sports
├── marketing/ # Campaigns, Advertising, Analytics
├── healthcare/ # Clinical, Pharmacy, Payer
├── manufacturing/ # Discrete, Process, Maintenance
├── construction/ # Projects, Real Estate
├── engineering/ # PLM, Consulting
├── transportation/ # Freight, Passenger, Fleet
├── logistics/ # Warehousing, Fulfillment
├── natural-resources/ # Mining, Oil & Gas, Agriculture
├── utilities/ # Electric, Gas, Water
├── telecommunications/ # Network, Billing
├── government/ # Citizen Services, Public Safety
├── education/ # Academic, Training
└── professional-services/ # Legal, Accounting, HR
All 187 models are classified by NAICS code, covering 61 unique industry codes across 20 sectors.
- NAICS.md - Human-readable index organized by NAICS sector hierarchy (2-digit sector, 3-digit subsector, full industry code)
- NAICS.json - Machine-readable JSON mapping NAICS codes to model paths, for use by websites and tooling
- Browse to a sector directory (e.g.,
commerce/e-commerce/) - Find a model that fits your needs
- Copy the
.riddlfile as a starting point - Customize types, commands, and events for your domain
- Browse
patterns/for available patterns - Read the pattern's README for usage guidance
- Copy the template and replace
{Placeholders} - Integrate into your domain model
Models may include a complexity tier in their metadata:
| Tier | Best For |
|---|---|
starter |
Small businesses, MVPs, learning |
standard |
Mid-market, full-featured |
enterprise |
Large organizations, compliance-heavy |
// From commerce/e-commerce/shopping-cart/
domain ECommerce is {
context ShoppingCart is {
entity Cart is {
briefly "Customer's shopping cart"
type CartId is Id(Cart)
type CartItem is { productId: ProductId, quantity: Integer, price: Decimal }
command AddItem is { cartId: CartId, item: CartItem }
command RemoveItem is { cartId: CartId, productId: ProductId }
command Checkout is { cartId: CartId }
event ItemAdded is { cartId: CartId, item: CartItem }
event ItemRemoved is { cartId: CartId, productId: ProductId }
event CartCheckedOut is { cartId: CartId, total: Decimal }
state Active is {
id: CartId,
items: CartItem*,
total: Decimal
}
handler CartHandler is {
on command AddItem {
set field items to state.items + @AddItem.item
send event ItemAdded to outlet Events
}
on command Checkout {
send event CartCheckedOut to outlet Events
}
}
}
}
}
| Pattern | Use Case |
|---|---|
| Event-Sourced Entity | Full audit trail, temporal queries |
| Aggregate Root | Parent-child entity relationships |
| Saga | Multi-step distributed transactions |
| Repository | Entity persistence abstraction |
| Projector | CQRS read-optimized views |
| Process Manager | Event-driven workflow coordination |
These models work with:
- riddl - Compiler and validation
- riddl-mcp-server - AI assistance for RIDDL development
- riddlsim - Model simulation
- synapify - Visual RIDDL editor
- Fork the repository
- Create your model in the appropriate sector
- Include a README.md explaining the model
- Optionally add a
.metadata.jsonfile - Submit a pull request
See CLAUDE.md for detailed contribution guidelines.
Apache 2.0 - See LICENSE