- GET all albums or a specific album by ID.
- POST to add a new album.
- PUT to update an existing album.
- DELETE an album by ID.
- Integrated with PostgreSQL for persistent storage.
- Includes health checks via Spring Actuator.
- Java 21
- Spring Boot 3.4
- PostgreSQL
- Hibernate JPA
- Maven
- H2 Database (for development and testing)
-
Java 21 installed.
-
PostgreSQL installed and running.
-
A tool Postman for API testing.
-
ENDPOINTS: Endpoints Method Endpoint Description Request Body GET / Fetch all albums None GET /{id} Fetch a specific album by ID None POST / Add a new album {"title": "...", "artist": "...", ...} PUT /{id} Update an existing album by ID {"title": "...", "artist": "...", ...} DELETE /{id} Delete an album by ID None
-
The API will be available at: http://localhost:8080
-
The example of JSON to post: { "title": "Overgrown", "artist": "James Blake", "genre": "ELECTRONIC", "stock": 10, "price": 17.00 }
- Clone the Repository
git clone https://github.com/your-username/record-shop-api.git cd record-shop-api
- Modify application-prod.properties for your database credidentials spring.datasource.url=jdbc:postgresql://localhost:5432/recordshopdb spring.datasource.username=postgres spring.datasource.password=<your_password> spring.jpa.hibernate.ddl-auto=update
- Run the application
- Authentication and Authorisation -> Introduce user authentication with OAuth2.
- Advanced Filtering -> Enable filtering by genres, price ranges, stock levels, or artist names to enhance search capabilities.
- Data Sorting -> Add support for paginated responses and sorting options to improve usability with large datasets.
- API Documentation -> Integrate tools fe. Swagger for comprehensive and interactive API documentation.