ElodieBichet / SnowTricks

Snowboard community site made with Symfony 5.
0 stars 0 forks source link

SnowTricks

Snowboard community site made with Symfony 5. Work carried out as part of the training course "Application Developer - PHP / Symfony" on OpenClassrooms.

Maintainability

Table of Contents

  1. Prerequisite and technologies
  2. Installation

PREREQUISITE AND TECHNOLOGIES

Server

You need a web server with PHP7 (> 7.2.5) and MySQL DBMS.
Versions used in this project:

You also need an access to a SMTP server.

See more information on technical requirements in the Symfony official documentation.

Framework and libraries

Framework: Symfony ^5.2.9 Dependencies manager: Composer ^1.9.3

Libraries included via Composer (used in fixtures):

CSS/JS libraries, included via CDN links:


INSTALLATION

Download or clone

Download zip files or clone the project repository with github (see GitHub documentation).

Configure environment variables

You need to configure at least these lines in .env file:

###> symfony/mailer ###
# MAILER_DSN=smtp://localhost
# MAILER_USER=smtp-user-email-address@domain.com
###< symfony/mailer ###
...
###> doctrine/doctrine-bundle ###
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
...
###> super admin configuration, used in fixtures loading ###
SUPER_ADMIN_EMAIL=your@email.com
SUPER_ADMIN_NAME='FirstName LastName'
SUPER_ADMIN_PASSWORD=yourSecretPassword

Install the project

  1. If needed, install Composer by following the official instructions.
  2. In your cmd, go to the directory where you want to install the project and install dependencies with composer:
    $ cd some\directory
    $ composer install

    Dependencies should be installed in your project (check vendor directory).

Create the database

  1. If the database does not exist, create it with the following command in the project directory:

    $ php bin/console doctrine:database:create
  2. Create database structure thanks to migrations:

    $ php bin/console doctrine:migrations:migrate

    Here is the database model: DB Model

  3. Install fixtures to have first contents and your super admin account (update the fixtures files before if needed):

    $ php bin/console doctrine:fixtures:load

    Your database should be updated with contents.
    Images files in scr/DataFixtures/images repertory should be copied with a new name in public/uploads/pictures directory.

You are ready to use your app!

If you login with your admin username and password, you can access all public pages of the app, and manage registered users or any content.
Loggued in as a registered user (with verified email address), you can manage all tricks and your own messages.
As an simple visitor, you can just see the content.