JHipster Documentation

repository·main·Indexed 43 days ago

https://github.com/jhipster/jhipster.github.io

A development platform to generate modern web applications. JHipster supports monolithic and microservice architectures using Spring Boot, Spring Cloud Gateway, and frontend frameworks like Angular, React, or Vue. It includes support for various databases (SQL and NoSQL), authentication methods (JWT, OAuth 2.0/OIDC), and specialized blueprints such as JHipster Quarkus.

Tokens
131.4K
Snippets
389
Records
597
Agent score
56%

What's inside JHipster

  1. What is JHipster Lite?

    main

    JHipster Lite (now part of the Seed4J organization) is a step-by-step project generator designed to produce only the code you explicitly request, avoiding unused boilerplate.

    Key characteristics include:

    • Hexagonal Architecture: The generated code follows hexagonal patterns to ensure high maintainability.
    • Separation of Concerns: Technical code is strictly separated from business logic.
    • High Code Quality: Focuses on 100% code coverage, zero code smells, and no duplication.
    • Tech Stack: The generator itself is a web application built using Java (Spring Boot) and Vue.js.
  2. What is JHipster IDE?

    main

    JHipster IDE is an Xtext DSL (Domain Specific Language) that provides textual editing support for JHipster Domain Language (JDL) files. It enhances the developer experience in popular editors by providing advanced language features.

    Key Features:

    • Editing Support: Syntax coloring, auto-completion, formatting, hover information, and folding.
    • Navigation & Refactoring: Go To Declaration, Find References, Rename Refactoring, and Mark Occurrences.
    • Code Intelligence: Error checking, Quick Fix proposals, and Outline/Structure view.
    • JDL Specifics: Automatic UML diagram generation from JDL files.
    • Integration: Integration with the Eclipse terminal shell to call JHipster's Yeoman generator.
    • Xdocker (Eclipse only): Allows editing, building, and running Docker files and images generated by JHipster directly within the IDE.
  3. Understand Production-Ready Features

    main

    JHipster applications include several features designed for production environments:

    • Monitoring: Metrics and the ELK Stack.
    • Caching: Supports local caches (ehcache, Caffeine) and distributed caches (Hazelcast, Infinispan, Memcached, or Redis).
    • Performance: Optimized static resources (gzip filter, HTTP cache headers) and HikariCP for connection pooling.
    • Logging: Logback, which is configurable at runtime.
    • Deployment:
      • Builds standard WAR files or executable JAR files.
      • Full Docker and Docker Compose support.
      • Support for major cloud providers including AWS, GCP, Heroku, Kubernetes, OpenShift, Azure, and Docker.
  4. Choose a JHipster installation type

    main

    JHipster offers three ways to work with the generator:

    1. JHipster Online: Use start.jhipster.tech to generate an application without installing anything locally. This is ideal for first-time users, but you will still need Java and NPM to run the generated application.
    2. Local installation with NPM (Recommended): The standard way to work. Everything is installed on your machine. This provides the full JHipster experience.
    3. Docker container: A lightweight container with JHipster pre-installed. This is intended for advanced users.
  5. Use JHipster shell plugins for enhanced CLI experience

    main

    JHipster provides shell plugins to add shortcuts, auto-completion, and improved UI elements to your terminal, making the JHipster CLI faster and easier to use.

    Currently, there are two supported plugins depending on your shell manager:

    1. Oh-My-Zsh JHipster plugin: For users of Oh-My-Zsh.
    2. Fisher JHipster plugin: For users of Fisher (typically used with Fish shell).
  6. Use official JHipster blueprints

    main

    JHipster blueprints allow you to extend the generator's capabilities by using different languages, frameworks, or specialized features. They are used to modify the main generator behavior to fit specific needs, such as switching the backend language or adding auditing capabilities.

    Official blueprints are maintained by the JHipster team and include support for various stacks like Kotlin, .NET Core, Node.js, and more.

  7. Explore JHipster tips and tricks

    main

    The JHipster documentation provides a collection of user-submitted tips and tricks to optimize development, configuration, and deployment. These include guides on:

    • UI & Frontend: Using Bootswatch themes, implementing infinite scrolling with Slice, and providing Internet Explorer support.
    • Configuration: Configuring email (e.g., Gmail), setting up local SMTP servers, and managing Redis leader-follower replication.
    • Security & Auth: LDAP authentication, enabling Social Login with OAuth2, creating new Authorities, and protecting Kibana with Apache Basic Authentication.
    • Database & Persistence: Using QueryDSL, managing @OneToOne with @MapsId issues, and connecting PGAdmin to Heroku.
    • DevOps & Infrastructure: Speeding up generator-jhipster, using Docker containers as localhost on Mac/Windows, Kubernetes with Google Cloud SQL, and handling Docker time drift.
    • Development Workflow: Running Protractor e2e tests in IntelliJ IDEA, improving IDE experience for frontend-only development, and combining JHipster generation with custom code.
  8. Use the JHipster Quarkus blueprint

    main

    The JHipster Quarkus blueprint allows you to leverage the JHipster generator to create applications based on Quarkus.

    Note that this blueprint focuses on the differences between JHipster Quarkus and the standard JHipster generator. For common JHipster features and workflows, refer to the standard JHipster documentation.

    Key tasks for using the Quarkus blueprint include:

    • Installing the JHipster Quarkus blueprint
    • Creating a new Quarkus application
    • Creating entities within a Quarkus application
  9. Default User Credentials in JHipster

    main

    By default, JHipster applications are generated with two users:

    • user: A normal user with ROLE_USER authorization. Default password: user.
    • admin: An admin user with ROLE_USER and ROLE_ADMIN authorizations. Default password: admin.

    Warning: In production, ROLE_USER and ROLE_ADMIN both have the same CRUD access to entities by default. You should implement more granular access control for production environments. You must change these default passwords immediately upon deployment.

  10. Understand the JHipster React project structure

    main

    The JHipster client code is located in src/main/webapp and follows the Piotr Witek React-Redux-TypeScript style guide. It uses dash-cased naming conventions for React routes to ensure clean URLs.

    Main Application Structure

    • app/config: General configuration including Redux store and middleware.
    • app/entities: Generated entity CRUD components.
    • app/modules: Main component directories (e.g., account, administration, home, login).
    • app/shared: Shared elements like header, footer, reducers, models, and utility classes.
    • app/routes.tsx: Main application routes definition.
    • app/app.tsx: The main application class.
    • i18n: Translation files for internationalization.
    • static: Static assets like images and fonts.
    webapp
    ├── app                             - Your application
    │   ├── config                      - General configuration (redux store, middleware, etc.)
    │   ├── entities                    - Generated entities
    │   ├── modules                     - Main components directory
    │   ├── shared                      - Shared elements such as your header, footer, reducers, models and util classes
    │   ├── app.tsx                     - The application main class
    │   ├── routes.tsx                  - Application main routes
    │   └── typings.d.ts                -
    ├── i18n                            - Translation files
    └── static                          - Contains your static files such as images and fonts
  11. JHipster Control Center Features Overview

    main

    The Control Center provides a centralized Vue-based UI to manage and monitor microservices via their management API endpoints (ideally exposed on a dedicated management port like 9999).

    Key features include:

    • Instances: A real-time list of registered application instances (via Consul/Eureka).
    • Metrics: Detailed performance views (JVM, HTTP, cache, DB pools) using Micrometer. Includes stacktrace expansion for JVM threads.
    • Health: Real-time health status via Spring Boot Actuator endpoints.
    • Configuration: A full view of the current application's Spring configuration.
    • Logs: Runtime management of Logback levels for specific Java packages.
    • Logfile: Runtime viewing of application log files (requires configuration).
    • API: Integrated Swagger UI to view and test all application API documentation.