Spring Boot Project

Hello everyone!

It’s been a while since I last posted. Over the past few months, I’ve been focused on building new portfolio projects and managing college responsibilities. Now that I have more time, I’ll start sharing posts about the Java Roadmap soon.

But today, I want to talk about the most complete project I’ve built so far: a Library Management System built with the Spring Framework. It supports managing books, authors, categories, customers, loans, and returns.

It was built using Java 17 and Spring Boot 3.5.3, with PostgreSQL as the database. I used Spring Data JPA, Spring Web, and Swagger UI for the API documentation. The app also includes caching (via Caffeine), validation (with Hibernate Validator and custom annotations), and follows a clean, modular folder structure. Maven was used for build management.

Here some example of the JSON respond:

Route: api/book/1

{
  "bookId": 1,
  "title": "Cien años de soledad",
  "isbn": "9780307474728",
  "publicationYear": 1967,
  "pages": 417,
  "language": "Español",
  "authors": [
    {
      "authorId": 1,
      "firstName": "Gabriel",
      "lastName": "García Márquez",
      "bio": "Escritor colombiano, premio Nobel de Literatura en 1982",
      "status": true
    }
  ],
  "categoryId": {
    "categoryId": 1,
    "name": "Ficción",
    "description": "Obras de literatura imaginativa",
    "status": true
  },
  "stock": 5,
  "status": false
}

Route: api/customer/1

{
  "customerId": 1,
  "firstName": "María",
  "lastName": "González",
  "email": "maria.g@email.com",
  "phone": "555-1234",
  "registrationDate": "2023-01-15",
  "status": true
}

I implemented several features in this project. Like isbn validation with decorators, implementation of cache for better performance, and a clean structure of the folders. I think that for someone who uses Spring for the first time, it’s not bad.

If you are interested to check out my project, you can find it here:

GitHub Repo:

And the PostgreSQL database:

Database:

I’d love to hear your thoughts or suggestions. Feel free to star the repo or open an issue if you have questions!

Leave a Reply