The power of Symfony Flex for your custom Skeleton App

The custom Skeleton App that we developed for our company: https://github.com/4xxi/skeleton

One of the greatest improvements that Symfony 4 release brought to us was Symfony Flex. Actually, Flex is not tightly coupled to the fourth version of Symfony and you can easily use it with Symfony 3.3 or 3.4 to gain all the benefits of new project structure, automatic configuration, minified footprint and smooth scaling from micro to full-featured framework. And to ease up following migration to Symfony 4, of course.

Flex significantly simplifies the process of setting up new Symfony applications by replacing huge Symfony Standard Edition with tiny Symfony Skeleton — a simple one file repository that bootstraps the entire Symfony framework. What is even better, is that with Symfony Flex it became much easier to create your own distributions of the Symfony.

For example, we at 4xxi created a Skeleton App based on the official Symfony Skeleton that helps us configuring new projects on technology stack and standards adopted by our company. Its main idea is to keep the simplicity of official Skeleton, while adding must-have dependencies and default configs used for developing a majority of our projects. 4xxi Skeleton app contains bare Symfony Skeleton with the following additions.

Minimal set of must-have bundles for the production environment:

  • ORM Pack (for Doctrine and Migrations)
  • FrameworkExtraBundle (for annotations)
  • MonologBundle (for logs, obviously)
  • Sensiolabs SecurityChecker

Set of bundles and additional tools for development environment:

  • Maker Bundle (a brand new replacement for SensioGeneratorBundle)
  • PHP CS Fixer (automated code-style fixer with predefined config for our code standards)
  • Debug Pack (Debug + Profiler + Dumper)
  • Deployer (Capistrano-inspired deployment tool written in PHP) and it’s default configuration optimized for Symfony project structure
  • Docker Compose and Docker Sync configs for setting up local development environment with nginx, PHP-fpm, and PostgreSQL
  • Template for README.md with installation instructions

This set of tools is well suited for creating all kinds of projects — from simple microservices to complex API’s or full-featured websites because such things like code standards or basic configurations for setting up local Docker environment are not changing much.

The main benefit of Flex is that custom Skeleton App contains the minimum of the framework and the maximum of your added value components. That makes it really easy to maintain it because the only thing you should do to update the version of Symfony is to change a few constraint lines in composer.json.

The custom Skeleton App that we developed for our company: https://github.com/4xxi/skeleton

--

--