Skip to content

Latest commit

 

History

History
96 lines (66 loc) · 3.66 KB

CLAUDE.md

File metadata and controls

96 lines (66 loc) · 3.66 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this project is

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 and run commands

# 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:sonar

Architecture

Layered 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.

External dependencies

The app consumes these Metamac/eDatos REST APIs (configured in application-dev.yml):

  • metamac-statistical-operations-rest-external-api — public operations data
  • metamac-statistical-operations-rest-internal-api — internal/full operations data
  • metamac-srm-rest-external-api — SRM classifications and categories
  • metamac-statistical-resources-rest-api-common — statistical resource collections

API base URLs are set via environment-specific YAML properties (endpoint.statistical.operations.*).

Configuration

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)

Internationalisation

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.

Frontend

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.

Tech stack versions

  • 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)