mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 18:41:08 +02:00
End-to-end "publish my local deck to the marketplace" surface in
the Cards standalone app. Hooks into cards-server (Phase β) so a
user can take a deck they've been editing locally and put it under
cards.mana.how/d/<slug> with one modal.
Pipeline:
• lib/api/cards-api.ts — typed fetch wrapper around the cards-server
/v1 surface. Reads the JWT from authStore, never from storage
directly. CardsApiError carries `{status, message, details}`
so UI can branch on 401/409/etc.
• lib/stores/author.svelte.ts — lazy-loaded author state. Caches
`cardsApi.authors.me()` on first access; resets cleanly on logout.
• lib/util/slug.ts — best-effort slugify mirror of the server-side
validator (server still has final say).
• lib/components/PublishDeckModal.svelte — three-stage flow:
become-author (slug + displayName + pseudonym), deck-meta (title,
description, language, license picker, semver, changelog), then
publishing → done with moderation-flag surface if AI mod returned
'flag'. Keys off authorStore.isAuthor to skip stage 1 for
returning authors.
• routes/decks/[id]/+page.svelte gets a "🌍 Veröffentlichen" button
next to "Lernen". Disabled until the deck has cards.
Wiring:
• hooks.server.ts injects __PUBLIC_CARDS_API_URL__ on every SSR'd
page so the client knows where cards-server lives.
• compose adds PUBLIC_CARDS_API_URL_CLIENT=https://cards-api.mana.how
to the cards-web container.
Validated: svelte-check 0/0, vite build green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| apps/web | ||
| docs | ||
| COMPETITORS_2026-05.md | ||
| GUIDELINES.md | ||
| package.json | ||
| README.md | ||
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