Skip to content

faranak-cs/spring-rest-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring REST App

REST API in Spring to perform CRUD operations on a H2 in-memory database of Products.

REST Endpoints

  • /actuator/health
  • /createProduct
  • /getAllProducts
  • /getProductById/{id}
  • /updateProductById/{id}
  • /deleteProduct/{id}
  • /swagger-ui/index.html

Requirements

Controller

  • Implement the REST endpoints described in the section below
  • Create a “Product” DTO to be used by the REST API
  • Implement Swagger for the API
  • Implement appropriate validation on the endpoints. e.g. Returning a 400 Bad Request responses fields are missing when creating a product

Service Layer

  • Implement a service layer which should act as the intermediary between the Controller and Repository layers of the application
  • Should map “Product” DTO to and from “Product” entity/model (Java object used by the repository layer)

Repository Layer

  • Create an in-memory H2 database for the system to store products
  • Create a repository layer using Spring JPA
  • Create a “Product” entity for the repository layer
  • The “Product” entity should have a unique id field that is managed by Spring JPA using sequence generation

Useful Links

Architecture Diagram

Arch-Diagram

Deployment

Screenshot 2024-07-29 at 12 07 25

Demo Video

Spring-Demo.mov

Version

Library Version
IntelliJ IDEA CE 2024.1.4
Java 17.0.11-tem
Maven 3.9.8
Spring Boot 3.3.1
Spring Framework 6.1.10

About

REST app in Spring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published