A Spring Boot web application for managing subscriptions and categories, secured with Keycloak (OAuth2/OIDC) and backed by PostgreSQL with Redis caching.
- Keycloak-based SSO login (OAuth2 Authorization Code + OIDC)
- Category browsing with Redis-cached queries
- User registration and profile management via Keycloak Admin Client
- Thymeleaf server-side rendered UI
| Layer | Technology |
|---|---|
| Framework | Spring Boot 3.5.5 (Java 24) |
| Security | Spring Security, Keycloak 26, OAuth2/OIDC |
| Database | PostgreSQL |
| Cache | Redis |
| UI | Thymeleaf |
| Build | Maven |
- Java 24+
- Maven 3.9+
- PostgreSQL running on
localhost:5432 - Redis running on
localhost:6379 - Keycloak running on
localhost:9090with a realm namedsubsHub
git clone <repository-url>
cd store- Start Keycloak on port
9090. - Create a realm named
subsHub. - Create a client named
subsHubwith:- Client authentication enabled
- Authorization Code grant type
- Valid redirect URI:
http://localhost:8080/*
- Copy the client secret into
application.properties.
Create a PostgreSQL database and user:
CREATE USER myuser WITH PASSWORD 'mypassword';
CREATE DATABASE "subsHub" OWNER myuser;Edit src/main/resources/application.properties and update the following values to match your environment:
spring.datasource.url=jdbc:postgresql://localhost:5432/subsHub
spring.datasource.username=myuser
spring.datasource.password=mypassword
spring.security.oauth2.client.registration.keycloak.client-secret=<your-client-secret>
spring.security.oauth2.client.provider.keycloak.issuer-uri=http://localhost:9090/realms/subsHub
spring.data.redis.host=localhost
spring.data.redis.port=6379mvn spring-boot:runThe application will start on http://localhost:8080.
| URL | Description |
|---|---|
http://localhost:8080/ |
Public landing page |
http://localhost:8080/home |
Authenticated home page (requires login) |
http://localhost:8080/logout |
Logout (redirects to Keycloak) |
Navigating to /home will redirect unauthenticated users to the Keycloak login page. After a successful login the user is returned to the home page.
mvn testThis project is for educational and demonstration purposes. No license is currently specified — all rights reserved by the author.