$30 off During Our Annual Pro Sale. View Details »

Micro Frontends for Java Microservices - Devnex...

Micro Frontends for Java Microservices - Devnexus 2024

You've figured out how to split up your backend services into microservices and scale your teams to the moon, right?

But what about the front end? Are you still building monoliths for your UI?

If so, you might want to check out micro frontends—basically extensions to the microservices pattern, where the concept is extended to the front end.

Find out how to package and deploy your microservices and their UIs in the same artifact and make it possible to test and develop them independently.

In this live session, Matt will show you how to build a microservices and micro frontends architecture using React, Spring Boot, and Spring Cloud.

GitHub repo: https://github.com/mraible/jhipster-micro-frontends
Demo script: @mraible/jhipster-micro-frontends/blob/main/demo.adoc

Matt Raible

April 11, 2024
Tweet

More Decks by Matt Raible

Other Decks in Programming

Transcript

  1. Micro Frontends for Java Microservices April 11, 2024 Matt Raible

    | @mraible Photo by David Kosmos Smith - https://flic.kr/p/bUHkEa
  2. @mraible Hi, I’m Matt Raible Father, Husband, Skier, Mountain Biker,

    Whitewater Rafter Bus Lover Web Developer and Java Champion JHipster Enthusiast Blogger on raibledesigns.com @mraible
  3. Agenda A brief history of microservices Microservices with Java Microservices

    with JHipster Introduction to Micro Frontends Live Demo Action!
  4. “Any organization that designs a system (defined broadly) will produce

    a design whose structure is a copy of the organization's communication structure.” Conway’s Law Melvin Conway 1967
  5. Spring History of Spring October 2002 - Rod Johnson writes

    J2EE Design & Development 2004 - Spring 1.0 2006 - Spring 2.0 with better XML 2009 - JavaConfig 2014 - Spring Boot 1.0 2015 - Spring Cloud 1.0 🍃
  6. Spring MVC Code @PostMapping("/points") public ResponseEntity<Points> createPoints(@Valid @RequestBody Points points)

    throws URISyntaxException { log.debug("REST request to save Points : {}", points); if (points.getId() != null) { throw new BadRequestAlertException("A new points cannot already have an ID", ENTITY_NAME, "idexists"); } Points result = pointsRepository.save(points); pointsSearchRepository.save(result); return ResponseEntity .created(new URI("/api/points/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert( applicationName, true, ENTITY_NAME, result.getId().toString())) .body(result); }
  7. Spring WebFlux Code @PostMapping("/points") public Mono<ResponseEntity<Points>> createPoints(@Valid @RequestBody Points points)

    throws URISyntaxException { log.debug("REST request to save Points : {}", points); if (points.getId() != null) { throw new BadRequestAlertException("A new points cannot already have an ID", ENTITY_NAME, "idexists"); } return pointsRepository .save(points) .flatMap(pointsSearchRepository::save) .map( result -> { try { return ResponseEntity .created(new URI("/api/points/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert( applicationName, true, ENTITY_NAME, result.getId().toString())) .body(result); } catch (URISyntaxException e) { throw new RuntimeException(e); } } ); }
  8. Thriving OSS Project Started by Julien Dubois on October 21,

    2013 App Generator, Platform, Learning Tool …
  9. How to Use JHipster Install JHipster using npm: npm install

    -g generator-jhipster Create a directory and cd into it: take app Run it! jhipster
  10. Monolith, Gateway, or Microservices? Spring MVC or Spring WebFlux? Authentication

    Type? Database Type? Build Tool? Web Framework? JHipster Options
  11. Demo Create apps with JDL Run apps and e2e tests

    Show developer experience Build and run with Docker @mraible/jhipster-micro-frontends 🤓
  12. The JHipster Mini-Book Written with Asciidoctor Free download from InfoQ:

    infoq.com/minibooks/jhipster-mini-book Quick and to the point, 158 pages Developed a real-world app: www.21-points.com Buy for $20 or download for FREE
  13. The Angular Mini-Book Written with Asciidoctor Free download from InfoQ:

    infoq.com/minibooks/angular-mini-book Angular 15 and Spring Boot 3.0 Angular Material, Bootstrap, Kotlin Spring Security and best practices Deploy separate apps and a single artifact