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

Architectures for huge Angular based enterprise applications

Architectures for huge Angular based enterprise applications

15934fa2aa7b2ce21f091e9b7cffa856?s=128

Manfred Steyer
PRO

February 07, 2019
Tweet

Transcript

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

    SOFTWAREarchitekt.at ManfredSteyer
  2. @ManfredSteyer Ever started a project from the scratch? Kick-off After

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

    4) How to choose?
  4. @ManfredSteyer About me… • Manfred Steyer • SOFTWAREarchitekt.at • Angular

    Trainings and Consultancy • Google Developer Expert (GDE) Page ▪ 4 Manfred Steyer
  5. • Advanced Angular Workshop: Enterprise Applications • Stuttgart March (Early

    Bird until 15. 2.) • Also: München, Frankfurt, Wien, In-House • https://www.softwarearchitect.io/workshops/ Discount Code - 15%: ngStuttgartRocks
  6. @ManfredSteyer 1) npm Packages

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

    Project Sub Project Sub Project Sub Project Sub Project
  8. @ManfredSteyer Angular CLI 6+ supports Packages

  9. @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://...
  10. @ManfredSteyer Advantages • Distribution • Versioning

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

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

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

  14. @ManfredSteyer Workspace

  15. @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, …
  16. @ManfredSteyer Moving back and forth Npm Registry

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

  18. @ManfredSteyer Visualize Module Structure

  19. @ManfredSteyer Advantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project
  20. @ManfredSteyer Disadvantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project
  21. @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
  22. @ManfredSteyer 3) Micro Apps

  23. @ManfredSteyer Idea System

  24. @ManfredSteyer Idea µService µService µService

  25. @ManfredSteyer Idea µApp µApp µApp

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

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

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

    Application
  29. @ManfredSteyer

  30. @ManfredSteyer Web Components for Shared Widgets?

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

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

    Shell ▪ iframes ▪ Bootstrapping several SPAs ▪ Consider Lazy Loading!
  33. @ManfredSteyer DEMO

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

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

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

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

  38. @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
  39. @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
  40. @ManfredSteyer Conclusion Packages: Reuse Monorepo: Structure Micro Apps: Decoupling CLI

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

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

    d Slides & Examples https://www.softwarearchitect.io/workshops/ 15% Discount Code: ngStuttgartRocks