Neuer Domain-Helper cardContentHash({ type, fields }) — SHA-256 über
canonisierten JSON ({type, sorted-fields}), pure Web-Crypto. Field-
Reihenfolge ist invariant; Whitespace + Cloze-Markup zählen mit
(zwei Karten mit identischem Text aber unterschiedlichem
{{c1::…}}-Markup sind verschiedene Karten).
cards-API POST schreibt content_hash automatisch in den schon
existierenden Schema-Slot. Neuer Endpoint GET /api/v1/cards/hashes
liefert die kompakte Hash-Liste des Users (ohne Card-Body) — eine
Anfrage pro Anki-Import statt pro Karte.
apps/web/src/lib/anki/import.ts holt die Hashes vor dem Loop und
prüft pro Karte clientseitig. Duplikate werden gezählt
(cardsSkippedDuplicate) und übersprungen, der Counter erscheint
in der AnkiImport-Done-View. Same-File-Drift (Anki-interne
Doppel-Notes) wird auch erkannt — nach erfolgreichem Insert
landet der Hash sofort im Set.
Fallback: wenn /hashes fehlschlägt (älterer Server), bleibt das
Dedupe-Set leer und Karten werden eingefügt wie zuvor — kein
Hard-Bruch.
Pre-Phase-9j-Karten haben null content_hash (Hashes-Endpoint
filtert sie weg) — sie können also irrtümlich erneut eingespielt
werden, falls noch im Anki-File. Pragmatisch akzeptiert: ein
Backfill-Script wäre Phase-10-Polish, sobald Live-User da sind.
5 neue Domain-Tests, 1 neuer API-Auth-Gate-Test (105 grün ges.:
51 + 49 + 5). svelte-check 380 files 0 errors. E2E gegen lokale
Postgres bestätigt: neue Karte hat content_hash (64-char-hex),
/hashes listet sie.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .github/workflows | ||
| apps | ||
| docs | ||
| infrastructure | ||
| packages/cards-domain | ||
| .env.example | ||
| .gitignore | ||
| .npmrc | ||
| .prettierrc.json | ||
| app-manifest.json | ||
| CLAUDE.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| STATUS.md | ||
| tsconfig.base.json | ||
| turbo.json | ||
Cards
Eigenständige Spaced-Repetition-App des Vereins mana e.V.
Cards ist eine föderierte Peer-App im mana-Ökosystem. Sie verwaltet Karteikarten, plant Wiederholungen mit dem FSRS-Algorithmus und empfängt Inhalte aus anderen Verein-Apps (z.B. Zitate aus Memoro, Notizen aus Mana, Web-Schnipsel aus dem Browser-Plugin).
→ Live (geplant): https://cardecky.mana.how
Aktueller Stand und Pickup-Onboarding: STATUS.md.
Stack
- Frontend: SvelteKit 2 + Svelte 5 (runes-only)
- Backend: Hono + Bun + Drizzle ORM
- Datenbank: Postgres mit Schema-Isolation (
pgSchema('cards')) - Auth: föderiert über mana-auth (EdDSA JWT, JWKS-Cache)
- Subscriptions: mana-credits (zentral pro Verein-Account)
- AI-Tools: über mana-mcp Claude Desktop / persona-runner verfügbar
- i18n: DE / EN / FR / ES / IT
- Build: Turborepo + pnpm 9
Status
Phase 0 (Repo-Skeleton) — siehe mana/docs/playbooks/CARDS_GREENFIELD.md
für den vollständigen Plan.
Lokal entwickeln
pnpm install
pnpm docker:up # Postgres in Docker
pnpm db:push # Drizzle-Schema
pnpm dev # api + web parallel
→ API auf http://localhost:3081, Web auf http://localhost:3082 (oder Vite-Dev-Default 5173).
Voraussetzung: Mana-Plattform-Stack (mana-auth, evtl. Föderations-Services) muss lokal laufen, sonst greift Auth-Login nicht.
Lizenz
Mana-Verein-intern, MIT (siehe mana/docs/COMPLIANCE.md für Details
zur Verein-Lizenzpolitik).