Skip to content

A minimal Spring Boot REST API featuring CRUD endpoints, secure file uploads with Apache Tika, image thumbnail generation via Thumbnailator and comprehensive unit & integration tests.

Notifications You must be signed in to change notification settings

Pololac/firstapirest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏗️ First API REST

A minimal Spring Boot RESTful API showcasing basic CRUD operations on a sample entity, with file upload capabilities and image thumbnail support.

🚀 Features

  • CRUD Endpoints for Item (or your chosen domain object)

    • GET /api/items – Retrieve all items
    • GET /api/items/{id} – Retrieve an item by ID
    • POST /api/items – Create a new item
    • PUT /api/items/{id} – Update an existing item
    • DELETE /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

🛠 Technologies

  • 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

🚦 Getting Started

  1. Clone the repository
git clone [https://github.com/Pololac/firstapirest.git](https://github.com/Pololac/firstapirest.git)
cd firstapirest

  1. Run with Maven
./mvnw spring-boot:run
  1. Access the API

    • Base URL: http://localhost:8080/api
    • Example: GET http://localhost:8080/api/product

🧪 Testing

Run all tests with:

./mvnw test

🤝 Contributing

Contributions are welcome! Please:

  • Fork the repo
  • Create a feature branch
  • Submit a pull request

Powered by Spring Boot

About

A minimal Spring Boot REST API featuring CRUD endpoints, secure file uploads with Apache Tika, image thumbnail generation via Thumbnailator and comprehensive unit & integration tests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published