Skip to content

JeremyGendre/devctionnary

Repository files navigation

DEVCTIONNARY

GitHub Super-Linter GitHub Super-Linter

Setup

Requirements :

  • yarn / npm installed

  • composer installed

  • PHP >= 7.2.5 installed

  • To properly apply the git conventionnal commits, use npm install command to install the commitizen commit helper

  • Then, when you want to commit changes, instead of using git commit, use git cz and follow the instructions.

WEB (front)

Move into the /web/devctionnary-front directory and run npm install. Then run ng serve to run the development server and browse through the application.

DevctionnaryFront

This project was generated with Angular CLI version 10.2.0.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

API (back)

optionally :

  • install the make program in order to just have a single command to execute and setup the project.
  • install the symfony client to make development easier and faster.

Then, duplicate the .env file and create a .env.local file that you can override in order to fill in the right information about the database and so on.

Database : MySQL. Please, make sure to uncomment the DATABASE_URL line in your .env.local (with 'mysql' in it) and fill the right informations.

Commands

Move to the /api directory and run :

  • composer install
  • php bin/console doctrine:database:drop --if-exists --force
  • php bin/console doctrine:database:create
  • php bin/console doctrine:schema:update --force or php bin/console doctrine:migrations:migrate
  • php bin/console cache:clear
  • Optionnaly, run php bin/console doctrine:fixtures:load --append
  • symfony serve to start the php development server OR php -S localhost:8000

Now, in order to properly use the authentication service, you'll need to generate a ssl key pair. After composer install, you need to do php bin/console lexik:jwt:generate-keypair

If that doesn't work, check this tutorial. /!\ Before using the commands to generate the keys, make sure to be in this directory : /api/config/jwt. Or specify it directly into the command line.

OR If you have make installed on your computer :

  • make install or make install-dataset. Then :
  • symfony serve to start the php development server

Tests

First, make sure to be in the /api directory. Also, in order to run the back-end tests properly, make sure to setup the projet as explained above.

You can now run tests, with 2 choices of command lines:

  • php bin/phpunit to run all back-end tests
  • php bin/phpunit --testsuite functional to only run the 'Functional' tests