From d05e19f7730b10bbac2bd90faa4538ed4f233892 Mon Sep 17 00:00:00 2001 From: Quentin Roques Date: Tue, 18 Apr 2023 19:47:24 +0200 Subject: [PATCH] docs: update readme (#53) --- .editorconfig | 17 +++++++++++++++++ Makefile | 7 +++++-- README.md | 41 ++++++++++++++++++++++++++++++----------- 3 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..129cf82 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{php,js}] +block_comment_start = /** +block_comment = * +block_comment_end = */ + +[Makefile] +indent_style = tab diff --git a/Makefile b/Makefile index 46ecfa2..c6dc7e1 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,11 @@ database-create: .PHONY: database-drop database-drop: - docker-compose run --rm php bin/console doctrine:database:drop --force + docker-compose run --rm php bin/console doctrine:database:drop --if-exists --force .PHONY: fixtures-load fixtures-load: - docker-compose run --rm php bin/console doctrine:fixtures:load \ No newline at end of file + docker-compose run --rm php bin/console doctrine:fixtures:load + +.PHONY: reset-db +reset-db: database-drop database-create database-migrate fixtures-load diff --git a/README.md b/README.md index 796d292..544647f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # Symfony Training +This is the boilerplate project for KNP Labs Symfony training. + +## Requirements + +To run this project with docker you will need: + +- [Docker](https://docs.docker.com/get-docker/) +- [Docker Compose](https://docs.docker.com/compose/) + ## Installation ```bash @@ -8,7 +17,7 @@ make start ### Migrations -One the stack has started, you may apply Doctrine migrations once MySQL is ready. +Once the stack has started, you may apply Doctrine migrations: ```bash make database-create @@ -17,15 +26,25 @@ make database-migrate You can now access the application on [localhost](http://127.0.0.1/login). +### Fixtures + +For most of trainings, you will need some fixtures to be loaded. To do so, run: + +```bash +make fixtures-load +``` + +At this point, you should be able to log in and access the application (Email: `admin@mail.com`, Password: `admin`) + ## Commands -| Commands | Description | -|----------------- |-----------------------------------| -| start | Setup and start the stack | -| cp-env | Copie default .env if none exists | -| build | Build Docker's container | -| install-deps | Install Composer dependencies | -| database-create | Create database if none exists | -| database-drop | Drop database | -| database-migrate | Run Doctrine migrations | -| fixtures-load | Load fixtures | +| Commands | Description | +|------------------|-----------------------------------| +| start | Setup and start the stack | +| cp-env | Copie default .env if none exists | +| build | Build Docker's container | +| install-deps | Install Composer dependencies | +| database-create | Create database if none exists | +| database-drop | Drop database | +| database-migrate | Run Doctrine migrations | +| fixtures-load | Load fixtures |