My very first RESTful API for managing songs, implemented using plain Spring features without Spring Boot.
This project provides CRUD functionality for song records, utilizing Spring MVC, Spring Validation, and a custom in-memory database (H2).
- Java 19
- Spring MVC
- H2 Database
- Hibernate Validator
- JUnit 5 and Mockito for testing
- Docker
- GitHub Actions (for CI/CD to automatically deploy documentation to GitHub Pages)
To run the application, you have two choices:
- Run locally
- Run in Docker
- Ensure all the dependencies are installed
- Clone the repository
- Build the project using Maven:
mvn clean install
- Run the application with:
java -jar target/songsapi-1.0-SNAPSHOT.jar
- Build the image:
docker build . -t songs-api:latest
- Run the image:
docker run -it -p 8080:8080 songs-api:latest
- Open the api in http://localhost:8080
Since this project is developed in plain Spring (which doesn't seem to natively support Swagger),
the OpenAPI specification has been manually written to describe the API endpoints, request bodies, responses, and error handling.
Documentation is hosted at github pages:
https://vesalukkarila.github.io/songs-api/