https://github.com/ksbrwsk/reactive-people-postgresql
Spring Boot Webflux / R2dbc example
https://github.com/ksbrwsk/reactive-people-postgresql
docker docker-compose postgresql r2dbc reactive restassured restdocs spring-boot swagger testcontainers
Last synced: about 1 month ago
JSON representation
Spring Boot Webflux / R2dbc example
- Host: GitHub
- URL: https://github.com/ksbrwsk/reactive-people-postgresql
- Owner: ksbrwsk
- Created: 2020-12-17T17:55:04.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-05-05T04:03:48.000Z (5 months ago)
- Last Synced: 2025-05-12T14:11:42.993Z (5 months ago)
- Topics: docker, docker-compose, postgresql, r2dbc, reactive, restassured, restdocs, spring-boot, swagger, testcontainers
- Language: Java
- Homepage:
- Size: 280 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# reactive-people-postgresql
#### reactive Spring Boot example, covering Webflux, R2dbc, Testcontainers, Open API, RestDocs.

**Prerequisites:**
* [Java 21](https://openjdk.net/)
* [Apache Maven](https:http://maven.apache.org/)
* [Docker](https://www.docker.com/)
* Optional [Postman](https://www.postman.com/)**Themes:**
* Spring Webflux
* Router Functions/Handler Functions
* R2DBC Database Connectivity
* Unit Testing
* Integration Testing with Testcontainers
* Docker build/compose
* OpenAPI / Swagger API Documentation
* Spring RestDocs documentationIf you have Docker installed, grab a PostgreSQL image from Docker Hub and run the image.
```bash
docker pull postgres:16-alpine
docker run --name postgresql -e POSTGRESQL_PASSWORD=password123 -e POSTGRES_DB=spring -p 5432:5432 postgres:15.4-alpine
```
Or else, grab the app image via
```bash
docker pull ksabrwsk/reactive-people-postgresql:1.0.0
```Application properties can be configured in
```bash
reactive-people-postgresql/src/main/resources/application.properties
```#### How to build and run
Type
```bash
mvn package
mvn spring-boot:run
```to build and run the application on your local environment.
To run the app as a Docker Container type the following commands to build
an run the image:
```bash
docker build ./ -t reactive-people-postgresql
docker-compose up --force-recreate
```Use curl, httpie etc. to call the HTTP Endpoints, or use Postman, a collection file is located under
```bash
reactive-people-postgresql.postman_collection.json
```Point your browser to
```bash
http://localhost:8080/swagger-ui.html
```
to try out the API or see the documentation.Point your browser to
```bash
http://localhost:8080/docs/index.html
```
to read the RestDOCs API documentation.