Development - melihovv/grammar_review_tool GitHub Wiki

In order to develop with Hot Module Replacement enabled

  • check that APP_ENV!=production
  • if your hmr server run not on this address http://localhost:8080, you can specify HMR_SERVER variable in .env file
  • npm run dev
  • php artisan serve
  • go to http://localhost:8000.

In order to make commits

  • take overview of commitizen and then do commits by typing git cz

In order to validate commit message you need to setup git hooks

  • node node_modules/husky/bin/install.js (assumed you already yarn or npm install)

Useful commands

  • composer run phpunit Runs phpunit tests.
  • composer run phpcs Checks code according to phpcs-rules.
  • composer run phpcbf Automatically fix code according phpcs-rules.
  • composer run phpmd Checks code according to phpmd-rules
  • php artisan config:env-validator Checks that necessary environment variables are provided in .env file.
  • npm run unit Runs karma tests.
  • npm run lint Runs eslint check according to config.
  • npm run dev Runs dev server with HMR enabled.
  • npm run build Builds client code.

On every push to github repo styleci checks code style (config) and travis (config) runs

  • phpunit tests
  • phpcs check
  • phpmd check
  • karma tests
  • eslint check

Travis builds

Useful routes

  • /logs Log viewer [local only]
  • /api-tester API tester [local only]
  • /routes List of routes [local only]

To run dusk tests:

  • create .env.dusk.testing with the following content
APP_ENV=testing
APP_KEY=app_key
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:8001

DB_CONNECTION="mysql"
DB_HOST="127.0.0.1"
DB_PORT=3306
DB_DATABASE=db_for_testing
DB_USERNAME=root
DB_PASSWORD=

CACHE_DRIVER="file"
SESSION_DRIVER="file"
QUEUE_DRIVER="sync"

MAIL_DRIVER=log

instead of mysql you may want to use sqlite

  • npm run build
  • php artisan serve --env=dusk.testing --port=8001
  • php artisan dusk --env=dusk.testing