[KON-19,20] codereview, unittests

Signed-off-by: Dimitrios Chalepakis <dimitrios.chalepakis@pta.de>
12 files changed
tree: 08eb43a891751b8a4b63cc95e73110ead3d05f5e
  1. config/
  2. e2e/
  3. hooks/
  4. i18n/
  5. src/
  6. .editorconfig
  7. .gitignore
  8. .prettierrc
  9. angular.json
  10. browserslist
  11. CONTRIBUTING.md
  12. Dockerfile
  13. favicon.ico
  14. index.html
  15. karma.conf.js
  16. LICENSE.md
  17. NOTICE.md
  18. package-lock.json
  19. package.json
  20. protractor.conf.js
  21. proxy-docker.conf.json
  22. proxy.conf-integration.json
  23. proxy.conf.json
  24. README.md
  25. sonar-project.properties
  26. sw-precache-config.js
  27. tsconfig.json
  28. tslint.json
  29. yarn.lock
README.md

Angular architecture patterns

This application represents a demo project for Angular architecture patterns blog series at http://netmedia.io. Frontend app is generated with Angular CLI. It uses it's own local dev server on http://localhost:4200/.

Run Development

Run npm run start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. The command will run custom hooks which will set environment to development and merge all i18n files needed for multi language support. The application uses proxy file to connect with the API. Proxy settings are defined in proxy.conf.json

Build for production

Run npm run sy-build to build the application for production which includes tree shaking, AOT and other cool stuff for minification. This command is defined in package.json file under the scripts section and includes regular Angular CLI build command, custom made hooks and generation of service worker file.

When application is built for production it's copied in /dist folder which is the public folder for Angular CLI.

Hooks

Hooks are located in /hooks folder and they are responsible for merging and copying configuration and localization files for development and production.

Note

Copying files is not necessary on angular-cli v1.0.4 and above because it has built in login for this action. You just need to specify which files/folders need to be copied into your destination folder (default dist) and you can do that in .angular-cli.json file by specifing the assets array:

"assets": [
  "assets",
  "favicon.ico",
  "service-worker.js",
  { "glob": "**/*", "input": "../config", "output": "./config/" },
  { "glob": "en.json", "input": "../i18n", "output": "./i18n/" },
  { "glob": "de.json", "input": "../i18n", "output": "./i18n/" }
]