This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Standard run
./gradlew bootRun
# Run with specific profile (local, dev, test, docker-keycloak)
./gradlew bootRun --args='--spring.profiles.active=local'
# Build and run with debugging
./run.sh# Run all tests
./gradlew test
# Run a specific test class
./gradlew test --tests TestClassName
# Run a specific test method
./gradlew test --tests TestClassName.methodName# Build JAR
./gradlew bootJar
# Check dependency updates
./gradlew dependencyUpdatesThis is a Spring Boot demo application showcasing the Spring User Framework. It implements a complete user management system with authentication, authorization, and user lifecycle management.
-
MVC with Service-Repository Pattern: Controllers delegate to services, which use repositories for data access. The framework provides base services that are extended here.
-
Event-Driven Extension: The demo extends the user framework by adding an Event management system, showing how to build on top of the framework's user management.
-
Security Architecture:
- Spring Security with form-based and OAuth2/OIDC authentication
- Role-based access control with hierarchical roles
- Audit logging for security events in separate log file
-
Testing Strategy:
- Unit tests for individual components
- Integration tests using
@IntegrationTestannotation (combines Spring Boot test setup) - E2E tests with Playwright (in
playwright/directory) - API tests using MockMvc for REST endpoints
-
No Custom User Entity: This demo uses the framework's User entity directly. Custom user data goes in separate entities (like UserProfile).
-
Configuration Profiles:
local: Development with local databasetest: Integration testing with H2docker-keycloak: OIDC integration with Keycloak
-
Template Organization: All Thymeleaf templates are in
src/main/resources/templates/with subdirectories for user management (email/,password/, etc.) -
Test Data Builders: Use the builder classes in
src/test/java/com/devondragon/springdemo/test/data/for consistent test data creation.
The application demonstrates framework usage through:
- Custom controllers that extend framework functionality (EventController)
- Service extensions (CustomUserService extends UserService)
- Configuration of framework components via application.yml
- Event listeners for user lifecycle events
When modifying user-related functionality, check if the Spring User Framework already provides it before implementing custom solutions.