Skip to content
IPK-BITPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

93 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e!DAL-web

A SvelteKit 5 frontend for e!DAL (Electronic Data Archive Library, IPK Gatersleben), used to publish plant genomics/phenomics datasets with DOIs.

It has two main features:

  • Faceted search (/search) — a UI over the existing e!DAL search REST API, for browsing and filtering published datasets.
  • Submission wizard (/submit) — a multi-step, config-driven flow that authenticates via OIDC (AAI) and uploads dataset files/metadata to the e!DAL submission backend.

Prerequisites

  • Node.js 22+
  • pnpm (see pnpm-lock.yaml / pnpm-workspace.yaml for the pinned package manager)

Getting started

pnpm install

better-sqlite3, esbuild, and @tailwindcss/oxide are native/build-script dependencies pnpm blocks by default — approve them once after a fresh install:

pnpm approve-builds

Copy the env template and point it at a local SQLite file:

cp .env.example .env

Apply the Drizzle migrations to create the submissions/scorpion tables in that SQLite file:

pnpm db:migrate

Then start the dev server:

pnpm dev

# or start the server and open the app in a new browser tab
pnpm dev -- --open

Commands

Command Description
pnpm dev Start the Vite dev server
pnpm build Production build
pnpm preview Preview a production build
pnpm check Sync SvelteKit types and run svelte-check (TS/Svelte type checking)
pnpm check:watch Same as check, in watch mode
pnpm lint prettier --check . followed by eslint .
pnpm format prettier --write .
pnpm db:push Push the Drizzle schema directly to the local SQLite DB
pnpm db:generate Generate a Drizzle migration from schema changes
pnpm db:migrate Apply Drizzle migrations
pnpm db:studio Open Drizzle Studio against the local DB
pnpm test Run the vitest suite once
pnpm mock:api Serve planthub-to-edal-openapi.yaml with Prism, for the ARC flow

There is no separate pnpm typecheck — use pnpm check.

Exercising the ARC (plantHubToEdal) flow locally

There is no deployed plantHubToEdal instance yet, so the whole wizard is walked against a spec-driven mock instead:

pnpm mock:api

This starts Prism on http://127.0.0.1:4010 (note: Prism mounts the spec's paths at the server root, not under the spec's servers[].url: /plantHubToEdal - that path is documentation of the real deployment's base path, not something Prism replays), serving static examples straight from the vendored OpenAPI spec (CORS enabled). Then, in src/lib/config/general.json (uncommitted — this is a local-only change):

{
	"arcSource": "plantHubToEdal",
	"backends": {
		"plantHubToEdal": "http://127.0.0.1:4010"
	}
}

Visit /submit?submission_id=<a-well-formed-uuid>&access_token=<anything> - the submissionID must actually look like a UUID (the spec declares format: uuid), or Prism rejects it with a 400 before it ever reaches the mocked 200 response. A syntactically valid but made-up UUID always returns the spec's example MetadataResponse (Prism has no real submission state to say otherwise), so the ARC flow can be walked end to end (DLA → read-only metadata → file tree → Finish) without a real backend. To exercise the 404 path specifically, add a Prefer: code=404 request header (e.g. via a browser extension, or by curling the same URL with -H "Prefer: code=404").

Architecture

  • /submit wizard is driven by src/lib/config/steps.json and JSON Schemas under src/lib/config/schemas/, rather than hardcoded per-step components. src/lib/stores/dataset.ts holds the in-progress submission as a Svelte store; Questionnaire.svelte orchestrates steps, fields, and validation.
  • Auth (src/lib/js/oidc.ts) implements OIDC Authorization Code + PKCE against the AAI endpoint in src/lib/config/general.json. Tokens live in localStorage — there's no server session.
  • Local tracking DB: src/routes/+server.ts and src/routes/submit/+server.ts are SvelteKit endpoints backed by a local SQLite file via Drizzle ORM (src/lib/server/db/), used for submission tracking and scorpion analytics API tokens.
  • /search talks directly (client-side) to the external e!DAL search REST API — its state lives in a plain payload object, not a store.

See CLAUDE.md for a more detailed architecture walkthrough.

Container build

A Containerfile builds a production image (Node 22 Alpine, adapter-node) in three stages: dependencies, build, and a minimal runtime. Build and run with Podman or Docker:

podman build -t edal-web .
podman run -p 3000:3000 -e DATABASE_URL=/data/local.db -v ./data:/data edal-web

The scorpion analytics API token can be seeded into the local DB with insert-scorpion-token.js:

SCORPION_TOKEN=... DATABASE_URL=local.db node insert-scorpion-token.js

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages