|
| 1 | +# Spring Boot Admin |
| 2 | +Spring Boot Admin is a multi-module Maven project providing an admin interface for Spring Boot applications that expose actuator endpoints. It consists of a Vue.js frontend and Java backend components with 19 Maven modules. |
| 3 | + |
| 4 | +Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. |
| 5 | + |
| 6 | +## Working Effectively |
| 7 | + |
| 8 | +### Prerequisites and Environment Setup |
| 9 | +- Install Java 17 (OpenJDK Temurin 17.0.16+ recommended) - project requires exactly Java 17 |
| 10 | +- Install Node.js 22.18.0 exactly (project specifies this in .nvmrc and package.json) |
| 11 | +- Download Node.js 22.18.0: `curl -fsSL https://nodejs.org/dist/v22.18.0/node-v22.18.0-linux-x64.tar.xz -o /tmp/node.tar.xz` |
| 12 | +- Extract and configure PATH: `cd /tmp && tar -xf node.tar.xz && export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH"` |
| 13 | +- Verify versions: `java -version` (should show 17.x) and `node --version` (should show v22.18.0) |
| 14 | + |
| 15 | +### Building the Project |
| 16 | +- **NEVER CANCEL builds - they take time but will complete successfully** |
| 17 | +- **CRITICAL**: Set timeout to 20+ minutes for builds, 60+ minutes for tests |
| 18 | +- Clean compile: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw clean compile -B --no-transfer-progress -DskipTests` -- takes ~10.5 minutes |
| 19 | +- Full package: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw package -B --no-transfer-progress -DskipTests` -- takes ~4 minutes |
| 20 | +- Install to local repository: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw install -B --no-transfer-progress -DskipTests` -- takes ~1.5 minutes |
| 21 | + |
| 22 | +### Testing |
| 23 | +- **NEVER CANCEL test runs - set 60+ minute timeouts** |
| 24 | +- Full test suite: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw test -B --no-transfer-progress` -- takes 20-40 minutes |
| 25 | +- UI tests only: `cd spring-boot-admin-server-ui && export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && npm run test` -- takes ~44 seconds |
| 26 | +- UI build only: `cd spring-boot-admin-server-ui && export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && npm run build` -- takes ~16 seconds |
| 27 | + |
| 28 | +### Code Quality and Formatting |
| 29 | +- Format Java code: `./mvnw spring-javaformat:apply` |
| 30 | +- Check Java formatting: `./mvnw spring-javaformat:validate` |
| 31 | +- Lint UI code: `cd spring-boot-admin-server-ui && npm run lint` |
| 32 | +- Format UI code: `cd spring-boot-admin-server-ui && npm run format:fix` |
| 33 | +- **ALWAYS** run `./mvnw spring-javaformat:apply` and UI formatting before committing |
| 34 | +- **ALWAYS** run `./mvnw checkstyle:check` to verify compliance |
| 35 | + |
| 36 | +### Running Sample Applications |
| 37 | +- Build and install all modules first: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw install -B --no-transfer-progress -DskipTests` |
| 38 | +- Run servlet sample: `cd spring-boot-admin-samples/spring-boot-admin-sample-servlet && export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ../../mvnw spring-boot:run -Dspring-boot.run.profiles=dev,insecure` |
| 39 | +- Access UI at: `http://localhost:8080` (username: user, password shown in logs or use insecure profile) |
| 40 | +- Application starts in ~3 seconds and shows "all up" status with registered instance |
| 41 | + |
| 42 | +### UI Development Mode |
| 43 | +- For UI development: `cd spring-boot-admin-server-ui && npm run build:watch` (builds on file changes) |
| 44 | +- Configure Spring Boot Admin Server with: |
| 45 | + ``` |
| 46 | + spring.boot.admin.ui.cache.no-cache: true |
| 47 | + spring.boot.admin.ui.resource-locations: file:../../spring-boot-admin-server-ui/target/dist/ |
| 48 | + spring.boot.admin.ui.template-location: file:../../spring-boot-admin-server-ui/target/dist/ |
| 49 | + spring.boot.admin.ui.cache-templates: false |
| 50 | + ``` |
| 51 | + |
| 52 | +## Validation Scenarios |
| 53 | +- **MANUAL VALIDATION REQUIRED**: After building and running, always test actual functionality |
| 54 | +- Launch sample application and verify Spring Boot Admin UI loads at `http://localhost:8080` |
| 55 | +- Verify application registration: Should show "spring-boot-admin-sample-servlet" with UP status |
| 56 | +- Test navigation: Click on Applications, Wallboard, and instance details |
| 57 | +- Check endpoints: Verify actuator endpoints are detected and accessible |
| 58 | +- Test monitoring features: Instance details should show health, metrics, loggers, etc. |
| 59 | + |
| 60 | +## Key Modules and Locations |
| 61 | + |
| 62 | +### Primary Components |
| 63 | +- **Root**: `/` - Main Maven reactor project (pom.xml) |
| 64 | +- **Server Backend**: `spring-boot-admin-server/` - Core Spring Boot Admin server functionality |
| 65 | +- **UI Frontend**: `spring-boot-admin-server-ui/` - Vue.js 3 web interface with Vite build |
| 66 | +- **Client**: `spring-boot-admin-client/` - Client library for connecting applications |
| 67 | +- **Documentation**: `spring-boot-admin-docs/` - Asciidoc documentation |
| 68 | + |
| 69 | +### Starter Modules |
| 70 | +- **Server Starter**: `spring-boot-admin-starter-server/` - Auto-configuration for servers |
| 71 | +- **Client Starter**: `spring-boot-admin-starter-client/` - Auto-configuration for clients |
| 72 | + |
| 73 | +### Sample Applications (in spring-boot-admin-samples/) |
| 74 | +- **servlet**: Standard servlet-based sample (recommended for testing) |
| 75 | +- **reactive**: WebFlux reactive sample |
| 76 | +- **eureka**: Eureka discovery integration |
| 77 | +- **consul**: Consul discovery integration |
| 78 | +- **hazelcast**: Hazelcast session management |
| 79 | +- **war**: WAR deployment sample |
| 80 | +- **zookeeper**: Zookeeper discovery integration |
| 81 | + |
| 82 | +### Infrastructure |
| 83 | +- **Dependencies**: `spring-boot-admin-dependencies/` - Dependency management BOM |
| 84 | +- **Build**: `spring-boot-admin-build/` - Build configuration and tooling |
| 85 | +- **Server Cloud**: `spring-boot-admin-server-cloud/` - Spring Cloud integrations |
| 86 | + |
| 87 | +## Common Issues and Solutions |
| 88 | + |
| 89 | +### Build Issues |
| 90 | +- Node.js version mismatch: Always use exact PATH override with v22.18.0 |
| 91 | +- Missing dependencies: Run `./mvnw install` to install all modules to local Maven repository |
| 92 | +- Checkstyle violations: Run `./mvnw spring-javaformat:apply` to auto-fix formatting |
| 93 | +- UI build failures: Verify Node.js version and run `npm install` in spring-boot-admin-server-ui/ |
| 94 | +- "Command timed out": Increase timeout - builds legitimately take 10+ minutes |
| 95 | + |
| 96 | +### Runtime Issues |
| 97 | +- Sample app dependency resolution: Must run `./mvnw install` first to populate local repository |
| 98 | +- Config server connection refused: Normal warning, config server is optional in dev mode |
| 99 | +- Security warnings: Use `insecure` profile for development to bypass authentication |
| 100 | + |
| 101 | +## Development Workflow |
| 102 | +1. **Setup**: Configure Node.js 22.18.0 in PATH: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH"` |
| 103 | +2. **Initial Build**: Run `./mvnw clean compile` to verify everything builds (~10.5 minutes - be patient) |
| 104 | +3. **Install Dependencies**: Run `./mvnw install -DskipTests` for sample app dependencies (~1.5 minutes) |
| 105 | +4. **Make Changes**: Edit code in appropriate modules |
| 106 | +5. **Format Code**: Run `./mvnw spring-javaformat:apply` and UI `npm run format:fix` |
| 107 | +6. **Test Build**: Run build commands to verify changes don't break anything |
| 108 | +7. **Manual Validation**: Start sample application and test UI functionality |
| 109 | +8. **Final Check**: Ensure formatting and linting pass before committing |
| 110 | + |
| 111 | +## Critical Timing Information |
| 112 | +- **NEVER CANCEL**: Build commands take significant time but complete successfully |
| 113 | +- Clean compile: ~10.5 minutes (normal, expected) |
| 114 | +- Package build: ~4 minutes |
| 115 | +- Install build: ~1.5 minutes |
| 116 | +- Full test suite: 20-40 minutes (set 60+ minute timeout) |
| 117 | +- UI tests only: ~44 seconds |
| 118 | +- UI build only: ~16 seconds |
| 119 | +- Application startup: ~3 seconds |
| 120 | + |
| 121 | +## Technology Stack |
| 122 | +- **Backend**: Spring Boot 3.5, Java 17, Maven multi-module |
| 123 | +- **Frontend**: Vue.js 3, Vite, TypeScript, Tailwind CSS |
| 124 | +- **Testing**: JUnit 5 (Java), Vitest (UI), Playwright integration |
| 125 | +- **Build**: Maven 3.9+, Node.js 22.18.0, npm |
| 126 | +- **Code Quality**: Spring Java Format, Checkstyle, ESLint, Prettier |
| 127 | + |
| 128 | +## Repository Structure Overview |
| 129 | +``` |
| 130 | +spring-boot-admin/ # Root project (19 modules) |
| 131 | +├── .github/ # GitHub configuration |
| 132 | +├── spring-boot-admin-build/ # Build configuration |
| 133 | +├── spring-boot-admin-client/ # Client library |
| 134 | +├── spring-boot-admin-dependencies/ # Dependency management |
| 135 | +├── spring-boot-admin-docs/ # Documentation (Asciidoc) |
| 136 | +├── spring-boot-admin-samples/ # Sample applications |
| 137 | +│ ├── spring-boot-admin-sample-servlet/ # Main sample (recommended) |
| 138 | +│ ├── spring-boot-admin-sample-reactive/ # WebFlux sample |
| 139 | +│ └── [other samples]/ # Various integration samples |
| 140 | +├── spring-boot-admin-server/ # Core server implementation |
| 141 | +├── spring-boot-admin-server-cloud/ # Spring Cloud integrations |
| 142 | +├── spring-boot-admin-server-ui/ # Vue.js frontend |
| 143 | +│ ├── src/main/frontend/ # Vue.js source code |
| 144 | +│ ├── package.json # Node.js dependencies |
| 145 | +│ └── .nvmrc # Node.js version specification |
| 146 | +├── spring-boot-admin-starter-*/ # Spring Boot auto-configuration |
| 147 | +├── mvnw # Maven wrapper |
| 148 | +└── pom.xml # Root Maven configuration |
| 149 | +``` |
0 commit comments