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.
- Node.js 22+
- pnpm (see
pnpm-lock.yaml/pnpm-workspace.yamlfor the pinned package manager)
pnpm installbetter-sqlite3, esbuild, and @tailwindcss/oxide are native/build-script dependencies pnpm blocks by default — approve them once after a fresh install:
pnpm approve-buildsCopy the env template and point it at a local SQLite file:
cp .env.example .envApply the Drizzle migrations to create the submissions/scorpion tables in that SQLite file:
pnpm db:migrateThen start the dev server:
pnpm dev
# or start the server and open the app in a new browser tab
pnpm dev -- --open| 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.
There is no deployed plantHubToEdal instance yet, so the whole wizard is walked against
a spec-driven mock instead:
pnpm mock:apiThis 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").
/submitwizard is driven bysrc/lib/config/steps.jsonand JSON Schemas undersrc/lib/config/schemas/, rather than hardcoded per-step components.src/lib/stores/dataset.tsholds the in-progress submission as a Svelte store;Questionnaire.svelteorchestrates steps, fields, and validation.- Auth (
src/lib/js/oidc.ts) implements OIDC Authorization Code + PKCE against the AAI endpoint insrc/lib/config/general.json. Tokens live inlocalStorage— there's no server session. - Local tracking DB:
src/routes/+server.tsandsrc/routes/submit/+server.tsare SvelteKit endpoints backed by a local SQLite file via Drizzle ORM (src/lib/server/db/), used for submission tracking and scorpion analytics API tokens. /searchtalks directly (client-side) to the external e!DAL search REST API — its state lives in a plainpayloadobject, not a store.
See CLAUDE.md for a more detailed architecture walkthrough.
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-webThe 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