Skip to content

jgauthi/poc_symfony5_webpack_bootstrap

Repository files navigation

POC Symfony 5

Prerequisites

  • The PHP version must be greater than or equal to PHP 8.0
  • The SQLite 3 extension must be enabled
  • The JSON extension must be enabled
  • The Ctype extension must be enabled
  • The date.timezone parameter must be defined in php.ini
  • Yarn command line

More information on symfony website.

Features developed

Webpack Encore is a simpler way to integrate Webpack into your application. It wraps Webpack, giving you a clean & powerful API for bundling JavaScript modules, pre-processing CSS & JS and compiling and minifying assets. Encore gives you professional asset system that’s a delight to use.

Encore is inspired by Webpacker and Mix, but stays in the spirit of Webpack: using its features, concepts and naming conventions for a familiar feel. It aims to solve the most common Webpack use cases.

In master branch, this script use Javascript on assets folder. You can switch on typescript branch for this alternative language.

Installation

Command lines:

# clone current repot
composer install

# (optional) Copy and edit configuration values ".env.local"

php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate -n

# Optional
php bin/console doctrine:fixtures:load -n

# Installation Assets
yarn install
run yarn encore dev
#yarn encore production # for production

For the asset symlink install, launch a terminal on administrator in windows environment.

Usage

Just execute this command to run the built-in web server (require symfony installer) and access the application in your browser at http://localhost:8000:

# Dev env
symfony server:start

# Test env
APP_ENV=test php -d variables_order=EGPCS -S 127.0.0.1:8000 -t public/

Alternatively, you can configure a web server like Nginx or Apache to run the application.

Your commit is checked by several dev tools (like phpstan, php cs fixer...). These tools were managed by Grumphp, you can edit configuration on file grumphp.yml or check manually with the command: ./vendor/bin/grumphp run.