Java Spring Boot with PostgreSQL — CRUD API Project: Part 1/2 (Tools Installation)


This is a complete tutorial for beginners on developing a Java project using Spring Boot, Spring Data JPA, and PostgreSQL from scratch. This tutorial will help you understand basic concepts, configurations, tools required, and coding to execute a simple API application with CreateReadUpdate, and Delete functionalities (CRUD operation).

This article can be divided mainly into 2 sections.

  • One, Tools setupyou are here 😊
  • Two, Coding + concepts (CRUD)

Technologies/Tools required 🛠 :

  • Java 17
  • VS Code (any preferred IDE is fine)
  • PostgreSQL
  • DBeaver
  • Postman
Remember to download the latest version of tools to stay updated.  Versions mentioned in this article are latest to its published day.

Tools Installation Steps

1. Java

    Check out how to download and set up Java using the below link. Ensure to download version 17 for this project.

    Also, read the blog below to understand the basic concepts of Java and the components included.

    Java web application using Spring framework? Part 1/3 (Tools Installation)

    2. VS Code

    Download the VS Code from the below link for your respective machine and proceed with the installation.

    https://code.visualstudio.com/?source=post_page—–11758c959b23——————————–

    Visual Studio is an integrated development environment (IDE). Its simple user interface is an additional perk, and the neatly sectioned editor makes coding and troubleshooting much easier. It aims to provide just the tools a developer needs for a quick code-build-debug cycle and leaves more complex workflows to the IDE.
    • Open VS Code
    • CTRL + SHIFT + p OR Type ‘>’ in the Search bar — Spring Initializr: Create a Maven project
    • Specify Spring Boot version — 3.2.0
    • Specify project language — Java
    • Group Id — com.example
    • Artifact Id — employer
    • Specify packaging type — Jar
    • Specify Java version — 17
    • Dependencies —
      • Spring Web
      • Spring Boot DevTools
      • Lombok
      • Spring Data JPA
    • Specify a folder to generate the boilerplate project with dependencies injected

    ‘Spring Boot’ is a tool that makes developing web applications and microservices with Java Spring Framework faster and easier. It makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”.

    Spring Web’ starter dependency allows you to build Spring-based web applications with minimal configuration by adding all the necessary dependencies — such as the Apache Tomcat web server — to your project.

    Spring Boot’ includes an additional set of tools that can make the application development experience a little more pleasant. The spring-boot-dev tools module can be included in any project to provide additional development-time features.

    Spring boot Lombok’ is nothing but a small library that was used to reduce the unused code from the Java applications. It automatically generates the getter and setter method for the class object by using Lombok annotation. It is also used to minimize/remove the boilerplate code and save the precious time of developers during development by just using some annotations.

    Developers can use the Java Persistence API (JPA) to create object-oriented versions of relational database entities to use in their applications. JPA handles most of the complexity of JDBC-based database access and object-relational mappings. On top of that, ‘Spring Data JPA’ reduces the amount of boilerplate code required by JPA. That implements your persistence layer easier and faster.


    3. PostgreSQL

    Download PostgreSQL from the below link for your respective machine and proceed with the installation.

    https://www.postgresql.org/download/?source=post_page—–11758c959b23——————————–

    Make sure to set the path in the environment variables as PG_HOME with the \bin path and verify using the command postgres –version in CMD.

    Ensure to note down the usernamepassword, and port address provided during the installation procedure.

    ‘PostgreSQL’ is an object-relational database management system that offers more features than MySQL. It gives you more flexibility in data types, scalability, concurrency, and data integrity.

    It is an ACID-compliant RDBMS. In other words, it offers atomicity, consistency, isolation, and durability features. PostgreSQL’s advanced features include stored procedures, triggers, user-defined functions, transactions, and replication.


    4. Postman

    Download Postman from the below link for your respective machine and proceed with the installation.

    https://www.postman.com/downloads/?source=post_page—–11758c959b23——————————–

    ‘Postman’ provides an intuitive and user-friendly interface, allowing users to easily create, test, and manage API requests. Postman supports multiple HTTP methods such as GET, POST, PUT, and DELETE, enabling users to test and debug a variety of API endpoints.


    5. DBeaver

    Download DBeaver from the below link for your respective machine and proceed with the installation.

    Download

    ‘DBeaver’ provides lots of built-in database connectors to connect with various databases. The inbuilt database functions are popped up while you are typing the function name, which makes the developer write SQL at a faster phase.


    Thank you for reading! I hope you’re able to understand the concepts and proceed with the tools installation with this explanation, and please share to help others too. 😊

    Click on the below link to continue coding (CRUD)— Part 2:

    Java Spring Boot with PostgreSQL — CRUD API Project: Part 2/2 (Coding)

    Well, there are a lot of areas for improvement in this project and, for any new suggestions or comments, I’m all ears.

    Download project from: https://github.com/sharuroy16/employer

    Leave a Comment

    Your email address will not be published. Required fields are marked *