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

Architectures for huge Angular based enterprise applications @Angular Connect 2018 in London

15934fa2aa7b2ce21f091e9b7cffa856?s=47 Manfred Steyer
PRO
November 08, 2018
600

Architectures for huge Angular based enterprise applications @Angular Connect 2018 in London

15934fa2aa7b2ce21f091e9b7cffa856?s=128

Manfred Steyer
PRO

November 08, 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
  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 Angular CLI 6+ supports Packages

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

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

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

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

  13. @ManfredSteyer Workspace

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

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

  17. @ManfredSteyer Visualize Module Structure

  18. @ManfredSteyer Advantages Sub Project Sub Project Sub Project Sub Project

    Sub Project Sub Project Sub Project Sub Project
  19. @ManfredSteyer Disadvantages 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 Team A Team B Contract Maintainability? One Architecture/ One Framework
  21. @ManfredSteyer 3) Micro Apps

  22. @ManfredSteyer Idea System

  23. @ManfredSteyer Idea µService µService µService

  24. @ManfredSteyer Idea µApp µApp µApp

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

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

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

    Application
  28. @ManfredSteyer

  29. @ManfredSteyer Web Components for Shared Widgets?

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

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

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

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

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

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

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

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

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

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

    d Slides & Examples