Initial setup - matul91/meteo-raspi GitHub Wiki

Prerequiresities:

  1. Installed PHP&MySQL server on your machine (for Windows I recommend https://laragon.org/, for OSX https://laravel.com/docs/5.5/valet)
  2. Installed composer (https://getcomposer.org/)
  3. For frontend devs - installed Node.js (https://nodejs.org/en/) and optionally Yarn (better package manager - https://yarnpkg.com/en/)
  4. Installed code editor/IDE

WARNING: New versions of Chrome (63+) are bugged, if you use default configuration of Laragon (.dev domain for virtual domains) they don't display project for some ridiculous reasons. To solve this problem, change default .dev domain to something else (e.g. .test, .loc etc.).

Steps to make project working

  1. Clone repo (via bash - git clone https://github.com/matul91/meteo-raspi.git)
  2. Open CMD in project directory
  3. Run composer install
  4. Create DB
  5. Create file .env in root directory and copy content of .env.example file into this file
  6. Change variables to your settings
  7. Run php artisan migrate:fresh --seed
  8. Run php artisan passport:install --force
  9. Run php artisan set:client_secret .env
  10. Run php artisan key:generate
  11. Run npm install (or yarn)
  12. Run npm run dev (or yarn dev)

Watch files (frontend devs)

  1. To work with TS and SASS files, run yarn watch command (it will watch your files and transpile them into JS and CSS)

Enable linter (frontend devs)

TSLint on your machine:

  1. To run TSLint in WebStorm, go to File > Settings > Languages & Frameworks > TypeScript > TSLint > Check Enable (in VSCode you don't have to do anything, VSCode enables TSLint for you)
  2. To run TSLint via CMD, you have to install Node.js dependencies, then run command ./node_modules/.bin/tslint --project tsconfig.json (with backward slash in Windows), more about running via CMD is here https://palantir.github.io/tslint/usage/cli/

WARNING: There is bug in TSLint, it doesn't report some errors when you're using \r\n line break. So be sure your IDE is set to use LF separator:

Separator

Run tests

  1. Frontend: Run npm run test (or yarn test)
  2. Backend: Run php artisan dusk