A comprehensive project skeleton for enterprise applications with integrated support for essential development services and best practices.
- π Modern PHP 8.3
- π Multiple web servers (Nginx, Apache)
- π SQL & NoSQL databases
- πΎ Caching solutions
- π¨ Message brokers
- π Search engines
- π Monitoring tools
- π§ Mail testing
- π Logging systems
- π API documentation
- β° Task scheduling
To switch between frameworks, use the following command:
# Example: Switch to Laravel framework
make framework laravel
# Example: Switch to Symfony framework
make framework symfony
- Copy configuration:
make copy-config
-
Configure environment:
- Edit
infrastructure/config/cs-config
to customize services - Just uncomment what you need. Example:
-
server=nginx # Web Server: nginx, apache database=postgres # Database Service: postgres, mysql ;nosql=mongodb # NoSQL Database Service: mongodb, cassandra cache=redis # Cache Service: redis, memcached ;search=elasticsearch # Search: elasticsearch, solr ;message=kafka # Message Broker: rabbitmq, kafka docs=swagger # API Documentation: swagger ;mailer=mailhog # Mail Sandbox: mailhog, papercut ;monitoring=grafana # Monitoring: grafana, zabbix ;logs=kibana # Log Management: kibana, graylog ;job=cron # Scheduling Jobs: cron
- Edit
-
Install and start:
make install
PHP container will be build automatically depend on which services you choose.
Category | Service | Version | Access URL |
---|---|---|---|
Web Servers | Nginx Apache |
stable-alpine 2.4 |
http://localhost:1000 https://localhost:1001 |
Databases | PostgreSQL MySQL MongoDB Cassandra |
15 8.0 6.0 4.1 |
- |
Caching | Redis Memcached |
7.2-alpine 1.6-alpine |
- |
Message Brokers | RabbitMQ Kafka |
3.12-alpine 3.3.1 |
http://localhost:15672 http://localhost:8080 |
Search | Elasticsearch Solr |
8.11.1 9.3 |
- |
Monitoring | Zabbix Grafana |
6.4 10.2.0 |
http://localhost:8081 http://localhost:3000 |
Mail Testing | Mailhog Papercut |
v1.0.1 5.7.0 |
http://localhost:8025 http://localhost:37408 |
Logging | Kibana Graylog |
8.11.1 5.2 |
http://localhost:5601 http://localhost:9400 |
Documentation | Swagger | v5.9.1 | http://localhost:1002 |
Task Scheduling | Cron | PHP 8.3-cli | - |
-
Modular architecture in
src/
directory -
Independent ADR approach
-
Independent domain modules
-
Each module contains:
- Domain logic
- Infrastructure layer
- Module-specific config
- Test suite
-
Recommended structure:
src/
βββ YourDomain/
βββ Application/
β βββ YourUseCase/
| βββ Query/
β βββ Command/
βββ DomainModel/
β βββ Model/
β βββ Repository/
β βββ Service/
βββ Infrastructure/
β βββ Persistence/
β β βββ InMemmory/
β β βββ Repository/
β βββ Clients/
βββ Presentation/
β βββ Api/
| βββ Request/
β βββ Response/
β βββ Console/
β βββ Web/
| βββ Request/
β βββ Response/
βββ Resources/
| βββ Config/
| βββ Assets/
β βββ Template/
βββ Tests/
βββ Unit/
βββ Integration/
- Create domain in
/src/YourDomain
- Register your provider in
code/config/app.php
(Laravel) orcode/config/packages/domains.yaml
(Symfony) - Follow existing domain structure.
Tool | Purpose | Command |
---|---|---|
PHP CS Fixer | Code standards | make phpcs |
Deptrac | Architecture validation | make deptrac |
PHPStan | Static analysis | make phpstan |
Psalm | Type checking | make psalm |
PhpMetrics | Php metrics | make phpmetrics |
PHPUnit | Testing | make test-php |
Newman | API testing | make test-postman |
Purpose | Command |
---|---|
Copy cs-config.ini.dist to cs-config file | make copy-config |
Display current configuration | make show-config |
Purpose | Command |
---|---|
Clear caches and dump autoload | make cc |
Run all code quality checks | make ci |
Purpose | Command |
---|---|
View cron output logs | make logs-cron |
View PHP logs | make logs-php |
The project includes a set of health check commands to monitor various services.
All commands return:
- Success (0): When the service is available and functioning correctly
- Failure (1): When there are connection issues or service malfunctions
Usage example:
# Test MySQL connection
php bin/console app:healthcheck:mysql
- Automatic Request-ID generation
- UUID v4 format
- Header-based tracking
- Development certificates included
- HTTP to HTTPS redirect
- TLS 1.2/1.3 support
- Custom certificate support (place in
etc/containers/nginx/ssl/
)
- Docker-based scheduling
- Configure in
infrastructure/crontab
- Monitor with
docker-compose exec cron crontab -l
- Postman collection in
tools/postman
- Environment variables support
- Automated testing via Newman
- Install GELF PHP package:
composer req graylog2/gelf-php
- Configure UDP Input:
- Access http://localhost:9400
- Navigate to System β Inputs
- Add "GELF UDP" input on port 12201
- Create index
curl -X PUT http://localhost:9200/logs -H Content-Type: application/json -d {"settings":{"number_of_shards":1,"number_of_replicas":0},"mappings":{"properties":{"@timestamp":{"type":"date"},"message":{"type":"text"},"level":{"type":"keyword"},"channel":{"type":"keyword"},"context":{"type":"object"}}}}
- Reload logstash
docker compose -f infrastructure/docker-compose-tools.yml --profile elk restart logstash
We welcome contributions to the Enterprise Skeleton project! If you'd like to join the development effort, you can contribute by creating Pull Requests (PRs).
We are currently looking for contributions in the following areas:
- Sentry Integration: We need help implementing Sentry for error tracking and monitoring. If you have experience with Sentry integration in PHP applications, we'd love your contribution!
- RoadRunner Integration: We are looking to integrate RoadRunner as a high-performance PHP application server. If you have experience with RoadRunner implementation, your contribution would be valuable!
- New Framework Integrations: We are actively looking to expand our framework support. If you'd like to integrate a new PHP framework (like Yii, Slim, or others), we welcome your contribution! Each framework should:
- Fork the repository
- Create a new branch for your feature or fix
- Make your changes following our coding standards
- Write or update tests if necessary
- Submit a Pull Request with a clear description of the changes
- Ensure all checks pass (PHPStan, Psalm, CS-Fixer, etc.)
This project is licensed under the MIT License.