A robust starter kit for Laravel 12 (PHP 8.4) featuring Hexagonal Architecture, Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), and the Action-Domain-Responder pattern. This kit provides a clean and extendable base for complex applications, following modern design best practices.
- Laravel 12 with PHP 8.4 support
- Hexagonal (Ports & Adapters) Architecture for better modularity
- Domain-Driven Design (DDD)
- CQRS (Command and Query Responsibility Segregation)
- Action-Domain-Responder pattern for clear code responsibility separation
- Doctrine ORM integrated for powerful object-relational mapping
- Out-of-the-box Docker support (NGINX, PostgreSQL, RabbitMQ, Redis)
- JWT Auth, Redis cache
- Includes developer tools: PHP CS Fixer, PHPStan, PHPUnit, and more
- Docker & Docker Compose installed
- Bash (for cert script)
- Optional: g++ (if not available, an alternative method is provided)
$ bash ./certgen.sh
Use the provided Makefile
to orchestrate containers:
$ make build
If you don't have g++ installed, use these Docker commands manually:
$ docker network create app-network
$ docker compose \
-f docker-compose.yml \
-f vendor/docker-compose.nginx.yml \
-f vendor/docker-compose.postgres.yml \
-f vendor/docker-compose.rabbitmq.yml \
-f vendor/docker-compose.redis.yml \
up --build -d --remove-orphans
$ docker compose exec app composer install --prefer-dist --optimize-autoloader
$ docker compose exec app cp .env.example .env
$ docker compose exec app php artisan key:generate
$ docker compose exec app php artisan jwt:secret
$ docker compose exec app php artisan migrate:fresh --seed
For help with available Makefile commands:
$ make help
Command | Description |
---|---|
make build | Build and start containers |
make start | Start containers |
make stop | Stop and remove containers and volumes |
make restart | Restart all containers |
- Doctrine ORM Integration: This project uses Doctrine ORM for advanced and flexible database management alongside Laravel.
- Override User IDs: You can override
USER_ID
andGROUP_ID
when calling Makefile commands:$ make build USER_ID=1000 GROUP_ID=1000
This project is licensed under the MIT License.