dashboard/README.md
2019-08-12 16:34:18 +03:00

1.8 KiB

Dashboard

Libraries

  • Angular CLI
    • 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).
    • To get more help use ng help or go check out the Angular CLI README.
  • Angular Material
  • Prettier

Initialization

# Install packages

npm ci

# Generate swagger API Angular modules

npm run codegen

Development server

  1. Run npm start
  2. Navigate to http://localhost:8000/

Production build

  1. Run npm run build
  2. The build artifacts will be stored in the dist/ directory.

Add API

  1. Add submodule

    git submodule -b <SCHEME_BRANCH> add <SCHEME_REPO> schemes/<SCHEME_NAME>/<VER:VX>
    
  2. Add submodule directory (schemes/<SCHEME_NAME>/<VER:VX>) to Makefile SWAGGER_SCHEMES_PATH

  3. Generate swagger API Angular modules

  4. Update config.json and stub-config.json

  5. Add src/api/<SCHEME_NAME>:

    • index.ts
    • <SCHEME_NAME>.module.ts
    • <SCHEME_NAME>-config.service.ts

Tests

  • Run npm run test to execute the unit tests via Karma.
  • Run npm run e2e to execute the end-to-end tests via Protractor.

Utils

Analyze bundle size

npm run build -- --prod --stats-json --extraWebpackConfig webpack.extra.js
npx webpack-bundle-analyzer dist/stats.json

Guides