Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Architectures for huge Angular based enterprise applications @IT-Tage 2018 in Frankfurt

Architectures for huge Angular based enterprise applications @IT-Tage 2018 in Frankfurt

Contains:
- Monorepo
- Micro Apps w/ Hyperlinks
- Micro Apps w/ Shell

# Monorepo Example
https://github.com/manfredsteyer/monorepo-demo

# Micro Apps Example
https://github.com/manfredsteyer/Angular_MicroApps_Different_Technologies

# More Blog-Articles & Angular Trainings
https://www.softwarearchitekt.at

15934fa2aa7b2ce21f091e9b7cffa856?s=128

Manfred Steyer
PRO

December 12, 2018
Tweet

Transcript

  1. @ManfredSteyer Architectures for huge Angular based enterprise applications Manfred Steyer

    SOFTWAREarchitekt.at ManfredSteyer
  2. @ManfredSteyer About me… • Manfred Steyer • SOFTWAREarchitekt.at • Angular

    Trainings and Consultancy • Google Developer Expert (GDE) Page ▪ 2 Manfred Steyer Public: Vienna, München, Stuttgart, Frankfurt In-House: everywhere http://softwarearchitekt.at/workshops
  3. @ManfredSteyer Ever started a project from the scratch? Kick-off After

    some weeks After some years
  4. @ManfredSteyer Contents 1) npm Packages 2) Monorepo 3) Micro Apps

    4) How to choose?
  5. @ManfredSteyer 1) npm Packages

  6. @ManfredSteyer Why Packages? Sub Project Sub Project Sub Project Sub

    Project Sub Project Sub Project Sub Project Sub Project
  7. @ManfredSteyer Structure of an npm Package • /node_modules • your-stuff

    • package.json
  8. @ManfredSteyer Angular Package Format https://goo.gl/hjt7G3

  9. @ManfredSteyer Lots of DETAILS

  10. @ManfredSteyer Angular CLI 6+ supports Packages

  11. @ManfredSteyer Create npm-Packages with CLI >= 6 ng new lib-project

    cd lib-project ng generate library flight-booking-lib ng generate application playground-app ng serve --project playground-app ng build --project flight-booking-lib cd dist/flight-booking-lib npm publish --registry http://...
  12. @ManfredSteyer npm Registries Nexus Artifactory Team Foundation Server Verdaccio npm

    i -g verdaccio verdaccio
  13. @ManfredSteyer Advantages • Distribution • Versioning

  14. @ManfredSteyer Disadvantages • Distribution • Versioning ;-)

  15. @ManfredSteyer Disadvantages Distribution • Annoying within project Versioning • Old

    versions • Conflicts • How to force devs to use latest version?
  16. @ManfredSteyer 2) Monorepos

  17. @ManfredSteyer Workspace

  18. @ManfredSteyer Advantages Everyone uses the latest versions No version conflicts

    No burden with distributing libs Creating new libs: Adding folder Experience: Successfully used at Google, Facebook, …
  19. @ManfredSteyer Moving back and forth Npm Registry

  20. @ManfredSteyer DEMO

  21. @ManfredSteyer Tooling & Generator https://nrwl.io/nx

  22. @ManfredSteyer Visualize Module Structure

  23. @ManfredSteyer Advantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project
  24. @ManfredSteyer Disadvantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project
  25. @ManfredSteyer Disadvantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project Team A Team B Contract Maintainability? One Architecture/ One Framework
  26. @ManfredSteyer 3) Micro Apps

  27. @ManfredSteyer Idea System

  28. @ManfredSteyer Idea µService µService µService

  29. @ManfredSteyer Idea µApp µApp µApp

  30. @ManfredSteyer Advantages No Contracts b/w Apps Separate Development Separate Deployment

    Mixing Technologies Mixing Architectures
  31. @ManfredSteyer UI Composition w/ Hyperlinks µApp SPA µApp SPA µApp

    SPA <a href="…>…</a> <a href="…>…</a>
  32. @ManfredSteyer ✓ Simple  Loosing State  Load a new

    Application
  33. @ManfredSteyer

  34. @ManfredSteyer Web Components for Shared Widgets?

  35. @ManfredSteyer µService Providing a (SPA based) Shell µApp µApp µApp

    Shell
  36. @ManfredSteyer µService Providing a (SPA based) Shell µApp µApp µApp

    Shell ▪ iframes ▪ Bootstrapping several SPAs ▪ Consider Lazy Loading!
  37. @ManfredSteyer Wrap µApps into Web Components • Not a typical

    web component! • But: Unified API for Shell • And: Nesting
  38. @ManfredSteyer DEMO

  39. @ManfredSteyer Advantages • Several small and decoupled Projects • Autarkic

    Teams • Seperate development/ deployment • Own decisions (technology, architecture)
  40. @ManfredSteyer Disadvantages ;-) • Several small and decoupled Projects •

    Autarkic Teams • Seperate development/ deployment • Own decisions (technology, architecture)
  41. @ManfredSteyer Disadvantages ;-) • More Bundles • Less optimized Bundles/

    duplicate Code? • UI Consistency
  42. @ManfredSteyer 4) Choosing a Solution

  43. @ManfredSteyer Some General Advice Shared state, navigation b/w apps Hyperlinks

    Legacy Apps or *very very* strong isolation? iframes Separate Deployment/ mix Technologies? Bootstrap several SPAs Monorepo little much yes no yes no Not a good fit for public web sites
  44. @ManfredSteyer Blog > SOFTWAREarchitekt.at • A Software Architect's Approach Towards

    Using Angular (And SPAs In General) For Microservices Aka Microfrontends • A Lightweight And Solid Approach Towards Micro Frontends (Micro Service Clients) With Angular And/Or Other Frameworks • Micro Apps With Web Components Using Angular Elements
  45. @ManfredSteyer Conclusion Packages: Reuse Monorepo: Structure Micro Apps: Decoupling CLI

    6+ CLI 6+/ Nx Links, iframes, Several SPAs
  46. @ManfredSteyer Beware the Frankenstein- Monster!!

  47. @ManfredSteyer Contact and Downloads [mail] manfred.steyer@SOFTWAREarchitekt.at [web] SOFTWAREarchitekt.at [twitter] ManfredSteyer

    d Slides & Examples