The Modulo project.
- Clone the project using
git clone [email protected]:YummYume/modulo.git
- Copy the
.env
file in the root folder and name it.env.local
, override any needed variable (!!if you change the db username and/or password, you also need to change the configuration for the mariadb connection in api/.env!!) - Copy the
docker-compose-dev.yml.dist
in the root folder and name itdocker-compose-dev.yml
, override any needed configuration - Run
make start
- Extra : add
127.0.0.1 modulo.local api.modulo.local admin.modulo.local
in your hosts file - Extra : copy the
api/.php-cs-fixer.dist.php
file and rename it.php-cs-fixer.php
and configure your IDE to use this file with the PHP-CS-Fixer extension - You can now access the different services of Modulo (using
localhost
ormodulo.local
)
- API (Symfony) : 80 (http, redirects to 443) and 443 (https)
- App (React) : 3000 (!!uses https for jwt!!)
- DB (default mariadb port) : 3306
- phpmyadmin : 8080
- Mailcatcher : 1080
make start
: executesmake rm
,make up
,make perm
,make jwt-keypair
,make db-drop
,make yarn-api-compile
andmake sync-dependencies
, in this exact ordermake up
: kills every running container and rebuilds + run them, then executesmake perm
,make composer
andmake jwt-keypair
, in this exact ordermake up-db
: executesmake up
andmake db
, in this exact ordermake stop
: stops and kills every running containermake rm
: remove stopped containersmake down
: stops and removes all containers, networks, volumes and imagesmake db
: creates everything related to the database (including fixtures)make db-drop
: drops the current database and recreates it withmake db
make db-migrate
: execute migrations for the apimake perm
: grants permissions for the api foldersmake ssh-api
:sh
in the api containermake ssh-app
:sh
in the app containermake ssh-nginx
:bash
in the nginx containermake composer
: runscomposer install -n
for the api containermake jwt-keypair
: runsphp bin/console lexik:jwt:generate-keypair
in the api container to generate the jwt keysmake yarn
: runsyarn install
for the app containermake yarn-api
: runsyarn install
for the api containermake yarn-api-compile
: runsmake yarn-api
,make assets-api
andyarn dev
for the api containermake yarn-api-watch
: runsmake yarn-api
,make assets-api
andyarn watch
for the api containermake assets-api
: installs assets for the api containermake composer-sync
: runsmake composer
andmake sync-dependencies-api
, in this exact ordermake yarn-sync
: runsmake yarn
andmake sync-dependencies-app
, in this exact ordermake yarn-api-sync
: runsmake yarn-api
andmake sync-dependencies-yarn-app
, in this exact ordermake cc
: clears cache for the api containermake cl
: clears the nginx logs (the nginx container must be STOPPED to run this command)make php-cs-fixer
: runs php-cs fixer for the src folder of the apimake lint
: runsyarn lint
for the app foldermake analyze
: runsyarn analyze
for the app folder (reports are underapp/.next/analyze
)make sync-dependencies-api
: syncs thevendor
api folder with the hostmake sync-dependencies-app
: syncs thenode_modules
app folder with the hostmake sync-dependencies-yarn-api
: syncs thenode_modules
api folder with the hostmake sync-dependencies
: runsmake sync-dependencies-api
,make sync-dependencies-app
andmake sync-dependencies-yarn-api
, in this exact ordermake cypress
: runsyarn cypress
in the app container (see the Tests section below for more info)make cypress-headless
: runsyarn cypress:headless
in the app container (no GUI)
This is important : To install a yarn
or composer
package, ssh
into the container (make ssh-app
or make ssh-api
) and install it there, then run make sync-dependencies
(or any sync-dependencies
command to sync only the required container)
- Nginx logs are available in nginx/logs
- Use make commands for Windows :
- Install GnuWin32 here
- Add the make.exe (GnuWin32/bin) to your PATH
- If a command does not work, use
make perm
and make sure you are running your cmd as an administrator
- JS : Prettier (using
.prettierrc
config file) and Eslint (using.eslintrc.json
config file)
In case the VScode extension doesn't work properly and throws errors likeParsing error : Cannot find module 'next/babel'
, add the following in yoursettings.json
file :
"eslint.workingDirectories": [ "./app" ]
- PHP : PHP-CS-Fixer (using
api/.php-cs-fixer.php
config file)
- Download VNC Viewer here
- Connect to 127.0.0.1:5920 in VNC Viewer
- Run
make cypress
to launch the Cypress GUI in the VNC Viewer - You can also run
make cypress-headless
for CL tests only (no GUI)
- The website is available at https://www.modulo-scout.fr