Coder Social home page Coder Social logo

erebelo / spring-mongodb-demo Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 270 KB

Java REST API project using Spring Boot 3 and MongoDB

Home Page: https://api.erebelo.com/spring-mongodb-demo/swagger-ui/index.html

License: MIT License

Java 99.80% JavaScript 0.20%
java mongo mongodb spring spring-boot springboot non-relational-database back-end backend backend-api backend-service spring-boot-3 junit junit5 mockito unit-test

spring-mongodb-demo's Introduction

Spring MongoDB Demo

REST API project developed in Java using Spring Boot 3 and MongoDB.

Features

  • HandlerInterceptor is utilized to intercept requests to verify whether they contain the required HTTP header attribute
  • HandlerMethodArgumentResolver is employed to retrieve a header value and assign it to an argument type in controller methods
  • AbstractMongoEventListener is utilized to persist historical data for each POST, UPDATE, PATCH, and DELETE operation
  • AuditorAware is utilized to insert values for auditable attributes such as username, document version, and date of operations in the persisted document
  • Converter and ConverterFactory are used to convert enum types to objects in the document before persisting and vice versa after fetching the data
  • ConstraintValidator is used to validate request fields and their associated business rules by declaring an annotation in the request class
  • Logback/SLF4J are employed to track application logs
  • Global Exception Handler is implemented to manage errors
  • Template Method design pattern used for different RestTemplate implementations
  • Unit Tests are implemented covering the entire application

Requirements

  • Java 17
  • Spring Boot 3.2.3
  • Apache Maven 3.8.6

Run App

  • Set the following environment variables if running the project for a spring profile other than 'local': 'DB_HOST', 'DB_PORT', 'DB_NAME', 'DB_USERNAME', and 'DB_PASSWORD'
  • Run the SpringMongoDBDemoApplication class as Java Application

Collection

Project Collection

AWS Demo

Spring MongoDB Demo

AWS Deployment

Follow the AWS Docker guide to deploy a Java App and MongoDB instances and how to set up Nginx as a reverse proxy with a valid Wildcard SSL/TLS certificate.

spring-mongodb-demo's People

Contributors

erebelo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.