Preface

A few years ago, I consulted at several companies that used Spring and Java to develop their back-end systems. On those projects, I introduced Spring Boot to simplify development. DevOps teams often admired its external configuration, and its starter dependencies made it easy to develop SOAP and REST APIs.

I used AngularJS for several years as well. In early 2013, I first used AngularJS on a project where I implemented 40% of the code that jQuery would’ve required. I helped that company modernize its UI in a project for which we integrated Bootstrap. I was very impressed with both AngularJS and Bootstrap and have used them ever since. In 2014, I used Ionic on a project to implement an HTML5 UI in a native iOS application. We used AngularJS, Bootstrap, and Spring Boot in that project, which worked very well for us.

When I heard about JHipster, I was motivated to use it immediately. It combined my most-often-used frameworks into an easy-to-use package. For the first several months I knew about JHipster, I used it as a learning tool—generating projects and digging into files to see how it coded features. The JHipster project is a goldmine of information and lessons from several years of developer experience.

I wanted to write this book because I knew all the tools in JHipster well. I wanted to further my knowledge of this wonderful project and show Java developers that they could be hip again by leveraging Angular and Bootstrap. JavaScript web development isn’t scary—it’s just another powerful platform that can improve your web-development skills.

The first version of this book was released in October 2015, the second in December 2016, and the third (4.x to match Angular) was released in the fall of 2017 after JHipster migrated to Angular. Version 4.5 was released in April 2018 with an additional chapter on microservices. Version 5 for JHipster v5 was released in November 2018. This version is updated for JHipster version 7. I’m pleased to bring you this book as an active member of the JHipster Development Team.

What is in an InfoQ mini-book?

InfoQ mini-books are designed to be concise and serve technical architects looking to get a firm conceptual understanding of a new technology or technique in a quick yet in-depth fashion. You can think of these books as covering a topic strategically or essentially. After reading a mini-book, you should have a fundamental understanding of the technology, including when and where to apply it, how it relates to other technologies, and an assimilated knowledge of other professionals who know what this technology is about. You will then be able to make intelligent decisions about the technology once your projects require it and can delve into more detailed sources (such as larger books or tutorials) at that time.

Who is this book for?

This book is aimed specifically at web developers who want a rapid introduction to Angular, Bootstrap, and Spring Boot by learning JHipster. JHipster 5 adds support for React as well, but I won’t be covering it in this book since Angular is the default.

What you need for this book

To try code samples, you will need a computer running an up-to-date operating system (Windows, Linux, or macOS). You will need Node.js and Java installed. The book’s code was tested using Node.js 16 and Java 11.

Conventions

We use several typographical conventions within this book that distinguish between different kinds of information. Code in the text, including commands, variables, file names, CSS class names, and property names, are shown as follows:

Spring Boot uses a public static void main entry-point that launches an embedded web server for you.

A block of code is set out as follows. It may be colored, depending on the format in which you’re reading this book.

src/app/search/search.component.html
<form>
  <input type="search" name="query" [(ngModel)]="query">
  <button type="button" (click)="search()">Search</button>
</form>
src/main/java/demo/DemoApplication.java
@RestController
class BlogController {
    private final BlogRepository repository;

    public BlogController(BlogRepository repository) {
        this.repository = repository;
    }

    @RequestMapping("/blogs")
    Collection<Blog> list() {
        return repository.findAll();
    }
}

When we want to draw your attention to certain lines of code, those lines are annotated using numbers accompanied by brief descriptions.

export class SearchComponent {
  constructor(private searchService: SearchService) {} (1)

  search(): void { (2)
    this.searchService.search(this.query).subscribe( (3)
      data => { this.searchResults = data; },
      error => console.log(error)
    );
  }
}
1 To inject SearchService into SearchComponent, add it as a parameter to the constructor’s argument list.
2 search() is a method that’s called from the HTML’s <button>, wired up using the (click) event handler.
3 this.query is a variable that’s wired to <input> using two-way binding with [(ngModel)]="query".
Tips are shown using callouts like this.
Warnings are shown using callouts like this.
Sidebar

Additional information about a certain topic may be displayed in a sidebar like this one.

Finally, this text shows what a quote looks like:

In the end, it’s not the years in your life that count. It’s the life in your years.
— Abraham Lincoln

Reader feedback

We always welcome feedback from our readers. Tell us what you thought about this book—what you liked or disliked. Reader feedback helps us develop titles that deliver the most value to you.

To send us feedback, email us at feedback@infoq.com, send a tweet to @jhipster_book, or post a question on Stack Overflow using the “jhipster” tag.

If you’re interested in writing a mini-book for InfoQ, see http://www.infoq.com/minibook-guidelines.