This project is meant to be my own playground for learning some of the latest Spring technologies, particularly in the context of building reactive applications with GraphQL.
It uses Spring Boot, Spring GraphQL, Spring WebFlux, Spring Modulith, and MongoDB for persistence.
To get started with this project, you can clone the repository and run the following command to build and run the application:
./gradlew bootRunThis will start the application on port 8080 by default. You can then access the GraphQL endpoint at http://localhost:8080/graphql.
You can also run the application in development mode with hot reloading by using:
./gradlew bootRun --continuousThis will allow you to make changes to the code and see them reflected immediately without needing to restart the application. You can also build a Docker image of the application using the following command:
./gradlew bootBuildImageThis will create a Docker image that you can run with:
docker run -p 8080:8080 <image-name>You can also build an OCI image using:
./gradlew bootBuildOciImageThis will create an OCI image that can be used in container orchestration platforms like Kubernetes.
- GraphQL: The project uses Spring for GraphQL to provide a flexible API for querying and mutating data.
- Reactive Programming: It leverages Spring WebFlux for building reactive applications, allowing for non-blocking I/O operations.
- MongoDB: The application uses Spring Data MongoDB for reactive data access, enabling efficient data operations in a non-blocking manner.
- Spring Modulith: This project is structured using Spring Modulith, which helps in organizing the codebase into modules, promoting separation of concerns and modularity.
- DevTools: Spring Boot DevTools is included for development convenience, providing features like automatic restarts and live reload.
- Docker and OCI Support: The project can be packaged as a Docker image or OCI image, making it easy to deploy in containerized environments.
- Testing: The project includes a comprehensive test suite using JUnit 5 and Spring's testing support, ensuring the reliability of the application.
- Documentation: The project is well-documented, with a focus on providing clear instructions for setup, usage, and development.
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Spring for GraphQL
- Spring Boot DevTools
- Spring Modulith
- Spring Reactive Web
- MongoDB Reactive Support
The following guides illustrate how to use some features concretely:
These additional references should also help you: