Skip to content

lecousin/lc-spring-data-r2dbc-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lc-spring-data-r2dbc sample

This project illustrate the usage of lc-spring-data-r2dbc with multiple databases into a single Spring Boot application.

It is composed of the following modules:

  • user-service provides a list of user with encrypted password, connected to a PostgreSQL database
  • auth-service provides security with a login REST method and uses an in memory H2 database to store sessions
  • book-service provides a list of books with linked authors and publisher, stored in a MySQL database, and a REST method to search books
  • app is the Spring Boot application startup containing all other modules and the database configuration
  • angular-app is the Angular GUI built as resource in the app module

The databases are configured in application.yaml, and changing this configuration allows to easily switch from one database to another.

Each module is configuring its own database connection, based on the application.yaml file, by extending class LcR2dbcEntityOperationsBuilder like in BookConfig

To test the application:

  • Run the ExampleApplication class
  • Connect to http://localhost:8080
  • Before to login, click on the "Init database" button, to create tables and some content
  • Login with user "test" and password "test"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published