Symfony-based application that manages codes - generated random and user-provided. Allows displaying, generating, adding and removing them.
-
Clone the project
$ git clone git@github.com:kniziol/code-generator.git .
-
Generate self-signed SSL certificate
$ cd docker/config/nginx/certificate $ ./generate-certificate.sh your.local.domain
Replace your.local.domain
with the domain that you will be running application.
-
Run Docker Compose to start the project
$ docker compose up -d
If you would like to tweak ports, create
.env.local
file and enter in it some of required environment variables taht you would like to change, e.g.:# # MySQL # MYSQL_ROOT_PASSWORD=root MYSQL_DATABASE=application MYSQL_USER=user MYSQL_PASSWORD=user MYSQL_PORT=3306 MYSQL_PORT_EXTERNAL=3306 # # Nginx # NGINX_PORT=443 NGINX_PORT_EXTERNAL=80
-
Install UI-related packages
$ docker compose exec php yarn
-
Build UI-related assets
$ docker compose exec php yarn dev
-
Create database
$ docker compose run console doctrine:database:create
-
Create database structure
$ docker compose run console doctrine:schema:create
-
(optional) Load data into database (using DataFixtures)
$ docker compose run console hautelook:fixtures:load --no-interaction --purge-with-truncate
-
Database connection
DATABASE_URL=mysql://user:user@db:3306/application?serverVersion=mariadb-10.5.10
-
PHP parameters
PHP_DATE_TIMEZONE=Europe/Warsaw PHP_MEMORY_LIMIT=256M
-
Default and available languages (of the UI):
APP_DEFAULT_LOCALE=en APP_AVAILABLE_LOCALES=en|pl
PHPUnit tests you can run using one of the following commands:
$ docker compose run phpunit -v
// OR
$ docker compose exec php bin/phpunit