Skip to content

Portfolio of Edouard Proust, web developer (PHP , Symfony and Javascript)

Notifications You must be signed in to change notification settings

ithoq/web-dev-portfolio

 
 

Repository files navigation

EP Portfolio

Portfolio of Edouard Proust, web developer (PHP , Symfony and Javascript) v.1.0: march 2022

This project is developped on GitLab: https://gitlab.com/solo-projects3/ep-portfolio.git

👉 Live demo

image image image image


Technologies & Requirements

  • PHP 7.4
  • Symfony 5
  • Symfony CLI
  • Composer
  • Docker
  • Docker-compose
  • NodeJS
symfony check:requirements

Development

composer install
npm install
npm run dev
docker-compose up -d
symfony serve -d

If database not set up yet;

symfony console make:migration -n
symfony console d:m:m -n
symfony console d:f:l --group=dev -n

Production

1. Run these commands (connect to ssh and clone directory):

ssh deploy@<host>
git clone https://gitlab.com/<directory> .
  • Replace by the host IP address (eg. 168.38.144.76)
  • Replace by the direMy portfolio featuring my projects as a web developer.ctory slug (eg. /my-folder/my-project)
  • For cloning from gitLab, use this command: git clone https://gitlab.com/<directory>

2. Create an .env.local containing these keys:

APP_ENV=prod
MAILER_DSN=smtp:https://<dsn_host>
DATABASE_URL="mysql:https://<db_user>:<db_password>@<db_host>/<db_name>"

Don't precise "serverVersion" attribute in DATABASE_URL or this error may be fired: "The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue".

3. Connect to server using SSH and run these commands:

composer install
npm install
npm run dev

On first deployment only (database not set up yet);

symfony console make:migration -n
symfony console d:m:m -n
symfony console d:f:l --group=prod -n

4. Create your admin account:

php bin/console app:create:admin <username> <password>

Config: misc.

  • Add or Edit a global dir or file path to be used anywhere in the project: Add or Edit a const in Path.php and then call it where you need: Path::MY_PATH
  • Add or Edit a global config value to be used anywhere in the project: Add or Edit a const in Config.php and then call it where you need: Config::MY_VALUE
  • Add an new option (AdminOption) in Admin dahsboard: Add a new const in src/DataFixtures/AdminOptions.php
  • Change fixtures default values: Edit const in src/DataFixtures/AppFixtures.php

Config: CKEditor

  • Reorder toolbar: update Editor.defaultConfig() function in assets/ckeditor/builds/{build_name}/src/ckeditor.js

  • Add plugins and features:

    • Download package on NPM
    • Run this command: npm i @ckeditor5/ckeditor5-<plugin_name>
    • Add this line after other import statements on the top of assets/ckeditor/builds/{build-name}/src/ckeditor.js : `import from '@ckeditor/ckeditor5-/src/.js';
  • Add a build:

    • Configure and download package here
    • Unzip it in assets/ckeditor/builds/{build-name}
    • In assets/js/admin/ckeditor.js, update the first line: import ClassicEditor from '../../../public/build/ckeditor/builds/<build-name>/src/ckeditor';

/!\ After any of the above actions:

  1. update Editor.defaultConfig() function in assets/ckeditor/builds/{build-name}/src/ckeditor.js
  2. Run these commands:
npm run build
npm run dev

Usefull commands

Build Encore assets on save:

npm run watch

About

Portfolio of Edouard Proust, web developer (PHP , Symfony and Javascript)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 59.2%
  • PHP 15.3%
  • HTML 10.0%
  • Twig 8.7%
  • SCSS 6.7%
  • Shell 0.1%