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

Micro Frontends for Java Microservices - dev2ne...

Micro Frontends for Java Microservices - dev2next 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, as well as 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

October 01, 2024
Tweet

More Decks by Matt Raible

Other Decks in Programming

Transcript

  1. @mraible Hi, I’m Matt Raible Father, Husband, Skier, Mountain Biker,

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

    with JHipster Introduction to Micro Frontends Live Demo Action!
  3. “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
  4. 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 🍃
  5. 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); }
  6. 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); } } ); }
  7. Thriving OSS Project Started by Julien Dubois on October 21,

    2013 App Generator, Platform, Learning Tool, ChatGPT Trainer…
  8. 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
  9. Monolith, Gateway, or Microservice? Spring MVC or Spring WebFlux? Authentication

    Type? Database Type? Build Tool? Web Framework? JHipster Provides Choose Your Own Adventure 🪄
  10. Demo Create apps with JDL Run apps and e2e tests

    Show developer experience Build and run with Docker @mraible/jhipster-micro-frontends 🤓
  11. What’s Next for JHipster? More ❤ for Close follower of

    Spring Boot and Spring Cloud releases GraphQL?
  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