Slide 1

Slide 1 text

Matt Raible and Dennis Sharpe | @mraible, @sharpedennis The Ultimate JHipster Workshop December 3, 2019 Photo by Chris McClanahan flickr.com/photos/mcclanahoochie/7299393890

Slide 2

Slide 2 text

Blogger on raibledesigns.com and developer.okta.com/blog Web Developer and Java Champion Father, Skier, Mountain Biker, Whitewater Rafter Open Source Developer + User Who is Matt Raible? Bus Lover Okta Developer Advocate

Slide 3

Slide 3 text

developer.okta.com

Slide 4

Slide 4 text

Who is Dennis Sharpe? Chief Technology Officer - Ippon USA JHipster Fan Worked with Julien Dubois (JHipster creator and lead developer) @SharpeDennis

Slide 5

Slide 5 text

https://en.ippon.tech

Slide 6

Slide 6 text

What about YOU? Are you a Java Developer? Web Developer? How long have you been doing web development? Do you like Spring? Java/Jakarta EE? Do you like JavaScript? TypeScript?

Slide 7

Slide 7 text

Do you want to be a hip Java Developer?

Slide 8

Slide 8 text

Java 8 Parallel Collections JSR 310 Date and Time API Functional Interfaces with default method Lambda Expressions (a.k.a. Closures) Nashorn JavaScript Engine

Slide 9

Slide 9 text

Java 11 New String Methods File Utility Methods Local Variable Syntax: var Java EE and CORBA modules removed What about Java 12?

Slide 10

Slide 10 text

Hipster n. noun 1. One who is exceptionally aware of or interested in the latest trends and tastes.

Slide 11

Slide 11 text

Latest trends in JavaLand? Microservices Embedded App Servers Deployment with Containers Environments: dev, test, production Auto-Configuration Reactive

Slide 12

Slide 12 text

Spring Boot Automatically configures Spring whenever possible Provides production-ready features such as metrics, health checks and externalized configuration Absolutely no code generation and no requirement for XML configuration Embeds Tomcat, Jetty or Undertow directly

Slide 13

Slide 13 text

SPRING INITIALIZR @ start.spring.io

Slide 14

Slide 14 text

@SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } @Entity class Blog { @Id @GeneratedValue private Long id; private String name; // getters, setters, toString(), etc } @RepositoryRestResource interface BlogRepository extends JpaRepository { }

Slide 15

Slide 15 text

@SpringBootApplication class NotesApplication fun main(args: Array) { SpringApplication.run(NotesApplication::class.java, *args) } @Entity data class Note(@Id @GeneratedValue var id: Long? = null, var text: String? = null, @JsonIgnore var user: String? = null) @RepositoryRestResource interface NotesRepository : JpaRepository

Slide 16

Slide 16 text

Latest Trends in Web Development? Progressive Web Applications JavaScript MVC Frameworks Front-End Optimization REST and GraphQL APIs CSS Grid Micro Frontends

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Hot Frameworks hotframeworks.com

Slide 20

Slide 20 text

Hot Frameworks hotframeworks.com

Slide 21

Slide 21 text

Jobs on Indeed (US) November 2019 0 3,000 6,000 9,000 12,000 React Angular Vue Vanilla

Slide 22

Slide 22 text

Stack Overflow Tags November 2019 0 50,000 100,000 150,000 200,000 React Angular Vue

Slide 23

Slide 23 text

GitHub Stars November 2019 0 40,000 80,000 120,000 160,000 React Angular Vue

Slide 24

Slide 24 text

Wouldn’t it be hip if…? ⚭

Slide 25

Slide 25 text

@spring_io #springio17 JHipster jhipster.tech JHipster is a development platform to generate, develop and deploy Spring Boot + Angular/React Web applications and Spring microservices. and Vue! ✨

Slide 26

Slide 26 text

JHipster is Inclusive https://github.com/jhipster/jhipster-artwork

Slide 27

Slide 27 text

JHipster is Open Source Web Statistics, October 2019 376K Page Views / 653K on GitHub 121K Downloads GitHub Statistics 15K Stars 530 Contributors

Slide 28

Slide 28 text

JHipster Foundations Spring Boot Spring Security Angular or React Bootstrap Micrometer Maven or Gradle Authentication Type: cookie- based, JWT, or OAuth 2.0 / OIDC Type of Database: SQL or NoSQL Caching: EhCache or Hazelcast Elasticsearch Frameworks Project Options

Slide 29

Slide 29 text

How to use JHipster To install JHipster and Yeoman, use npm: npm install -g generator-jhipster Then create a directory and cd into it: mkdir myapp && cd myapp Then run JHipster: jhipster

Slide 30

Slide 30 text

Progressive Web Apps Originate from a secure origin, load while offline, and reference a web app manifest.

Slide 31

Slide 31 text

Progressive Web Apps Can be installed on your mobile device, look and act like a native application, but are distributed through the web.

Slide 32

Slide 32 text

Progressive Web Apps Are fast!

Slide 33

Slide 33 text

Enable PWA in JHipster if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register('/service-worker.js') .then(function () { console.log('Service Worker Registered'); }); }); } src/main/webapp/index.html

Slide 34

Slide 34 text

Force HTTPS in Spring Boot src/main/java/com/okta/developer/demo/config/SecurityConfiguration.java @Configuration public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.requiresChannel() .requestMatchers(r -> r.getHeader("X-Forwarded-Proto") != null) .requiresSecure(); } } https://developer.okta.com/blog/2018/07/30/10-ways-to-secure-spring-boot

Slide 35

Slide 35 text

Demo Time! Generate a basic blog application Look at its files and configuration Generate the CRUD entities Limit blogs to current user, allow HTML Deploy to … all in 20 minutes!

Slide 36

Slide 36 text

Demo Entity Diagram

Slide 37

Slide 37 text

Get Started with JHipster 6 Demo https://github.com/mraible/jhipster6-demo | https://youtu.be/uQqlO3IGpTU

Slide 38

Slide 38 text

JHipster 6 with OIDC Authentication http://bit.ly/jhipster-oidc

Slide 39

Slide 39 text

OAuth 2.0 and OpenID Connect OpenID Connect OAuth 2.0 HTTP OpenID Connect is for authentication OAuth 2.0 is for authorization

Slide 40

Slide 40 text

Lab 1: Create an Angular PWA https://bit.ly/jhipster6-demo

Slide 41

Slide 41 text

Workshop Cheat Sheet https://bit.ly/jhipster-workshop

Slide 42

Slide 42 text

Matt Raible and Dennis Sharpe | @mraible, @sharpedennis Part 2: Microservices with JHipster December 3, 2019 Photo by Kim Seng flickr.com/photos/captainkimo/12484026584

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

Microservices Visionaries

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

“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

Slide 47

Slide 47 text

“Do one thing and do it well.”

Slide 48

Slide 48 text

“You shouldn't start with a microservices architecture. Instead begin with a monolith, keep it modular, and split it into microservices once the monolith becomes a problem.” Martin Fowler March 2014

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

What is JHipster? + =

Slide 51

Slide 51 text

JHipster jhipster.tech JHipster is a development platform to generate, develop and deploy Spring Boot + Angular/React Web applications and Spring microservices. and Vue! ✨

Slide 52

Slide 52 text

JHipster is Inclusive https://github.com/jhipster/jhipster-artwork

Slide 53

Slide 53 text

A powerful workflow to build your application with webpack and Maven/Gradle JHipster Goals A sleek, modern, mobile-first frontend with modern frameworks A high-performance and robust Java stack on the server side with Spring Boot A robust microservice architecture with JHipster Registry, Netflix OSS, Elastic Stack, and Docker

Slide 54

Slide 54 text

How to Use JHipster Install JHipster and Yeoman, using npm: npm install -g generator-jhipster Create a directory and cd into it: mkdir newapp && cd newapp Run it! jhipster

Slide 55

Slide 55 text

Microservices with JHipster

Slide 56

Slide 56 text

Demo Using start.spring.io, create: A service registry A gateway A catalog service Create an endpoint in the catalog service Create a filtered endpoint in the gateway Show failover capabilities Show Spring Security OAuth https://github.com/oktadeveloper/java- microservices-examples

Slide 57

Slide 57 text

Java Microservices with Spring Boot and Spring Cloud https://developer.okta.com/blog/2019/05/22/java-microservices-spring-boot-spring-cloud

Slide 58

Slide 58 text

Demo Using JHipster, create: A gateway A store microservices app A blog microservices app Generate entities in apps and on gateway Convert gateway to be a PWA Run everything in Docker https://github.com/oktadeveloper/java- microservices-examples

Slide 59

Slide 59 text

Lab 2: Build JHipster Microservices https://bit.ly/jhipster6-ms

Slide 60

Slide 60 text

JHipster is Knowledge

Slide 61

Slide 61 text

What’s Next for JHipster? Full Reactive with WebFlux and Spring Cloud Gateway Spring Boot 2.2 GraphQL and Micro Frontends

Slide 62

Slide 62 text

Reactive Microservices with Spring Cloud Gateway https://developer.okta.com/blog/2019/08/28/reactive-microservices-spring-cloud-gateway

Slide 63

Slide 63 text

The JHipster Mini-Book Written with Asciidoctor Quick and to the point, 164 pages Developed a Real World App: www.21-points.com Free Download from infoq.com/minibooks/jhipster-mini-book

Slide 64

Slide 64 text

Learn More stackoverflow.com Spring Boot spring.io/guides JHipster www.jhipster.tech Okta APIs developer.okta.com

Slide 65

Slide 65 text

Getting Help stackoverflow.com/tags/jhipster gitter.im/jhipster/generator-jhipster github.com/jhipster/.../CONTRIBUTING.md groups.google.com/.../jhipster-dev

Slide 66

Slide 66 text

developer.okta.com/blog @oktadev

Slide 67

Slide 67 text

blog.ippon.tech @IpponUSA

Slide 68

Slide 68 text

Action! Try Spring Boot Try Angular, React, or Vue Try JHipster Explore PWAs Try Microservices Enjoy the bootiful experience!

Slide 69

Slide 69 text

Keep in touch! @mraible @sharpedennis Presentations speakerdeck.com/mraible Code github.com/oktadeveloper Questions?