A minimal Spring Boot RESTful API showcasing basic CRUD operations on a sample entity, with file upload capabilities and image thumbnail support.
-
CRUD Endpoints for
Item(or your chosen domain object)GET /api/items– Retrieve all itemsGET /api/items/{id}– Retrieve an item by IDPOST /api/items– Create a new itemPUT /api/items/{id}– Update an existing itemDELETE /api/items/{id}– Delete an item
-
File Upload Service
- Secure MIME type detection using Apache Tika Core
- Generate image thumbnails with Thumbnailator
- Store uploaded files on the server
-
DTO Mapping with MapStruct (optional)
-
Unit & Integration Tests using Spring Boot Test and JUnit 5
- Spring Boot
- Spring Web
- Spring Data JPA
- H2 Database (in-memory)
- MapStruct (optional)
- Apache Tika Core for secure file type detection
- Thumbnailator for thumbnail generation
- JUnit 5 & Spring Boot Test
- Clone the repository
git clone [https://github.com/Pololac/firstapirest.git](https://github.com/Pololac/firstapirest.git)
cd firstapirest
- Run with Maven
./mvnw spring-boot:run
-
Access the API
- Base URL:
http://localhost:8080/api - Example:
GET http://localhost:8080/api/product
- Base URL:
Run all tests with:
./mvnw testContributions are welcome! Please:
- Fork the repo
- Create a feature branch
- Submit a pull request
Powered by Spring Boot