The Sylius Stack comes with a bunch of components that work great independently, but when they come together, that's when the stack's magic truly operates! Indeed, the highlight of this project is the ability to configure an admin panel UI within minutes.
Create a new project
You can set up the Sylius Stack on existing Symfony projects, but in the case you are starting from scratch, here is what you need to do.
# With Composer:composercreate-projectsymfony/skeleton:"8.0.*"my_project_directorycdmy_project_directorycomposerrequirewebapp# Or with Symfony CLI:symfonynewmy_project_directory--version="8.0.*"--webappcdmy_project_directory
Allow Contrib Recipes
Sylius Stack recipes are hosted in the symfony/recipes-contrib repository. To ensure Symfony Flex installs them automatically, enable contrib recipes before requiring the packages:
composerconfigextra.symfony.allow-contribtrue
Install the package using Composer and Symfony Flex
Go to your project directory and run the following command:
Type "a" or "p" to configure the packages via Symfony Flex.
Do not forget to set your application secret environment variable:
Run your web server
The admin panel is ready to use. Now, it's your turn!
Using AssetMapper
To prevent duplicate Ajax calls, disable the auto-initialized Stimulus app and Symfony UX stylesheets from the sylius/bootstrap-admin-ui package, so you can take control of Stimulus initialization in your own code.
Disabling Stimulus app & Symfony UX stylesheets from third party package
First, you need to disable the Stimulus App started by the sylius/bootstrap-admin-ui package and add a custom javascript app hook for the asset mapper.