Skip to content

Project Layout

Copilot edited this page Nov 23, 2026 · 3 revisions

Overview

Path Purpose
src/ SvelteKit single-page frontend (no SSR) and the TypeScript it uses
src-tauri/src/ Tauri desktop application: commands, state, and platform wiring
src-tauri/crates/epikrise-core/ Domain types, template engine, output linting, and case session
src-tauri/crates/epikrise-ingest/ Extraction pipeline for files, images, OCR, and plain text
src-tauri/crates/epikrise-llm/ Provider profiles, the LlmClient abstraction, and credential storage
locales/ Fluent message catalogs, one folder per language
scripts/ Build, packaging, OCR, release, and Windows helper scripts
.devcontainer/ Dev container definition and setup scripts
.github/ Workflows (see GitHub Actions), issue templates, and the PR template
docs/ Privacy policies published with GitHub Pages (Jekyll)
static/ Static files copied as-is into the frontend build
store-assets/ Microsoft Store listing images and metadata
tests/ Vitest unit and tooling tests; Playwright specs in tests/e2e/
src-tauri/capabilities/, src-tauri/icons/, src-tauri/msix/ Tauri permission capabilities, application and Store icons, and the Store MSIX manifest
templates/, fixtures/clinical/ Git-ignored local clinical material; never commit real or realistic content

The three library crates deliberately have no Tauri dependency. Put business logic there, not in src-tauri/src/, so it can be unit-tested without a webview.

Frontend (src/)

  • src/routes/+page.svelte is the main workspace: inputs, generated output, and draft controls.
  • src/lib/i18n.ts builds the Fluent bundles, resolves the UI locale, and exposes translate.
  • src/lib/output-format.ts and src/lib/theme.ts hold output formatting and theme helpers.
  • src/bindings.ts is generated by Tauri Specta from src-tauri/src/lib.rs. Do not edit it by hand; regenerate it by running the app or the build that exports the bindings.

Tauri application (src-tauri/src/)

  • lib.rs registers the Tauri commands, holds application state, and exports the Specta bindings.
  • policy.rs reads the administrator policy.toml from its OS-specific system path and enforces it in the backend.
  • updater.rs and windows_updater_features.rs implement the direct-release updater, including Windows-specific behavior.
  • native_menu.rs builds the native application menu.
  • startup_dialog.rs shows the startup dialog, including locale resolution for it.
  • linux_session_bus.rs provides Linux session-bus integration.
  • main.rs is the binary entry point and only calls into the library.

Library crates (src-tauri/crates/)

Each crate keeps its unit tests in an inline mod tests in lib.rs.

epikrise-core

  • Clinical template types (ClinicalTemplate, variables, sections, output rules) and TemplateError.
  • lint_output, which checks generated text against a template's output rules.
  • Extracted-input types (ExtractedBlock, InputProvenance, ExtractionMethod) and CaseSession, the in-memory case state.
  • Redacted<T>, a wrapper whose debug output does not reveal its contents.

epikrise-ingest

  • Entry points for files (extract_file, extract_file_with_ocr), images (extract_image_with_ocr, extract_image_for_vision), plain text (extract_text_file, extract_raw_text), and PDF OCR targets (pdf_page_texts_and_ocr_targets).
  • IngestError and OcrDiagnosticCategory for typed, non-clinical error reporting.

epikrise-llm

  • ProviderAdapter and ProviderProfile describe the supported providers and their settings.
  • GenerationParams and ReasoningEffort control output limits and reasoning.
  • LlmClient is the trait every provider call goes through; GenaiLlmClient is the implementation.
  • CredentialStore is the storage trait; KeyringCredentialStore keeps API keys in the OS keychain.
  • credential_account_id and parse_credential_account build and read keychain account identifiers.

Other directories

  • locales/<locale>/app.ftl holds the UI messages. Message IDs must match across all shipped catalogs. See Localization.
  • scripts/ contains the Bash, PowerShell, and Node helpers that the pnpm scripts call, including OCR preparation and the Windows and Store packaging scripts. See Installers and Cross-Platform Builds.
  • tests/ holds the Vitest tests (*.test.ts, with *.integration.test.ts run by the integration config). Playwright browser specs live in tests/e2e/. See Testing.
  • store-assets/ holds per-locale Store screenshots (de, en, es, fr, it), the source/ background image, and base-metadata.json. scripts/generate-store-assets.mjs builds them. See Cross-Platform Builds.
  • docs/ holds the privacy policies in five languages and _config.yml for GitHub Pages.
  • static/ holds the favicon and SVG/PNG images copied as-is into the frontend build.
  • src-tauri/icons/ is referenced by tauri.conf.json. src-tauri/msix/AppxManifest.xml is used by the Store packaging scripts (scripts/store-msix.mjs). src-tauri/capabilities/default.json holds the Tauri permission capabilities.

Clone this wiki locally