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.

  1. 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-core downloaded by composer at installation time.

  2. As described below, the package.json file has been modified to include two additional elements compared to the Symfony original project. The first one is the external sf5.2-core dependency. The second one is the autoload configuration that has been modified to include the default generated code location. Indeed, classes with namespace starting with Api will map to src/Api folder and namespace Generated\\Api maps to generated/Api folder.

  3. The last element concerns the containerisation of the application. This aspect is handled by docker with the help of a docker-compose.dev.yml file. 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.

Project structure

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, .docker, generated and 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.


© Code-bay 2021, All rights reserved

When you visit or interact with our sites, services or tools, we use cookies for storing information to help provide you with a better, faster and safer experience. None of these cookies are used for marketing purposes.