managarten/apps/cards
Till JS daa1ef0513 feat(cards): image / audio attachments on cards via mana-media
Cards can now carry image, audio, and video attachments uploaded to
mana-media (the existing CAS service that already powers picture,
photos, wardrobe, etc.).

Pipeline:
  • lib/media/upload.ts wraps POST /api/v1/media/upload (multipart,
    app=cards). Returns { id, url, kind } with the right variant URL
    per kind (medium for images, full file for audio/video). 25 MB
    cap matches the website-upload pattern.
  • mediaToFieldSnippet(): drops Markdown ![]() for images; raw
    <audio>/<video controls> for the others — the user can later
    tweak attributes by hand.
  • Deck-detail card editor gains a "📎 Anhang" button next to every
    text field (front/back/cloze). Pick → upload → snippet appended
    to the field's content. Loading + error states surfaced inline.

Render:
  • @mana/cards-core/render.ts whitelists `audio`, `source`, `video`
    plus the `controls`/`preload`/`src`/`type` attrs in DOMPurify so
    inline media survives sanitization. Markdown's <img> already
    passed through the default policy.

Wiring:
  • hooks.server.ts injects __PUBLIC_MANA_MEDIA_URL__.
  • compose adds PUBLIC_MANA_MEDIA_URL_CLIENT=https://media.mana.how
    to cards-web.

Phase 2 ideas: drag-drop directly into the textarea, paste-from-
clipboard for screenshots, mana-media auth scoping per user, Anki
import bringing media files along.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 13:52:53 +02:00
..
apps/web feat(cards): image / audio attachments on cards via mana-media 2026-05-07 13:52:53 +02:00
GUIDELINES.md feat(cards): Phase-1 Spinoff — standalone cards.mana.how + cards-core extraction 2026-05-07 01:20:43 +02:00
package.json feat(cards): Phase-1 Spinoff — standalone cards.mana.how + cards-core extraction 2026-05-07 01:20:43 +02:00
README.md feat(cards): Phase-1 Spinoff — standalone cards.mana.how + cards-core extraction 2026-05-07 01:20:43 +02:00

Cards

Spaced-repetition flashcards on cards.mana.how.

Phase-1 standalone web app. The frontend lives here; data, auth, and sync are shared with the rest of the Mana stack:

  • Auth: mana-auth (SSO), *.mana.how
  • Sync: mana-sync, app-id cards
  • Storage: mana_platform.cards.* (Postgres, RLS)

The same cards data backs the mana built-in Cards module at mana.how/cards. Schema changes ship to both frontends together — see apps/cards/GUIDELINES.md.

Layout

apps/cards/
├── apps/
│   └── web/        # SvelteKit 2 + Svelte 5 — the Phase-1 surface
├── GUIDELINES.md   # Project rules (read first)
└── README.md

apps/cards/apps/mobile/ and any production apps/cards/apps/landing/ will land in Phase 2/3.

Quick start

pnpm install
pnpm --filter @cards/web dev      # cards.mana.how on http://localhost:5180