Developing your first Spring Boot application or starting from scratch. This blog is a great boilerplate or starter template for your spring boot project. Learn how to set up your project using the standard folder structure and files. You will learn how to setup your Spring Boot project using standard settings, folder structure. Learn how to create project using Initialzr and add dependencies for your project. Also learn what are the necessary dependencies for starting your project.

In this blog we will setup a Java Spring Boot Project using following:

  1. Maven
  2. Spring Boot 2.7.2
  3. Java 17
  4. Dependencies – Spring Web, Spring Security, Spring Data JPA, Thymeleaf, Spring Boot DevTools, PostgreSQL Driver

Note: You can remove and add dependencies as per your requirements.

Download Project using Spring Initializr

Generate your spring boot project and add dependencies using Spring Initialzr. Go to and select the requirements as per your project. I have attached the bellow image for your reference.

Spring Boot Initial Setting using Initializr
Spring Boot Initial Setting using Initializr

You need to add dependencies by clicking “ADD DEPENDENCIES” button. Once you click on Generate button, you project will be downloaded with all required files and folders. You can access my setup using the following link.

Setup Initial Project using Spring Boot

Once your project is downloaded, open it in your favourite IDE. I would recommend IntelliJ IDEA. Once you have loaded the project in your IDE, add the following settings in your file

#-------------------- server properties ---------------

#--------------------- Logging ------------------

#--------------------- DB Connection ------------------

#--------------------JPA-ORM Properties-----------------

If you are using PostgreSQL in your project you need to first create the database. Use bellow commands to create

sudo -u postgres psql
CREATE USER myuser WITH PASSWORD 'password';
ALTER ROLE myuser SET client_encoding TO 'utf8';
ALTER ROLE myuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE myuser SET timezone TO 'UTC';

Once everything is done, go to your project main file, where public static void main resides and run the project. If your project runs successfully, go to localhost:8080 .