Directory management application of the organization La Fabrique Opéra Val de Loire under Apache 2.0 license.
The project is maintained under Symfony Frameworks and is using Php as back-end main language.
Front-end is maintained with npm modules as gulp-sass, bootstrap and jquery. Html templates are using Twig.
The project handle a Docker configuration made for a 4 containers stack :
- web : Nginx container
port : 80
image : debian:stretch
Handle Http requests through Nginx web reverse proxy
- php : Php-fpm container
port : 9000
image : php:7.4-fpm
Handle php backend scripts execution. Serve Nginx on port 9000.
- mysqldb : MariaDB MySQL Database
port : 3306
image : mariadb
Handle relational type data through Doctrine component.
- mongodb : MongoDB NoSQL Database
port : 27017
image : mongo:latest
Handle collection/document type data through custom Data management system.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
-
LIRE LA DOCUMENTATION dans le dossier /fabop-directory/doc-fab-op/docs-2020
-
LIRE LA DOCUMENTATION dans le dossier /fabop-directory/doc-fab-op/docs-2020
-
LIRE LA DOCUMENTATION dans le dossier /fabop-directory/doc-fab-op/docs-2020
-
Install nodejs and yarn.
apt-get install nodejs npm
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install yarn
-
Docker dependencies
Ubuntu : https://docs.docker.com/install/linux/docker-ce/ubuntu/
Debian : https://docs.docker.com/install/linux/docker-ce/debian/
Fedora : https://docs.docker.com/install/linux/docker-ce/fedora/
CentOS : https://docs.docker.com/install/linux/docker-ce/centos/
Windows : https://docs.docker.com/docker-for-windows/install/
-
Install git for being able to clone the project, make commits and push, etc...
apt-get install git
-
First, you need to clone the project and install yarn dependencies
git clone https://tuleap.fiction-factory.fr/plugins/git/fabop/fabop-directory.git
cd fabop-directory/app
yarn install
-
Then, When cloning is complete :
yarn run gulp styles
yarn run gulp js
yarn run gulp fa
yarn run gulp animations
yarn run gulp images
yarn run gulp fonts
-
Edit app/.env and set
APP_ENV
todev
-
Set DB passwords in
docker-compose.yml
and copy them intoapp/.env
by replacing<SET PASSWORD HERE>
placeholders. Set also mongodb password inbuild/mongodb/mongo-init.js
. -
Now, build docker images and start it :
docker-compose build
(may take few minutes)docker-compose up
Use
docker-compose start/stop
to manage containers (or any GUI Docker containers manager) -
Install composer dependencies by your php container :
docker exec <php container | fabop-directory_php_1> composer install
docker exec <php container | fabop-directory_php_1> chown -R :www-data /var/www
-
Make db migrations by using following commands :
docker-compose exec php bin/console make:migration
docker-compose exec php bin/console doctrine:migrations:migrate
-
If you need to enter containers terminal :
docker exec -it <mycontainer> bash
-
Build the app svelte:
yarn encore dev
-
Get your user root (mail : [email protected] | mdp : root) :
docker-compose exec php bin/console doctrine:fixtures:load
-
To get your ip container :
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <Container Name >
-
Your app is active and you can see your project at localhost:80 or your web container ip.
-
Fix right of your folders to import/export:
docker-compose exec php chown -R :www-data /var/www
docker-compose exec php chmod 775 /var/www/html/symfony/public
1.1. Make sure you have php7.4, composer and mongodb installed :
Install PHP 7.4
apt-get update
apt-get install php-cli
apt-get install php-curl php-gd php-intl php-json php-mbstring php-xml php-zip php-mysql php-mongodb
Install composer
apt install composer
1.2. First, you need to clone the project and install dependencies with following command lines :
`git clone https://tuleap.fiction-factory.fr/plugins/git/fabop/fabop-directory.git`
`cd fabop-directory/app`
`git checkout develop`
`yarn install`
`composer install`
-
Then, When cloning is complete, replace in app/assets/js/scripts.js every
localhost
bylocalhost:8000
and run gulp routines to make front-end and back-end working.
yarn run gulp styles
yarn run gulp js
yarn run gulp fa
yarn run gulp animations
yarn run gulp images
yarn run gulp fonts
-
Edit app/.env and set
APP_ENV
todev
-
Replace
DATABASE_URL="mysql://app_access:<SET PASSWORD HERE>@mysqldb:3306/fabop_directory"
byDATABASE_URL="mysql://[VOTRE LOGIN]:[VOTRE LOGIN]@servinfo-mariadb:3306/sf[VOTRE LOGIN]"
Note : Remplace [VOTRE LOGIN] by your session login
MONGODB_URL=mongodb://app_access:<SET PASSWORD HERE>@mongodb:27017/fabop_directory
byMONGODB_URL="mongodb://localhost:27017"
Warning : Do not forget the quotation marks
-
Now, you can run migrations
php bin/console make:migration
If you have a warning, don't care about it, continue.
php bin/console doctrine:migrations:migrate
Note : Answer
y
to the question :WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)
-
Build the app svelte:
yarn encore dev
-
Finally, you can start the project
php bin/console server:start
-
Test mongodb manager (custom data retriever) :
You can run tests with :
php ./bin/phpunit tests/MongoManagerTest.php --testdox
OR
php ./bin/phpunit tests/MongoManagerTest.php
if you want to check details and errors.Those tests may not pass if some database's data are not precisely set.
docker-compose exec php bin/console doctrine:fixtures:load
Edit .env file :
MAIL_TRANSPORT_TYPE=smtp
MAIL_ENCRYPTION=ssl
MAIL_AUTHMODE=login
MAIL_HOST=ssl0.ovh.net
[email protected]
MAIL_PASSWORD=Lf0VdL2019#
Will come later
-
Php 7.4.3
-
JavaScript
-
Twig
-
Symfony 4.4.5 - The web framework used (PHP)
-
npm/yarn - Dependency Management
-
Bootstrap 4 - CSS framework
-
jquery - JS framework
-
fontawesome - Icons font
-
Docker - Containers
-
MariaDB - MySQL Database
-
MongoDB - NoSQL Database