Skip to content

codeprismtechnologies/starter-rest-api-mongodb-springboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starter-Rest-Api-MongoDB-SpringBoot

Introduction

MongoDB is fast and can handle large amounts of structured and unstructured data, making it a database of choice for web applications. The Spring framework provides powerful connectors to easily perform database operations with MongoDB. Data is stored as BSON objects in MongoDB making data retrieval easy.

For this Spring Boot and MongoDB example tutorial, we are only concerned with the Persistence and Database layers. We want to keep the focus on CRUD operations, so we will run our program from an Integrated Development Environment (IDE). We will add Spring Boot MongoDB configurations to connect Spring Boot and MongoDB.

Technologies:

  1. Java 17
  2. Spring Boot 2.7.4
  3. Gradle 7.5.1
  4. Cloud MongoDB
  5. Swagger UI
  6. Intellij Idea

Features:

  1. Input data validation
  2. Generic Exception Handler
  3. Custom Exception
  4. Swagger UI Api Documentation
  5. Custom Annotation for Validation
  6. Model Mapper(Object Mapper)

Clone this project using:

git clone https://github.com/codeprismtechnologies/starter-rest-api-mongodb-springboot.git

Project Setup And guide(This is important)

Step : 1

If you want to set up your own cloud mongoDB please refer this link: https://www.mongodb.com/basics/mongodb-atlas-tutorial

Step : 2

Copy your cloud mongoDB URI and Replace it to existing configured URI which is in application.yml

Pre-requisites:

  • Make sure you are using Java version 17
  • Make sure your MongoDB server up and running
  • Make sure using gradle version using 7+

Run

  • After cloning project. Refresh gradle once.
  • Run project as springboot application
  • To start testing rest api calls just copy below url paste it any browser Safari/Chrome/Mozilla..etc
http://localhost:8080/swagger-ui/

Extras

Few Tools which can be used to test Rest APIs.

  1. Postman
  2. Insomnia
  3. SoapUI..etc

Screenshots:

Swagger UI

Screenshot 2022-10-15 at 5 31 31 PM

Screenshot 2022-10-15 at 5 31 49 PM

Mongo DB

Screenshot 2022-10-15 at 5 33 35 PM

Screenshot 2022-10-15 at 5 33 18 PM

codeprism.in

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages