Symfony Flex
The Composer plugin that automates recipe installation and scaffolding for Symfony apps.
Repository Health
Technical Analysis
Symfony Flex is a Composer plugin that turns composer require into an automated project-scaffolding tool for Symfony applications. When a package with a published “recipe” is required, Flex fetches that recipe from the community Symfony Recipes repository and applies it automatically — writing config files, registering bundles, updating .env, and adding Docker/CI boilerplate — instead of leaving developers to wire everything by hand.
It underpins the modern Symfony developer experience: new Symfony projects start from a minimal skeleton, and functionality is added incrementally by requiring packages, with Flex keeping the generated configuration in sync as dependencies change or are removed.
What You Get
- Automatic recipe application on
composer require/composer remove, wiring config, bundles, and.enventries - A
symfony new/ skeleton-based project bootstrap flow for starting new Symfony apps .envfile management, merging environment variables contributed by each installed package’s recipe- Unpacking of “pack” meta-packages into their real, pinned dependency set
- Console commands for recipe status inspection (
symfony:recipes,symfony:recipes:install,symfony:recipes:update) - Docker and CI scaffolding contributed by recipes for common services (databases, message brokers)
Common Use Cases
- Starting a new Symfony project via the skeleton and letting Flex assemble the initial configuration
- Adding a new capability (e.g.
symfony/mailer,doctrine/orm) and getting its config,.envvars, and bundle registration applied automatically - Auditing which recipes are outdated or were modified locally via
symfony:recipes - Removing a package cleanly, with Flex reverting the config it originally added
- Standardizing project setup across a team so every developer’s local
.env/config matches what recipes define
Under The Hood
Architecture Flex’s entry point is src/Flex.php, a Composer plugin class that hooks into Composer’s event system (package install/update/uninstall events) to trigger recipe resolution. PackageResolver.php and Downloader.php fetch recipe metadata and payloads from the Symfony Recipes repositories, Configurator.php and the Configurator/ subdirectory apply the recipe’s file operations (copy files, merge config, register bundles, append env vars), and Unpacker.php/Unpack/ handles expanding meta-packages into concrete dependencies. Lock.php tracks which recipes/versions are applied so updates and removals can be reverted precisely. Tech Stack Built against composer-plugin-api ^2.1, requiring PHP 8.1+; dev dependencies include composer/composer itself for plugin-API integration testing and symfony/dotenv/symfony/filesystem/symfony/process for the .env and filesystem operations recipes perform. Code Quality tests/ mirrors the src/ structure with unit tests per configurator, downloader, and unpacker class; as a core Symfony org project it follows the same CI, coding-standards, and semver/BC policy as the rest of the framework, with 118 contributors. API Design End users interact with Flex almost entirely through existing Composer commands (composer require, composer remove) plus a handful of symfony:recipes:* console commands — there’s essentially no new API surface to learn, which is the point: Flex’s design goal is to make advanced scaffolding invisible during normal Composer usage.
Used by 3 apps in this directory
BillaBear
Ecommerce · Invoicing Finance
Self-hostable subscription management and billing platform with Stripe integration, tax automation, configurable workflows, and Twig-based document generation.
Hyvor Relay
Devops · AI Development · Monitoring
Self-hosted, open-source email API that automates DNS, manages SMTP delivery, and provides deep observability — replacing SES, Mailgun, and SendGrid with infrastructure you fully own.
Kimai
Invoicing Finance · Project Management
Professional open-source time tracking with invoicing, multi-user support, SAML/LDAP auth, and a full REST API—self-host it or use the cloud.