This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A Spring Boot web application (WAR) that serves as a read-only viewer of statistical operations data for ISTAC (Canary Islands Statistics Institute). It is a headless API consumer — it has no own database and fetches all data from external Metamac REST APIs, then renders it via Thymeleaf server-side templates.
Main branch for PRs: develop
# Build (dev profile is default)
mvn clean install
# Run locally
mvn spring-boot:run
# Run tests
mvn test
# Run a single test class
mvn test -Dtest=ClassName
# Production build
mvn -Penv clean install
# SonarQube analysis
mvn sonar:sonarLayered architecture — no repository/persistence layer, only service clients:
web/OperationController → service/ → Metamac REST APIs (external)
↓
Thymeleaf templates
Key packages under es.gobcan.istac.statistical.operations.external:
| Package | Purpose |
|---|---|
web/ |
OperationController — the only controller; handles all page routes |
service/ |
Interfaces for fetching data from remote APIs |
service/impl/ |
Implementations: OperationServiceImpl, SrmServiceImpl, HtmlServiceImpl, MetadataServiceImpl, StatisticalResourcesServiceImpl, StatisticalOperationsConfigurationServiceImpl |
mapper/ |
Map Metamac API response objects to local DTOs |
web/dto/ |
Local DTOs: Operation, Instance, Category, Contact, PagedResult |
config/ |
Spring config classes; ApplicationProperties holds the installationType |
Routes (all GET, all render Thymeleaf views):
/— operations list/operations/{id}— single operation detail/operations/subject-area/{nestedId}— operations by subject area/operations/{id}/instances/{instanceId}— instance detail
Installation modes: configured via application.installationType — INTERNAL (full internal data) or EXTERNAL (public-facing filtered data). This controls which Metamac API variants are called.
The app consumes these Metamac/eDatos REST APIs (configured in application-dev.yml):
metamac-statistical-operations-rest-external-api— public operations datametamac-statistical-operations-rest-internal-api— internal/full operations datametamac-srm-rest-external-api— SRM classifications and categoriesmetamac-statistical-resources-rest-api-common— statistical resource collections
API base URLs are set via environment-specific YAML properties (endpoint.statistical.operations.*).
External config is loaded from a path defined in data-location.properties:
- Windows:
W:/data/istac/statistical-operations-external/config/ - Linux:
/data/istac/statistical-operations-external/config/
Spring profiles:
dev— local development (DevTools restart on, Thymeleaf cache off)env— production/staging (HikariCP connection pooling for edatos-core DB)
Languages supported: Spanish (es), Catalan (ca), English (en).
Message files live in src/main/resources/i18n/messages*.properties. The LanguageUtil class in web/util/ resolves the active locale.
Templates use Thymeleaf 3 (HTML mode) located in src/main/resources/templates/views/. Frontend libs (jQuery 3.4.1, Handlebars 4.0.14, Font Awesome 4.7.0) are served as webjars — no npm/node build step.
- Java 1.8
- Spring Boot 1.5.4 (note: older version, no auto-configuration features from newer Boot)
- Thymeleaf 3.0.9
- Packaged as WAR (not executable JAR)