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
| Component | Location | Responsibility |
|---|---|---|
| Vue client | client/ | Navigation, product forms, passport views, questionnaires, charts, and environmental dataset editing |
| Hono API | api/ | Product access, example scoring, reference-data queries, and assessment storage |
| SQLite database | api/data/products.db for source execution | Product records, field definitions, questionnaires, answers, environmental datasets, and reference data |
| Database seeder | db-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.jsretrieves 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 family | Role |
|---|---|
/api/products | Product listing, import, creation, editing, and deletion |
/api/products/:id/recalculators | Available questionnaires and stored RE assessment summaries |
/api/products/:id/recalculators/:indicator | Questionnaire content, draft answers, and example scoring |
/api/products/:id/see | Load and save the environmental editor’s dataset |
/api/products/:id/see/prefill | Construct a starting dataset from the product record |
/api/dpp-schema | UI field definitions |
/api/re-indicators | Loaded RE configurations |
/api/see | Environmental 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.