Skip to main content

A starting project example for Spring Boot 2 with Postgresql, Swagger2, and JWT

Inspired by my colleague, I have spent some time putting together a Spring Boot 2 starting project.

  • Developers who would like to have a structured Spring Boot 2 project to compare.

Link to the repository: spring-boot-example

  • Spring Actuator for management
  • lombok for easy annotations
  • swagger and swagger-ui for docs
  • Spring devtools for dev
  • Spring security for signup and login
  • postgresql for database
  • jpa for database access
  • jjwt for jwt in java
  • h2 for database using in test
  • security test for testing security stuffs
  • Spring Boot Starter Test for testing boot application

What in the examples:
  • Simple sign up and login.
  • Simple Rest API demostration.
  • Auto database migration with Flyway.
  • Auto documentation generation with Swagger2
  • Build with gradle.
  • Running locally with Docker + docker-compose.
  • Store data in Postgresql database.
  • Init database with startup sql-script.
  • Some unit test for the Rest API.


- ninjahoahong


Popular posts from this blog

My books review: "The retrospective handbook"

Overview: The retrospective handbook is a useful collection of tips for preparing and running retrospective for agile teams. The central point of facilitating a retrospective is the preparation. All the details - even the smallest details such as how much paper is available or what the colours of the using pens - play an important role in running a successful retrospective. In such preparation, the most important preparation is the relationship. It requires team members to have high trust with each other to address any problems in great details and find the most suitable solution for those problems. My impression: The tips for running remote retrospective would be really useful for anyone especially startups in my opinion. All the startups I have worked for so far have had some foreign teams either external or internal to save operating money. In addition, there are a lot of remote work to save office renting space and almost all of those startups followed the agile method.

My books review: Money for the rest of us

Overview: The "Money for the rest of us" book is a list of 10 questions serve as a guideline to invest. It is light book with not many pages and can be read during commute time. The book does not require audiences to have any special knowledge. My impression: The author, Mr. David, is very friendly and patient to answer my questions. The 10 questions are greatly explained by the author, and I think they provide a good starting point. However, I think anyone who wants to invest should build their own checklist and a general guideline for different situations. When a general guideline is in place, the decisions need to respect the guideline in order to make consistent decision. Consistency , in my opinion, is the most important in the long run as it provide information for constant feedback and improvements. Overall, I think this is a good book that helps improving my decision making process. - ninjahoahong

Scripting with Java

I think Java is quite verbose for scripting. However, it can also be fun. I wrote a very simple experiment of ls command. You should try it out. Download file ls and chmod +x ls then you can run ./ls . There are no flags/options supported.😆 - ninjahoahong