From cc75e1dfc1047415297183b24d00a958bd5a79cf Mon Sep 17 00:00:00 2001 From: Pit Friedrich Date: Mon, 25 May 2026 19:15:23 +0200 Subject: [PATCH] [DOC] CLAUDE.md --- CLAUDE.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..b410b2a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,63 @@ +# HikeBuddy + +Hiking assistant app: planning, gear, hike support, tracking. Built for expansion — new features will be added over time. + +## Tech Stack + +- **Java 21**, Spring Boot 4.0.6 +- **Thymeleaf** for server-side rendered UI +- **Maven** (wrapper via `mvnw`) +- **Docker** + Docker Compose for deployment + +## Project Structure + +``` +src/main/java/de/pitfriedrich/hikebuddy/ + HikebuddyApplication.java # Entry point + calculator/ # Hike duration feature + HikeDurationController.java # GET/POST /calculator + HikeDurationService.java # Duration formula logic + HikeDurationForm.java # Form binding (altitudeDifference, distance) + +src/main/resources/ + templates/calculator.html # Thymeleaf template + application.yaml +``` + +**Convention:** each feature lives in its own sub-package under `de.pitfriedrich.hikebuddy`. + +## Build & Run + +```bash +# Run locally +./mvnw spring-boot:run + +# Run tests +./mvnw test + +# Build JAR +./mvnw package -DskipTests + +# Run via Docker Compose (port 8080) +docker compose up --build +``` + +App runs on `http://localhost:8080`. Root `/` redirects to `/calculator`. + +## Key Business Logic + +### Hike Duration Formula (`HikeDurationService`) + +``` +v1 = altitudeDifference (m) / 300 +v2 = distance (km) / 4 +duration (hours) = max(v1, v2) + 0.5 * min(v1, v2) +totalMinutes = round(duration * 60) → displayed as hours + minutes +``` + +## Adding New Features + +1. Create sub-package under `de.pitfriedrich.hikebuddy.` +2. Add Controller, Service, Form/DTO classes +3. Add Thymeleaf template under `src/main/resources/templates/` +4. Update `SPEC.md` checklist when done