/iw-library-spring-boot

Sample CRUD project based on Spring Boot, Spring Data, Mysql

Primary LanguageJava

Spring Boot CRUD application used for training IWConnect Junior Developers

Sample CRUD project based on Spring Boot, Spring Data, Mysql

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Java JDK 8

Installing

  • Get the project from GIT "git clone https://github.com/popovski/iw-library-spring-boot"
  • Set datasource url of your MYSQL DB application.properties -> spring.datasource.url
  • Set mysql user value into application.properties -> spring.datasource.username
  • Set mysql user password value into application.properties -> spring.datasource.password

Build and Start the project

  • go to root directory of the project
  • mvnw clean package
  • java -jar .\target\iw-labs-crud-library-0.0.1-SNAPSHOT.jar

Database Setup (using docker compose docker-compose.yml)

docker compose up -d

Running the tests

.\mvnw test - command for running the junit tests

Built With

Demo

After you start the application the server will listen on port 8090

Swagger documentation http://localhost:8090/swagger-ui.html

Helpfull links

  • Get all books
    HTTP GET localhost:8090/api/books/

  • Create new book
    HTTP POST localhost:8090/api/books/
    Payload Json Body
    { "title": "NEW TITLE", "description": "NEW DESCRIPTION" }

  • Update existing book
    HTTP PUT localhost:8090/api/books/ - comment replace UUID with existing book UUID
    Payload Json Body
    { "title": "UPDATE TITLE", "description": "UPDATE DESCRIPTION" }

  • Delete Resource
    localhost:8090/api/books/ - comment replace UUID with existing book UUID

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details