This project involves creating a Java web application using Java 17+ and Gradle, with one of the following frameworks: Spring, Micronaut, or Quarkus. The application should provide OpenAPI documentation and an interactive Swagger-UI page. PostgreSQL will be used for data storage, and the application will be delivered as a Docker image and/or using Docker Compose. The focus is on proper separation of concerns, a well-structured package layout, and a suitable architecture, such as a classical layered approach or hexagonal architecture.
- Java Application: Build a Java application that follows best practices with a chosen framework, providing a CRUD REST API.
- Gradle: Use Gradle for dependency management.
- OpenAPI: Document all possible REST interactions.
- PostgreSQL Database: Use PostgreSQL for local data storage.
- Docker: Deliver the application as a Docker image and/or use Docker Compose.
- Book: A book has a title, a genre, a price, and exactly one author. (The library has only one copy of each book.)
- Author: An author has a name, a date of birth, and can have multiple books.
- Member: A member has a unique username, an email, an address, and a phone number.
- Loan: A member can loan up to 5 different books at a time. Each loan has a lend date and a return date (consider only whole days, no timestamps).
- Initialize a new Java project using an initializer, template, or from scratch.
- Set up Gradle for dependency management, including necessary dependencies and plugins.
- Include OpenAPI and provide a Swagger-UI accessible from the base URL of the application.
- Implement CRUD endpoints for
Book
,Author
,Member
, andLoan
, ensuring appropriate error responses.
- Set up a local PostgreSQL database using Docker.
- Create tables reflecting the entities and relationships described above.
- Implement all REST CRUD endpoints for
Book
,Author
,Member
, andLoan
. - Ensure proper constraints and relationships (e.g., unique constraints, relationships between entities).
- Leverage the framework and additional libraries as necessary.
- Follow best practices for project layout and structure code according to a suitable software architecture.
- Create a
Dockerfile
to containerize the Java application. - Set up
docker-compose.yml
to manage the Java application and PostgreSQL as services. - Ensure the application can be run with a single
docker-compose up
command.
- Source Code: Java application code with Gradle configurations.
- PostgreSQL Schema: Database schema and any SQL scripts (if not using embedded migrations).
- Dockerfile: File to containerize the Java application.
- Docker Compose:
docker-compose.yml
to run all services. - Documentation: README.md with instructions to build and run the application with Docker.
- Functionality: Does the application meet all the specified requirements?
- Code Quality: Is the code correct, well-structured, and easy to understand?
- Clean Code: Are clean code practices followed?
- CRUD Endpoints: Are the REST API endpoints integrated correctly and efficiently?
- Database Integration: Is PostgreSQL used appropriately for storing data?
- Framework Usage: Are the core utilities of the chosen framework leveraged?
- Software Architecture: Does the architecture suit the project?
- Dockerization: Does the Docker setup work smoothly, and could it be used in Kubernetes?
- Documentation: Are the instructions clear and complete?
- Include necessary environment variables in a
.env
file and reference them correctly in the Docker setup. - Use meaningful commit messages and structure the Git history logically if submitting via a Git repository.
- Handle edge cases and error handling to ensure the robustness of the application.
- If certain requirements are unclear or missing, make assumptions and document them accordingly.