Posts

Showing posts with the label MongoDB

Spring Boot MongoDB - Integration Testing with Testcontainers

Image
In this section, we will learn how to test Spring Boot, Spring Data MongoDB, and MongoDB based application using Testcontainers and @SpringBootTest. 1.  What we will build? We will create a web application with Spring Boot, Spring Data MongoDB and MongoDB. The application will consist of three layer,  that is 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 MongoDB for managing database operations, so we can use Spring Data MongoRepository 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 bo

Spring Boot 3 + Vue JS 3 + MongoDB CRUD Application Example

Image
In this section,  we will learn how to develop a full-stack web application that is a basic User Management Application using Spring Boot 3, MongoDB, and Vue 3. You could download the source code from our Github repository, the download link is provided at the end of this tutorial. After completing this tutorial what we will build? We will build a full-stack web application that is a basic User Management Application with CRUD features:  • Create User  • List User  • Update User  • Delete User     We divided this tutorial into two parts.   PART 1  - Restful API Development with Spring Boot 3 & MongoDB. PART 2  - UI development using Vue JS 3. PART 1 - Restful API Development with Spring Boot 3 These are APIs that Spring backend App will export: Backend project directory: pom.xml A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details utilized by Maven to build the project. <?