Spring boot + WebFlux (Router Function) + Spock codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a backend of a fully fledged fullstack application built with **Spring boot + WebFlux (Router Function) ** including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the **Spring boot + WebFlux (Router Function) ** community style guides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
It uses Java 17, preferably openJdk 17, and Spring Reactive Stack: WebFlux + Spring Data Reactive MongoDB.
It provides ability to handle concurrency with a small number of threads and scale with fewer hardware resources, with functional developemnt approach.
- WebFlux
NOTE: spring boot 5 webflux uses Reactor version 3 - MongoDB Reactive
It uses embedded MongoDB database for demonstration purposes.
The quality & architecture of this Conduit implementation reflect something similar to an early stage startup's MVP: functionally complete & stable, but not unnecessarily over-engineered.
- api - web layer which contains router function (AppRounter) and handlers (note: spock unit tests).
- dto - non-persistence tier data structures
- persistence - includes entities, repositories and a support classes
- exceptions - exceptions and exception handlers.
- security - security settings.
- service - contains the business logics (note: spock unit tests).
- validation - custom validators and validation settings.
- Integration tests covers followings,
- End to End api tests using test harness covers all the happy paths.
- Repository test on customized respository impl
- Security
- Unit tests utilize spock framework to mock the scenarios that not easily repeatable by Integration test
- api handlers
- services
You need Java 17 installed.
./gradlew bootRun
To test that it works, open a browser tab at http://localhost:8080/api/tags .
Alternatively, you can run
curl http://localhost:8080/api/tags
The repository contains a lot of test cases to cover both api test and repository test.
./gradlew test
Please fork and PR to improve the project.
Thanks to project Spring Boot + WebFlux + MongoDB from which this project adopted its code bases of the data model, with the Functional WebFlux Approach (Router Function).