A modern Symfony template using a layered architecture pattern with FrankenPHP for high-performance PHP applications. Features a flexible Docker setup optimized for development and production.
- 🚀 FrankenPHP - Modern PHP application server with built-in Caddy
- 🐳 Multi-stage Docker - Optimized dev/prod configurations
- 🔧 Flexible PHP Extensions - Configure via environment variables
- 🐛 Xdebug Ready - Pre-configured for development debugging
- 🗄️ PostgreSQL - Production-ready with health checks
- 📦 Live Reload - Automatic file watching in development
- 🔒 Production Optimized - OPcache, JIT
- Docker Desktop (Mac/Windows) or Docker Engine (Linux)
- Docker Compose v2+
# Create .env
cp .env.dist .env
# Initialize project
docker/console boot docker-compose.yml #(or docker-compose.test.yml or docker-compose.prod.yml)
# Start project and install dependencies
docker/console install
# Access shell
docker/console cliDevelopment:
- Application: http://localhost:8080
- HTTPS: https://localhost:8443
- Caddy Admin API: http://localhost:2019
- PostgreSQL:
localhost:5432 - Health Check: http://localhost:8080/health
Production:
- Application:
http://localhost:80/https://localhost:443 - PostgreSQL: Internal network only
docker/console boot {file} # Initialize project
docker/console up # Start project
docker/console start # Start project
docker/console stop # Stop project
docker/console down # Removes containers and volumes
docker/console cli # Access shell
docker/console install # Start project, install dependencies and run migrations
docker/console reset # Reset project (down & install)Xdebug is pre-configured in development mode:
-
PHPStorm/IntelliJ:
- Go to Settings → PHP → Servers
- Add server: Name:
app, Host:localhost, Port:8080 - Enable path mappings:
/path/to/your/project→/app - Start listening for debug connections
-
VS Code:
- Install PHP Debug extension
- Add to
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceFolder}"
}
}
]
}├── config/
├── docker/
│ └── frankenphp/
│ ├── Dockerfile
│ ├── Caddyfile
│ ├── Caddyfile.prod
│ ├── xdebug.ini
│ ├── opcache.ini
│ └── opcache.prod.ini
├── public/
├── src/
│ ├── Backend/
│ │ └── {Module}
│ │ ├── Business/ # Facades and Business logic
│ │ ├── Communication/ # Controllers and commands
│ │ ├── Persistence/ # Entities, repositories & entity managers
│ │ └── Presentation/ # Templates and js
│ ├── Frontend/
│ │ └── {Module}
│ │ ├── Controller/ # Controllers
│ │ └── Theme/ # Templates and js
│ ├── Client/
│ │ └── {Module}
│ ├── Service/
│ │ └── {Module}
│ ├── Shared/
│ │ └── {Module}
│ │ ├── Transfers/
│ │ └── ...
│ └── Generated/ # Migrations, Generated Transfers, ...
├── tests/
├── docker-compose.yml
├── docker-compose.prod.yml
├── docker-compose.test.yml
└── .gitattributes
vendor/bin/phpunit
# With coverage
XDEBUG_MODE=coverage,debug vendor/bin/phpunit --coverage-html coverage#Deptrac
vendor/bin/deptrac
#Phpstan
vendor/bin/phpstan analyse --memory-limit=1Gsymfony console transfer:generateCreate migration files:
php bin/console doctrine:migrations:diffRun migration files:
php bin/console doctrine:migrations:migrateRun migration for testing purposes:
migrations:execute --up "DoctrineMigrations\\{version}"Revert the migration:
migrations:execute --down "DoctrineMigrations\\{version}"