Symfony bootstrap project
Although it is totally possible to create a new Symfony project from scratch and integrate the generated code into it, Code-bay maintains a bootstrap project to help you get started very quickly without extra manual configuration. This project is available on Gitlab here, and is just a fork of the official Symfony
5.2 project. There are a few elements that have been added to the original fork to integrate with Code-bay environment. Those elements are described below.
The file config/services.yml contains additional configuration to allow auto-wiring for the default code location which is
src/Api. It also wires the Code-bay services included in the composer configuration of the project. Indeed some classes are need to set up the operation pipeline, all of them are packaged in an external dependency
sf5.2-coredownloaded by composer at installation time.
As described below, the
package.jsonfile has been modified to include two additional elements compared to the Symfony original project. The first one is the external
sf5.2-coredependency. The second one is the autoload configuration that has been modified to include the default generated code location. Indeed, classes with namespace starting with
Apiwill map to
src/Apifolder and namespace
The last element concerns the containerisation of the application. This aspect is handled by docker with the help of a
docker-compose.dev.ymlfile. It contains two services to launch your app run with one command line, without the need of setting up a web server on your host machine.
Let's take an example of a freshly created project with the default configuration. The diagram below illustrates what a default bootstrap Symfony bootstrap forked project looks like.
As explained before,
vendor/sf-core-5.2 folders are not part of the default Symfony bootstrap project, they have been added to help you get started with the creation of a new Api with Code-bay. Please read the Symfony app step by step example to get more details about setting up an Api application from scratch.