Download the PHP package mghrby/modular-ddd without Composer
On this page you can find all versions of the php package mghrby/modular-ddd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mghrby/modular-ddd
More information about mghrby/modular-ddd
Files in mghrby/modular-ddd
Package modular-ddd
Short Description A Laravel package for building modular applications using Domain-Driven Design with Event Sourcing and CQRS
License MIT
Homepage https://github.com/theaddresstech/modular-ddd
Informations about the package modular-ddd
Laravel Modular DDD
A production-ready Laravel package for building modular applications using Domain-Driven Design (DDD) with Event Sourcing and CQRS patterns. This package provides a complete, battle-tested infrastructure for implementing DDD in Laravel applications with enterprise-grade features and 100% code generation reliability.
Features
🏗️ Domain-Driven Design Architecture
- Modular Structure: Organize your application into bounded contexts
- Aggregate Pattern: First-class support for DDD aggregates
- Value Objects: Built-in value object support
- Domain Events: Complete event-driven architecture
- Repository Pattern: Clean abstraction for data access
📦 Event Sourcing
- Event Store: High-performance event storage with tiered architecture
- Snapshots: Multiple snapshot strategies (Simple, Adaptive, Time-based)
- Event Replay: Rebuild aggregate state from events
- Event Versioning: Built-in support for event schema evolution
- Projections: Automatic projection updates from events
🚀 CQRS (Command Query Responsibility Segregation)
- Command Bus: Pipeline-based command processing
- Query Bus: Optimized query handling with caching
- Multi-tier Caching: L1 (Memory) + L2 (Redis) + L3 (Database)
- Async Processing: Queue-based command execution
- Middleware Pipeline: Validation, authorization, and transaction handling
🔄 Module Communication
- Event-driven Communication: Loosely coupled module interaction
- Message Bus: Direct module-to-module messaging
- Circuit Breakers: Resilience patterns for module dependencies
- Async Messaging: Queue-based communication between modules
🛠️ Code Generation ✨ 100% Reliable
- Module Generator: Scaffold complete DDD modules with all layers
- Aggregate Generator: Create aggregates with all components
- Command/Query Generators: Generate CQRS components with handlers
- Repository Generator: Create repository implementations with interfaces
- Migration Generator: Create event-sourcing compatible database schemas
- Factory Generator: Generate comprehensive test factories
- Test Generator: Create complete test suites with performance tests
- Dry-Run Mode: Preview all files before generation
📊 Production Features
- Health Monitoring: Comprehensive health checks with accurate status reporting
- Performance Metrics: Real-time performance tracking and monitoring
- Circuit Breakers: Automatic failure handling and resilience patterns
- Database Optimization: Query optimization and intelligent indexing
- Cache Management: Intelligent cache invalidation and multi-tier caching
- Module State Management: Persistent enable/disable functionality
- Zero-Error Generation: 100% syntax-valid code generation
Requirements
- PHP 8.2 or higher
- Laravel 11.0 or higher
- MySQL 8.0+ / PostgreSQL 13+ / SQLite 3.35+
- Redis (optional, for caching)
- Composer 2.0+
Installation
You can install the package via Composer:
After installation, publish the configuration and migrations:
Quick Start
1. Create a New Module
Generate a complete DDD module structure with guaranteed syntax validity:
This creates a complete DDD architecture with 36+ files:
2. Generate Additional Components
All generators support dry-run mode and produce 100% syntax-valid code:
3. Module Management
Manage module state with persistent configuration:
4. Define Commands and Handlers
5. Dispatch Commands
Available Commands
Module Generation Commands
Create Module
Generate a complete DDD module with all architectural layers:
Create Command
Generate CQRS commands and handlers:
Create Query
Generate CQRS queries and handlers:
Create Aggregate
Generate domain aggregates with event sourcing:
Create Repository
Generate repository interfaces and implementations:
Create Migration
Generate event-sourcing compatible migrations:
Create Factory
Generate test factories for modules:
Module Management Commands
Module Information
Get detailed information about modules:
List Modules
Display all available modules:
Health Check
Check module health and status:
Enable/Disable Modules
Manage module state (persists across restarts):
Migration Commands
Module Migrate
Run migrations for specific modules:
Migration Status
Check migration status for modules:
Migration Rollback
Rollback module migrations:
Testing Commands
Module Test
Run tests for specific modules:
Test Factory
Generate and run factory tests:
Documentation Commands
Generate Documentation
Create comprehensive module documentation:
Performance Commands
Benchmark
Run performance benchmarks:
Stress Test
Run stress tests on modules:
Advanced Usage
Event Sourcing with Snapshots
CQRS with Multi-tier Caching
Module Communication
Configuration
The package can be configured via config/modular-ddd.php:
Version 1.2.0 Highlights ✨
🎯 100% Code Generation Reliability
- Zero Template Errors: All template variables are properly substituted
- Syntax Validation: Every generated file passes PHP syntax validation
- Complete Coverage: 36+ files generated per module, all production-ready
🚀 Enhanced Developer Experience
- Dry-Run Mode: Preview all files before generation with
--dry-run - Persistent Module State: Enable/disable settings survive application restarts
- Comprehensive Commands: 20+ commands with full option support
- Intelligent Defaults: Smart fallbacks and error handling
🔧 Stability Improvements
- Factory Generation: No more missing stub file errors
- Migration Support: Full aggregate support with proper variable substitution
- Service Dependencies: All dependency injection issues resolved
- Test Infrastructure: Complete test stub ecosystem with performance, documentation, and helper stubs
📊 Quality Metrics
- 158 Source Files: 100% syntax valid
- Test Coverage: Comprehensive testing with fresh Laravel installation
- Zero Known Issues: All critical bugs resolved in v1.2.0
Testing
The package includes comprehensive testing utilities:
Testing Your Modules
Performance Optimization
Choose the Right Performance Profile
Optimize Event Store Queries
Monitor Performance
Documentation
Comprehensive documentation is available in the /docs directory:
- Architecture Overview
- Getting Started Guide
- Event Sourcing Guide
- CQRS Implementation
- Module Communication
- Production Deployment
- API Reference
- Performance Tuning
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on how to contribute to this project.
Development
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- The Address Tech
- Laravel Team
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Support
Made with ❤️ by The Address Tech Team
All versions of modular-ddd with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/console Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/events Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
ramsey/uuid Version ^4.7