Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture

The application has a browser client, a companion API, and a database seeder. These provide an independent interface example; they are not a deployment of the CE-RISE service architecture.

Components

ComponentLocationResponsibility
Vue clientclient/Navigation, product forms, passport views, questionnaires, charts, and environmental dataset editing
Hono APIapi/Product access, example scoring, reference-data queries, and assessment storage
SQLite databaseapi/data/products.db for source executionProduct records, field definitions, questionnaires, answers, environmental datasets, and reference data
Database seederdb-seed/Create the database, load reference definitions, and generate synthetic products

The browser sends relative /api/... requests through useFetcher. During source development, Vite proxies these requests to port 5000.

Data and persistence

The example has three distinct sources of definitions:

  • Passport fields: the JSON files in db-seed/models/ define the UI’s sections, groups, and fields. They are local presentation definitions, not generated CE-RISE validation schemas.
  • RE questionnaires: fetchReIndicators.js retrieves the published calculation definitions and supporting indicator files when the database is seeded.
  • Environmental references: db-seed/see-reference/ contains the ontology options, study options, BONSAI catalogue, elementary-flow index, and climate factors used by the editor.

The API stores products and assessments in SQLite. Dashboard layout is separate and stored in browser local storage. Copying a layout therefore does not copy its underlying products or assessment records.

The seeder replaces the database tables. Its RE sources are fetched from published Pages and the source branch rather than a pinned model release. Refreshing the database can change questionnaires; saved assessments do not record a complete source-model version history.

API responsibilities

Route familyRole
/api/productsProduct listing, import, creation, editing, and deletion
/api/products/:id/recalculatorsAvailable questionnaires and stored RE assessment summaries
/api/products/:id/recalculators/:indicatorQuestionnaire content, draft answers, and example scoring
/api/products/:id/seeLoad and save the environmental editor’s dataset
/api/products/:id/see/prefillConstruct a starting dataset from the product record
/api/dpp-schemaUI field definitions
/api/re-indicatorsLoaded RE configurations
/api/seeEnvironmental options and searchable reference data

The API contract is specific to this interface. Replacing its base URL with a HEX Core URL is not sufficient: requests, records, validation, and returned results need an adapter or a revised API implementation.

Authentication boundary

The client uses Keycloak for browser sign-in and sends its bearer token to the API. The API reads the token’s user identifier without verifying its signature, issuer, audience, or expiry. Its ownership filters are therefore not a security boundary.

Seeded products are shared, and their assessment data can be changed through the example API. A connected application needs explicit permissions for reading and changing records, including shared examples. See Connecting services before exposing an instance to other users.