- Install the development app
- Follow the best practice
- How to control your code syntax ?
- About docker images
The development app use docker and docker-compose, before continue to follow the guide, please install these requirements.
-
Fork
Click on the fork button at the top of the page.
-
Clone your repository (after fork)
git clone [email protected]:USERNAME/collection-manager.git
-
Create the upstream remote
cd collection-manager git remote add upstream git://github.com/mpiot/collection-manager.git
-
Some infos, to work with upstream and origin remote
https://symfony.com/doc/current/contributing/code/patches.html
Now, we will configure the application on your machine, there is 2 files that permit it:
-
parameters.yml: configure credential for db, Google ReCaptcha, SMTP credentials, ...
-
docker-compose.override.ym: configure daemon access like the forwarded ports of nginx to access your app, and db ports for debug.
cp /app/parameters.yml.dist /app/parameters.yml vi /app/parameters.yml
cp docker-compose.override.yml.dist docker-compose.override.yml vi docker-compose.override.yml
That's finish in a few time, now, just execute:
make install
And voilà !!! Your app is installed and ready to use.
There is a beautiful guide about the best practice :) You can find it on the Symfony Documentation - Best Practice.
For a better structure of the code, we use Coding standards: PSR-0, PSR-1, PSR-2 and PSR-4. You can found some informations on the synfony documentation page.
In the project you have a php-cs-fixer.phar file, the program's documentation.
Some commands:
- List files with mistakes
make php-cs
- Fix files:
make php-cs-fix
In the project, docker images are automatically generated. There is a .travis-ci.yml file, that execute some test on each PullRequest to validate the code. When the code is merged in the master branch of the project, then it save a new dev image and a dev-{docker-folder-hash}. If we add a tag on a commit, then Travis-Ci generate the prod image and a prod-{TAG} image.
The dev and dev-{docker-folder-hash} are the same image, dev is the latest dev image. And in prod it's the same prod and prod-{TAG} are identical. The prod image are always the latest prod image.
All this images are pushed on the docker hub repository: https://hub.docker.com/r/mapiot/collection-manager/