This repository uses Redis core data structures, Streams, RediSearch and TimeSeries to build a Java/Spring Boot/Spring Data Redis Reactive application that shows a searchable transaction overview with realtime updates as well as a personal finance management overview with realtime balance and biggest spenders updates. UI in Bootstrap/CSS/Vue.
Features in this demo:
- Redis 8.x
- Redis Streams for the realtime transactions
- Redis TimeSeries for the balance over time
- RediSearch for searching transactions
- Sorted Sets for the 'biggest spenders'
- Redis hashes for session storage (via Spring Session)
- JDK 24 (https://openjdk.java.net/install/index.html). Not needed if you're using Docker.
- Maven. Not needed if you're using Docker.
- Docker Desktop (https://www.docker.com/products/docker-desktop), or Colima with a docker/k8s/containerd runtime
- For running on Azure only: Azure CLI (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
- For running on Azure only: Azure Spring Cloud extension for the Azure CLI (https://docs.microsoft.com/en-us/cli/azure/spring-cloud?view=azure-cli-latest)
- For running on Kubernetes: a Kubernetes cluster
- Install NodeJS using NVM if you want to update the Web UI
brew install nvm
mkdir ~/.nvm
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.zshrc
echo '[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh"' >> ~/.zshrc
source ~/.zshrc
# Installer la version LTS
nvm install --lts
nvm use --lts
# Vérifier
node -v
npm -v
- Git clone this repository
docker compose buildwill produce a local maven build and local docker image with the applicationdocker compose upwill start Redis and the application- Navigate to http://localhost:8080
- Login with user
lars(the passwordlarsjeis already configured for you) - Download/use Redis Insight to explore the content of the Redis database (the Redis on docker is exposed on localhost:6379)
- Stop and clean with
docker compose down -v --rmi local --remove-orphans
-
Follow the steps from 'Running locally'
-
Make sure you are logged into the Azure CLI
-
Add the Azure Spring Cloud extension to the Azure CLI
az extension add --name spring-cloudIf you already have the extension, make sure it's up to date usingaz extension update --name spring-cloud -
Create an Azure Spring Cloud instance using
az spring-cloud create -n acrebank -g rdsLroACRE -l northeurope(this may take a few minutes) -
Create an App in the newly created Azure Spring Cloud instance using
az spring-cloud app create -n acrebankapp -s acrebank -g rdsLroACRE --assign-endpoint true --runtime-version Java_11 -
Modify the application.properties so it points to your newly created ACRE instance
spring.redis.host=your ACRE hostname spring.redis.port=your ACRE port (default: 10000) spring.redis.password= your ACRE access key
-
Modify the application.properties so the websocket config will point to the Azure Spring Cloud app instance endpoint createed in step 3.
stomp.host=your ASC app endpoint URL (Default: <appname>-<service-name>.azuremicroservices.io) stomp.port=443 stomp.protocol=wss
-
Rebuild the app using
./mvnw package -
Deploy the app to Azure Spring Cloud using
az spring-cloud app deploy -n acrebankapp -s acrebank -g rdsLroAcre --jar-path target/redisbank-0.0.1-SNAPSHOT.jar
To get the application logs:
az spring-cloud app logs -n acrebankapp -g rdsLroAcre -s acrebank
Note: project is compiled with JDK11 as that's currently the max LTS version that's supported by Azure Spring Cloud. Project will run fine when running locally or on other platforms up to JDK16.
Please see OpenShift via S2I.
Please see Deploy on Kubernetes with Redis OSS
Please see Deploy on Kubernetes with Redis Enterprise
- Thread safety. Data is currently generated off of a single stream of transactions, which means it's the same for all users. Not a problem with the current iteration because it's single user, but beware when expanding this to multi-user.
- Hardcoded values. Code uses hardcoded values throughout the code, these need to be replaced with proper variables.
-
Start a redis 8 container listening on default port 6379
-
Start Spring
./mvnw spring-boot:runor with Debug modeMenu Run and Debug → “create a launch.json” → choose Java → and replace by this :
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug RedisBank Backend",
"request": "launch",
"mainClass": "com.redislabs.demos.redisbank.RedisbankApplication",
"projectName": "redisbank",
"args": "",
"env": {
"SPRING_PROFILES_ACTIVE": "dev"
}
}
]
}Then, in the Run Palette, click on the green arrow left of "RedisBankApplication"
-
Start the web application
cd frontend; npm run dev
cd frontend
npm ci(from frontend folder)
npm run copy:to-backend(from root of the project)
./docker-rebuild.sh

