API for CRUD functions in Database with Author and Book class in Java.
This project is a Spring Boot application that provides CRUD operations for managing Author
and Book
entities in a database. It uses Spring Data JPA for data access and PostgreSQL as the database.
To install and run this project, follow these steps:
-
Clone the repository:
git clone https://github.com/Sundhar22/spring-boot-API.git cd spring-boot-API
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
After running the application, you can access the API at http://localhost:8080
.
GET /api/authors
- Retrieve all authorsPOST /api/authors
- Create a new authorGET /api/books
- Retrieve all booksPOST /api/books
- Create a new book
The project uses the following dependencies:
spring-boot-starter-data-jpa
- Spring Data JPAspring-boot-starter-web
- Spring Webmodelmapper
- Object mappingh2
- In-memory database for testingpostgresql
- PostgreSQL driverlombok
- Java library to reduce boilerplate codespring-boot-starter-test
- Test starter
This project is licensed under the MIT License.