An open API service indexing awesome lists of open source software.

https://github.com/saraobialero/java17-apachetomcat-springboot-java_evolution_project

This project demonstrates the evolution of a simple bookstore management system through four distinct implementations, showcasing the progression of Java development techniques and technologies.
https://github.com/saraobialero/java17-apachetomcat-springboot-java_evolution_project

csv-files jdbc-database servlet spring-boot tomcat-server

Last synced: about 1 month ago
JSON representation

This project demonstrates the evolution of a simple bookstore management system through four distinct implementations, showcasing the progression of Java development techniques and technologies.

Awesome Lists containing this project

README

          

# πŸ“š Bookshop Evolution Project

[![Java Version](https://img.shields.io/badge/Java-17-orange.svg)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

This project demonstrates the evolution of a Bookshop application through different implementations, each with a unique approach to data management and system architecture.

## πŸ“‹ Table of Content

1. [V1 - Basic management with HashSet](#v1---basic-management-with-hashset)
2. [V2 - Reading and writing to CSV file](#v2---reading-and-writing-to-csv-file)
3. [V3 - Database integration with JDBC](#v3---database-integration-with-jdbc)
4. [V4 - Servlet implementation and DAO pattern](#v4---servlet-implementation-and-dao-pattern)
5. [V5 - RESTful API with Spring Boot](#v5---restful-api-with-spring-boot)

## Project Evolution

```mermaid
graph LR
V1[V1: HashSet] -->|Add CSV| V2[V2: CSV]
V2 -->|Add Database| V3[V3: JDBC]
V3 -->|Add Web UI| V4[V4: Servlet & DAO]
V4 -->|Add REST API| V5[V5: Spring Boot]

V1 --- F1[In-memory data, Basic CRUD]
V2 --- F2[File persistence]
V3 --- F3[Database operations]
V4 --- F4[Web interface, MVC]
V5 --- F5[API, ORM, Dependency Injection]
```

## πŸ“š Main Features

### 1. Book Catalog Management
- Add, edit, and remove books from the catalog
- Search books by title, author, or ISBN
- View detailed book information
- Track book availability and quantity

### 2. User Management
- User registration and authentication
- User roles (e.g., Admin, Librarian, Member)
- User profile management
- Password reset functionality

### 3. Book Lending System
- Check out books to users
- Track due dates and overdue books
- Implement reservation system for popular books
- Generate lending reports and statistics

### 4. Advanced Features (varies by version)
- Data persistence (CSV, Database)
- Web interface for easy access
- RESTful API for integration with other systems
- Scalable architecture for growing libraries

## πŸ›  Technologies Used


Category
Technologies


Backend

Java 17
JDBC
Servlets
Apache Tomcat 9
Spring Boot 3.3.1



Database

MySQL
Hibernate



Testing

JUnit 5
Mockito

## πŸš€ Quick Start

```bash
git clone https://github.com/saraobialero/Java17-ApacheTomcat-SpringBoot-Java_Evolution_Project.git
cd bookshop-evolution
git checkout v1-hashset # or any other version you want to try
# Follow the README instructions in the specific branch
```

## πŸ“Έ Project Versions

### [V1 - Basic management with HashSet](https://github.com/saraobialero/Java17-ApacheTomcat-SpringBoot-Java_Evolution_Project/tree/v1-hashset)
Basic implementation of the bookshop using HashSet for in-memory data management.

```
src/
β”œβ”€β”€ main/
β”‚ β”œβ”€β”€ java/org/evpro/bookshopV1/
β”‚ β”‚ β”œβ”€β”€ Book
β”‚ β”‚ β”œβ”€β”€ BookException
β”‚ β”‚ └── Bookshop
└── test/java/
```

### [V2 - Reading and writing to CSV file](https://github.com/saraobialero/Java17-ApacheTomcat-SpringBoot-Java_Evolution_Project/tree/v2-io)
Evolution that introduces data persistence using CSV files.
```
src/
β”œβ”€β”€ main/
β”‚ β”œβ”€β”€ java/org/evpro/bookshopV2/
β”‚ β”‚ β”œβ”€β”€ Book
β”‚ β”‚ β”œβ”€β”€ BookException
β”‚ β”‚ β”œβ”€β”€ Bookshop
β”‚ β”‚ └── FileException
β”‚ └── resources/
β”‚ └── BookList.csv
└── test/java/
```

### [V3 - Database integration with JDBC](https://github.com/saraobialero/Java17-ApacheTomcat-SpringBoot-Java_Evolution_Project/tree/v3-jdbc)
Implementation that uses JDBC for connection and data management with MySQL database.
```
src/
β”œβ”€β”€ main/
β”‚ β”œβ”€β”€ java/org/evpro/bookshopV3/
β”‚ β”‚ β”œβ”€β”€ db/
β”‚ β”‚ β”‚ └── DatabaseManager
β”‚ β”‚ β”œβ”€β”€ exception/
β”‚ β”‚ β”‚ β”œβ”€β”€ BookException
β”‚ β”‚ β”‚ β”œβ”€β”€ DataBaseException
β”‚ β”‚ β”‚ └── ErrorResponse
β”‚ β”‚ └── model/
β”‚ β”‚ β”œβ”€β”€ Book
β”‚ β”‚ β”œβ”€β”€ Bookshop
β”‚ β”‚ └── PublicBookView
β”‚ β”‚
β”‚ └── resources/
β”‚ β”œβ”€β”€ data.sql
β”‚ β”œβ”€β”€ database.properties
β”‚ β”œβ”€β”€ logback.xml
β”‚ └── schema.sql
└── test/java/

```

### [V4 - Servlet implementation and DAO pattern](https://github.com/saraobialero/Java17-ApacheTomcat-SpringBoot-Java_Evolution_Project/tree/v4-servlet)
Introduction of the MVC pattern with Servlets and implementation of the DAO pattern for data access.
```
src/
β”œβ”€β”€ main/
β”‚ β”œβ”€β”€ java/org/evpro/bookshopV4/
β”‚ β”‚ β”œβ”€β”€ DAO/
β”‚ β”‚ β”‚ └── implementation/
β”‚ β”‚ β”œβ”€β”€ exception/
β”‚ β”‚ β”œβ”€β”€ filter/
β”‚ β”‚ β”œβ”€β”€ model/
β”‚ β”‚ β”‚ β”œβ”€β”€ requests/
β”‚ β”‚ β”‚ └── enums/
β”‚ β”‚ β”œβ”€β”€service/
β”‚ β”‚ β”‚ β”œβ”€β”€ functionality/
β”‚ β”‚ β”œβ”€β”€ servlet/
β”‚ β”‚ β”‚ β”œβ”€β”€ listener/
β”‚ β”‚ └── utilities/
β”‚ β”œβ”€β”€ resources/
β”‚ β”‚ └── database.properties
β”‚ └── webapp/
β”‚ β”œβ”€β”€ WEB-INF/
β”‚ β”‚ └── web.xml
└── test/java/
```

### [V5 - RESTful API with Spring Boot](https://github.com/saraobialero/Java17-ApacheTomcat-SpringBoot-Java_Evolution_Project/tree/v5-springboot)
Implementation of RESTful API using the Spring Boot framework.
```
src/
β”œβ”€β”€ main/
β”‚ β”œβ”€β”€ java/org/evpro/bookshopV5/
β”‚ β”‚ β”œβ”€β”€ config/
β”‚ β”‚ β”œβ”€β”€ controller/
β”‚ β”‚ β”œβ”€β”€ exception/
β”‚ β”‚ β”œβ”€β”€ filter/
β”‚ β”‚ β”œβ”€β”€ model/
β”‚ β”‚ β”‚ └── DTO/
β”‚ β”‚ β”‚ └── request/
β”‚ β”‚ β”‚ └── response/
β”‚ β”‚ β”œβ”€β”€ repository/
β”‚ β”‚ β”œβ”€β”€ service/
β”‚ β”‚ └── utils/
β”‚ └── resources/
β”‚ └── application.properties
└── test/
└── java/org/evpro/bookshopV5/
```

## πŸ“Š Comparison

| Feature | V1: HashSet | V2: CSV | V3: JDBC | V4: Servlet | V5: Spring Boot |
|------------------|-------------|---------|----------|-------------|-----------------|
| Data Persistence | ❌ | βœ… | βœ… | βœ… | βœ… |
| Web Interface | ❌ | ❌ | ❌ | βœ… | βœ… |
| API | ❌ | ❌ | ❌ | βœ… | βœ… |
| Scalability | Low | Low | Moderate | Moderate | High |
| Complexity | Low | Low | Moderate | High | Moderate |

## βš™οΈ Testing

Each version includes a test suite to verify the correct functionality of the implemented features.

## πŸ“š Learning Outcomes
- Evolution of a simple application into a full-fledged web service
- Different data persistence strategies
- Transition from monolithic to layered architecture
- Implementation of design patterns (DAO, MVC)
- Integration of frameworks and libraries
- Best practices in Java development across different paradigms

## 🫢 Contributing

Contributions are welcome! Please read the contribution guidelines before getting started.

## πŸ“Ž License

This project is distributed under the [MIT License](LICENSE).