Skip to content

stlgaits/snowtricks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnowTricks

Codacy Badge GitHub release (latest by date) GitHub package.json dependency version (prod) GitHub repo size GitHub issues GitHub closed issues GitHub last commit docsify

Symfony blog project. Full documentation for the project is available here

Getting Started

Install via Docker

This project was setup using dunglas/symfony-docker

  1. If not already done, install Docker Compose
  2. Run docker-compose build --pull --no-cache to build fresh images
  3. Run docker-compose up (the logs will be displayed in the current shell)
  4. Open https://localhost in your favorite web browser and accept the auto-generated TLS certificate
  5. Run docker-compose down --remove-orphans to stop the Docker containers.

Building Node.js web assets

Open a shell inside the Node.js container and run the following commands to install & build web assets :

yarn install
yarn build

Loading the initial data (first 10 tricks)

Open a shell inside the NPHP container and run the following commands to load the inital data set :

 php bin/console doctrine:fixtures:load --append

Features of the Docker image

  • Production, development and CI ready
  • Automatic HTTPS (in dev and in prod!)
  • HTTP/2, HTTP/3 and Preload support
  • Built-in Mercure hub
  • Vulcain support
  • PHP FPM and Caddy server

Simple local web server

Downloading the project

If you would like to install this project on your computer, you will first need to clone the repo of this project using Git.

At the root of your projet, you need to create a .env.local file (same level as .env) in which you need to configure the appropriate values for your blog to run. Specifically, you need to override the following variables :

DATABASE_URL="mysql://root:password@localhost:3306/snowtricks"
[email protected]
ADMIN_PASSWORD=ChooseAStrongPersonalPasswordHere
ADMIN_USERNAME=youradminusername

Requirements

  • PHP 8.1.4 or above
  • yarn & Node.js
  • composer
  • Download the Symfony CLI.
  • Run this command will guide you in cases there are missing extensions or parameters you need to tweek on your machine
symfony check:requirements  

Install dependencies

Before running the project, you need to run the following commands in order to install the appropriate dependencies.

composer install

Create a database

Now let's create our database. This will use the DATABASE_URL you've provided in .env.local file.

php bin/console doctrine:database:create

Generating the database schema

 php bin/console doctrine:schema:update --force

Loading the initial data (first 10 tricks, admin user, images & videos)

php bin/console doctrine:fixtures:load --append

Install & build web assets

yarn install
yarn build

Now you should be ready to launch the dev webserver using

symfony serve

The symfony serve command will start a PHP webserver. You can now go to your localhost URL : http://127.0.0.1:8000 where the blog should be displayed.

NB: alternatively, if you do not wish to use the Symfony webserver, you can always use WAMP / Laragon / MAMP or a similar webserver suite.

Credits

Created by Estelle Gaits as the sixth project of the Openclassrooms PHP / Symfony Apps Developer training course.