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

Get Hip with JHipster - GIDS 2019

Get Hip with JHipster - GIDS 2019

JHipster is one of those open-source projects you stumble upon and immediately think, "Of course!" It combines three very successful frameworks in web development: Bootstrap, Angular, and Spring Boot. Bootstrap was one of the first dominant web-component frameworks. Its largest appeal was that it only required a bit of HTML and it worked! All the efforts we made in the Java community to develop web components were shown a better path by Bootstrap. It leveled the playing field in HTML/CSS development, much like Apple's Human Interface Guidelines did for iOS apps.

This talk shows you how to use JHipster to build a Spring Boot API, an Angular UI, and make it all look good with Bootstrap. You'll learn how to deploy the generated project to Heroku too!

Matt Raible

April 22, 2019

More Decks by Matt Raible

Other Decks in Programming


  1. Matt Raible | @mraible Get Hip with JHipster April 22,

    2019 Photo by Alyssa Black https://www.flickr.com/photos/alyssablack/12185839253
  2. 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
  3. public class Okta { public Okta(DeveloperDNA developerDna) { DeveloperRelations devRel

    = developerDna.getDeveloperRelations(); Assert.notNull(devRel,"Developer Relations is required to operate effectively."); Set<Developer> team = devRel.getTeam(); Assert.isTrue(!team.isEmpty(),"Team cannot be empty."); Assert.isTrue(!devRel.getSdks().isEmpty(), "SDKs required for developers."); } }
  4. What about YOU? Are you a Java Developer? Web Developer?

    How long have you been doing web development? Do you like JSF? Do you like GWT? Do you like JavaScript? TypeScript?
  5. Java 8 Parallel Collections JSR 310 Date and Time API

    Functional Interfaces with default method Lambda Expressions (a.k.a. Closures) Nashorn JavaScript Engine
  6. Java 11 New String Methods File Utility Methods Local Variable

    Syntax: var Java EE and CORBA modules removed What about Java 12?
  7. Hipster n. noun 1. One who is exceptionally aware of

    or interested in the latest trends and tastes.
  8. Latest trends in JavaLand? Microservices Embedded App Servers Deployment with

    Containers Environments: dev, test, production Auto-Configuration Monitoring
  9. 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
  10. @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<Blog, Long> { }
  11. @SpringBootApplication class NotesApplication fun main(args: Array<String>) { 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<Note, Long>
  12. Latest trends in Web Development? Progressive Web Applications JavaScript MVC

    Frameworks CSS 3 with Animations Mobile First Front-End Optimization REST and GraphQL APIs
  13. Jobs on Indeed (US) April 2019 0 2,500 5,000 7,500

    10,000 React Angular Vue Vanilla
  14. @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! ✨
  15. JHipster is Open Source Web Statistics, March 2019 420K Page

    Views / 692K on GitHub 97K Downloads GitHub Statistics 13K Stars 492 Contributors
  16. JHipster Spring Boot Spring Security Angular React Bootstrap Metrics Maven

    or Gradle Authentication Type: cookie-based, JWT, or OAuth 2.0 / OIDC Type of Database: SQL or NoSQL Caching: EhCache or Hazelcast Elasticsearch Webpack Foundational Frameworks Project Options
  17. 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
  18. 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!
  19. OAuth 2.0 and OpenID Connect OpenID Connect OAuth 2.0 HTTP

    OpenID Connect is for authentication
 OAuth 2.0 is for authorization
  20. Validate ID Token Token Endpoint Authorization Endpoint /.well-known/
 openid-configuration JWKS

    Endpoint UserInfo Endpoint OAuth 2.0 Authorization Server & OpenID Connect Provider (OP) OAuth 2.0 Resource Server Client (Relying Party) 1 3 2 5 4 1 Discover OpenID Provider Metadata 2 Perform OAuth flow to obtain a ID token and/or access token 3 Get JSON Web Key Set (JWKS) for signature keys 4 Validate ID token
 (JSON Web Token) 5 Get additional user attributes with access token from UserInfo endpoint OpenID Connect
  21. 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
  22. Lines of Code in 21-Points 0 6500 13000 19500 26000

    Project Created Entities Generated Business Logic and UI 25,670 23,590 16,728
  23. Project Creation Entities Generated Biz Logic and UI 0 10000

    20000 30000 2,999 2,648 1,839 9,472 8,911 5,523 8,383 7,696 5,892 Java TypeScript HTML Lines of Code by Language
  24. What’s New and Next? JHipster 6 Beta now available! JDK

    8+ Compatibility Spring Boot 2.1 / Spring Webflux Vue Support Updated OAuth 2.0 / OIDC
  25. Action! Try Spring Boot Try Angular, React, or Vue Try

    JHipster Explore PWAs Enjoy the bootiful experience!