Sophikitis / sf4.4-website-skeleton-starter

:rocket: A simple Symfony 4.4 website-skeleton with some features such as WebpackEncore, TimeContinuum, User Auth and so on.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sf4.4-website-skeleton-starter

I created a starter kit for Symfony 4.4 (LTS), based on the website-skeleton provided by Symfony itself, to show how to use WebpackEncore, TimeContinuum, User Auth and so on (such as fixtures by Faker, guardAuthenticator, security:checker, unit and functional tests, Q&A tools, translations, commands ...), following the recommended SensioLabs best practices. User auth is based on Symfony form login authentication.

This repository is useful for beginners.

Installation instructions

Project requirements

Project view

Alt text

Installation

1 . Clone the current repository.

2 . Move in and create few .env.{environment}.local files, according to your environments with your default configuration or only one global .env.local. This one is not committed to the shared repository.

.env equals to the last .env.dist file before november 2018.

3 .a. Execute commands below into your working folder to install the project :

$ composer install
$ composer update
$ yarn install
$ yarn run dev
$ bin/console doctrine:database:create
$ bin/console doctrine:migration:migrate
$ bin/console doctrine:migration:secure

3 .b. Or just set your DATABASE_URL and call the Makefile's install rule :

$ make install

The project's Makefile has few rules which could be very useful. In fact, you have some rules for Q&A tools and unit/functional tests. Take a look on it !

Usage

$ symfony serve --no-tls

The web server bundle is no longer used anymore. Use the Symfony binary now.

For loading User's fixture (fixture based on default locale) :

$ bin/console doctrine:fixture:load

For translation to XLIFF files (app_locales: ['fr', '%locale%']) :

$ bin/console translation:update --output-format xlf --dump-messages --force en
$ bin/console translation:update --output-format xlf --dump-messages --force fr

To use PHP CodeSniffer (for more PHPDocumentor usage, see official [https://docs.phpdoc.org/]):

$ ./vendor/bin/phpcbf src/[FILE]
$ ./vendor/bin/phpcs src/[FILE]

To see all available routes :

$ bin/console debug:router

To see all services

$ bin/console debug:container

User

Current User entity has some fields that are required or not. Feel free to change it according to your logic, such as adding canonical fields, salt, lastLogin and others :

$ bin/console make:entity
$ User

And do not forget to update your User's fixture :

$ bin/console doctrine:fixture:load

Personal commands

To use a personal command (displaying all users from DB) :

$ bin/console app:list-users --help
$ bin/console app:list-users

Feel free to create other commands such as a promotion command or a user creation ...

Contributing

Do not hesitate to improve this repository, by creating your PR on GitHub with a description which explains it.

Ask your question on gaetan.role-dubruille@sensiolabs.com.

About

:rocket: A simple Symfony 4.4 website-skeleton with some features such as WebpackEncore, TimeContinuum, User Auth and so on.

License:MIT License


Languages

Language:PHP 56.6%Language:HTML 23.3%Language:Makefile 9.9%Language:CSS 6.8%Language:JavaScript 2.7%Language:Gherkin 0.6%