Posts

Showing posts with the label PostgreSQL

Spring Boot PostgreSQL - Integration Testing with Testcontainers - Example

Image
In this section, we will learn  how to test Spring Boot, Spring Data JPA, and PostgreSQL based application using Testcontainers. 1.  What we will build? We will create a web application with Spring Boot, Spring Data JPA and PostgreSQL database. The application will consist of three layer,  ie. a Controller, a Service, and a Repository layer.  Controller layer takes care of mapping request data to the defined request handler method. Once response body is generated from the handler method, it converts it to JSON response. Service layer  facilitates communication between the controller and the repository layer. We are using Spring Data JPA for managing database operations, so we can use Spring Data JPARepository interface. **Finally we will do a integration testing with help of Testcontainers to verify our system is working as expected. 2. Testcontainers Testcontainers is an open source testing library that allows us to run docker containers directly in our spring boot application in orde

Spring Boot 3 + Angular 15 + Material - Full Stack CRUD Application Example

Image
In this section we will develop a full-stack application that is a basic Student management application using Spring Boot 3, Angular 15, Material and PostgreSQL. You could download the source code from our GitHub repository, the download link is provided at the end of this article. After completing this tutorial what we will build?   We will build a full-stack web application that is a basic Student Management Application with CRUD features:  Create Student List Student Update Student  Delete Student Technologies used: Spring Boot 3+ Spring Data JPA PostgreSQL Java 17 Angular 15 Angular Material UI 1. Backend Development Creating a Spring boot web application First, open the Spring initializr: https://start.spring.io/   Then, Provide the Group and Artifact name. We have provided Group name com.knf.dev.demo and Artifact spring-boot3-postgresql-crud-app . Here I selected the Maven project - language Java 17 ,  Spring Boot 3.1.4  (latest) and add Spring web dependency , PostgreSQL Driver