Skip to content

Recipe Web Application using Spring Boot + REST + Spring Data JPA + Spring Security + JQuery Ajax + Bootstrap + Swagger2 + JUnit + Mockito

Notifications You must be signed in to change notification settings

thakurpdhiraj/reciperepository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 

Repository files navigation

Recipe Web Application using Spring Boot + REST + Spring Data JPA + Spring Security + JQuery Ajax + Bootstrap + Swagger2 + JUnit + Mockito

A single page web application which allows users to manage their favourite recipe with basic CRUD operations using an embedded database H2

Requirements

  • Java 8
  • Apache Maven

Quick Start

  1. Clone project in IDE
  2. Find RecipeApplication.java, select 'Run As' > 'Java Application'.
  3. Point browser to http://localhost:8080/kitchenworld/. If you want to change the context go to application.properties and change the value of server.servlet.context-path
  4. You should be redirected to a login page. By default a user with admin rights is created with credentials -> Username : admin & Password : password along with some dummy recipe data using the data.sql file
  5. Project uses H2 as the embedded database and a data base file with name recipe-db is created in the user directory. To change the name of the file go to application.properties and change the value of spring.datasource.url. For more info visit http://www.h2database.com/html/faq.html.
    Note: Data will not be permanently persisted unless you change the value of spring.jpa.hibernate.ddl-auto to update
  6. By default, the H2 console is enabled and it hosted at http://localhost:8080/kitchenworld/h2-console/. This can be changed in application.properties by changing the value of spring.h2.console.enabled and spring.h2.console.path
  7. Encryption keys are configured to use external properties file at ${user.home}/recipe-config.properties. You can change the location and name of the file in EncryptionUtil.java.

Home

Home

Single Recipe

Recipe

New Recipe

New Recipe

API Endpoints

Access to API Documentation is over http://localhost:8080/kitchenworld/swagger-ui.html and http://localhost:8080/kitchenworld/v2/api-docs

All endpoints are configured to accept Basic Authentication.(For production grade code, Basic Authentication should not be used.) You can change the configuration in MultiHttpSecurityConfig.java
For our dummy admin use Authorization header with value Basic YWRtaW46cGFzc3dvcmQ=.

RECIPE

  1. GET single recipe : http://localhost:8080/kitchenworld/api/recipes/{id}
  2. GET all recipes : http://localhost:8080/kitchenworld/api/recipes/
  3. GET with limit and offset : http://localhost:8080/kitchenworld/api/recipes?limit={limit}&page={offset}
  4. GET total recipe size : http://localhost:8080/kitchenworld/api/recipes/size
  5. POST new recipe : http://localhost:8080/kitchenworld/api/recipes
  6. PUT update recipe : http://localhost:8080/kitchenworld/api/recipes/{id}
  7. DELETE recipe : http://localhost:8080/kitchenworld/api/recipes/{id}

About

Recipe Web Application using Spring Boot + REST + Spring Data JPA + Spring Security + JQuery Ajax + Bootstrap + Swagger2 + JUnit + Mockito

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published