Mirror of github.com/Memo-2023/mana-monorepo
Find a file
Till JS 6b8e2c7176 feat(mana/web): encryption phase 6.2/6.3 — settings page + onboarding banner
Two user-facing surfaces for the encryption pipeline that's been
running invisibly since Phase 4. Closes the loop on "we encrypt
your data" by making the claim concrete, verifiable, and rotatable.

vault-instance.ts (new)
  Lazy-singleton wrapper around createVaultClient. The root layout
  was holding a private vault client reference; the settings page
  needs the same instance to call rotate() and read state.
  getVaultClient() builds it on first call from authStore +
  getManaAuthUrl(), reuses it forever after. Phase 3's
  setKeyProvider/getActiveKey wiring means the rest of the data
  layer doesn't need to know about the singleton at all — only
  callers that want to drive lock/unlock/rotate explicitly do.

  +layout.svelte and the new settings/security page both call
  getVaultClient() — the underlying MemoryKeyProvider is shared
  via setKeyProvider, so an unlock from either surface immediately
  reflects in both.

routes/(app)/settings/security/+page.svelte (new)
  Surface for the encryption vault state. Three sections:

    1. STATUS card with a coloured badge:
       - 🔒 Verschlüsselt (green) when unlocked
       - 🔓 Gesperrt (amber) when locked, plus a "Schlüssel jetzt
         laden" button that calls vaultClient.unlock()
       - error states distinguish auth/network/server with
         localised copy and a retry button

       A 1-second poll mirrors external lock/unlock events
       (logout, manual lock from another tab) so the badge stays
       fresh without a hard refresh. Disposed on unmount.

    2. ENCRYPTED FIELDS list — derived from the registry:
       Object.entries(ENCRYPTION_REGISTRY).filter(enabled).map(...)
       Renders one row per table with the field allowlist visible
       in monospace, plus a count summary at the top. The list is
       always honest: if a registry entry is enabled:false (Phase 7
       targets, server-pushed tables, etc.), it does not appear.

    3. ROTATE card (danger styling):
       Two-step confirm before mutating. Calls vaultClient.rotate()
       which the existing Phase 3 wire already routes through
       /api/v1/me/encryption-vault/rotate. Toast on success/failure.
       Explicitly documents that the old MK is GONE and current
       data is NOT auto-re-encrypted — the user accepts that risk.

    4. HONEST DISCLOSURE section: lists what Mana CAN'T see
       (encrypted blobs), what Mana COULD technically see
       (the wrapped MK if a hosting employee actively reaches for
       the KEK), and what's structurally visible (counts,
       timestamps, relationships). Reads better than any policy
       page because it's anchored in the actual data layout.

EncryptionIntroBanner.svelte (new)
  One-time onboarding banner that fires on the first vault unlock
  ever on a given device. Uses localStorage('mana-encryption-intro-
  dismissed') as the persistent flag. Shows a green-bordered card
  bottom-centre explaining at-rest encryption in three sentences,
  with a "Mehr erfahren →" link to /settings/security and an X
  dismiss button.

  Why a banner instead of a toast?
    - Toasts disappear after 3s; a privacy claim deserves longer
      attention.
    - The banner has room for a learn-more link; toasts don't.
    - Dismissing it is an explicit user action, which matches the
      "you understand and accept" social contract.

  Polls vault state every 500ms for up to 30s after mount so it
  fires even if the unlock happens asynchronously after the layout
  finishes rendering. Auto-clears the timer once it shows or after
  the 30s window. SSR-safe: localStorage access is guarded.

  Mounted globally in the root layout next to the existing
  SuggestionToast, OfflineIndicator, PwaUpdatePrompt.

Layout integration
  routes/+layout.svelte:
    - Drops the inline createVaultClient + getManaAuthUrl import
      in favour of getVaultClient() — single source of truth.
    - <EncryptionIntroBanner /> mounted alongside the other
      global UI elements.

Verified: 20 test files, 262/262 tests passing. Pre-existing
TS error in src/routes/(app)/settings/+page.svelte:338
(getSecurityEvents on authStore) is unrelated parallel drift.

Encryption pipeline status: Phase 1-6 complete.
  - 22 tables encrypted at rest covering >85% of user-typed bytes
  - Server-side master key vault with KEK-wrapping (mana-auth)
  - Vault unlock on login, lock on logout
  - Per-record encryptRecord/decryptRecord through every store
  - Settings UI showing status + rotate
  - First-login onboarding banner

Remaining for a hypothetical Phase 7:
  - tasks/calendar.events/habits — title leakage via timeBlocks
  - picture/storage/music — server-pushed, needs API encryption
  - nutriphi/uload/context.documents/questions — store extraction
    needed before they can flow through encryptRecord
  - Recovery code opt-in for true zero-knowledge users (server
    can't even technically decrypt)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 19:54:09 +02:00
.changeset feat(versioning): add semantic versioning and changesets to all apps 2026-03-19 16:20:18 +01:00
.claude feat(manacore/web): wire TagField, FavoriteButton, ColorPicker into module UIs 2026-04-02 17:20:46 +02:00
.github chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
.husky fix(devtools): fix pre-commit hook - add eslint-config dep, remove type-check 2026-03-17 13:08:51 +01:00
apps feat(mana/web): encryption phase 6.2/6.3 — settings page + onboarding banner 2026-04-07 19:54:09 +02:00
docker feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
docs feat(memoro): voice recording → mana-stt transcription pipeline 2026-04-07 18:48:41 +02:00
games chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
load-tests chore: rename mukke to music in infra, scripts, and CI/CD 2026-04-05 16:47:57 +02:00
NewAppIdeas/Roblox Reimagined chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
packages feat(cycles): add menstrual cycle tracking module 2026-04-07 14:35:33 +02:00
patches fix(traces): configure EAS Build for TestFlight and fix bot-services build 2026-03-17 13:16:38 +01:00
scripts feat(memoro): voice recording → mana-stt transcription pipeline 2026-04-07 18:48:41 +02:00
services feat(events): bring list (wer bringt was?) — Phase 2 2026-04-07 19:31:39 +02:00
tests/e2e first implementation 2025-11-27 17:26:18 +01:00
.dockerignore make auth working 2025-11-26 01:31:12 +01:00
.editorconfig feat: add monorepo configuration and shared packages structure 2025-11-22 23:41:52 +01:00
.env.development feat(memoro): voice recording → mana-stt transcription pipeline 2026-04-07 18:48:41 +02:00
.env.macmini.example feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
.gitignore chore: misc fixes, new services, lockfile cleanup 2026-03-28 10:27:35 +01:00
.npmrc fix(monorepo): add .npmrc with node-linker=hoisted for EAS Build compatibility 2026-03-15 08:50:18 +01:00
.nvmrc feat: add monorepo configuration and shared packages structure 2025-11-22 23:41:52 +01:00
.prettierignore chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
.prettierrc.json fix(cicd): docker paths, formatting config, 2025-11-27 18:33:08 +01:00
CLAUDE.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
cloudflared-config.yml feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
docker-compose.dev.yml feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
docker-compose.macmini.yml chore(deploy): wire MANA_STT_URL/API_KEY into mana-web container 2026-04-07 19:47:42 +02:00
eslint.config.mjs chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
gift-codes-2026-02-14.txt feat(gifts): add gift code creation script and initial codes 2026-02-14 11:23:08 +01:00
lint-staged.config.js chore: archive 17 standalone app servers (replaced by unified API) 2026-04-02 21:37:45 +02:00
mac-mini-setup.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
package.json feat(events): add mana-events service + public RSVP flow (Phase 1b) 2026-04-07 14:27:48 +02:00
playwright.config.ts style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
pnpm-lock.yaml chore(workspace): unify vitest to ^4.1.2 across all packages 2026-04-07 13:58:29 +02:00
pnpm-workspace.yaml chore: delete 25 web-archived directories, remove stale stubs, clean workspace config 2026-04-03 13:03:49 +02:00
README.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
test-chat-auth.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
TROUBLESHOOTING.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
turbo.json feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
vitest.config.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00

Mana Monorepo

Monorepo containing all Mana projects — a self-hosted multi-app ecosystem with shared packages and unified tooling.

Projects

Project Description Apps
mana Multi-app ecosystem platform Expo mobile, SvelteKit web
chat AI chat application NestJS backend, Expo mobile, SvelteKit web, Astro landing
todo Task management NestJS backend, SvelteKit web, Astro landing
calendar Calendar & scheduling NestJS backend, SvelteKit web, Astro landing
clock Pomodoro & time tracking NestJS backend, SvelteKit web, Astro landing
contacts Contact management NestJS backend, SvelteKit web
picture AI image generation NestJS backend, Expo mobile, SvelteKit web, Astro landing
cards Card/deck management NestJS backend, Expo mobile, SvelteKit web
zitare Daily inspiration quotes NestJS backend, Expo mobile, SvelteKit web, Astro landing
mukke Music player NestJS backend, SvelteKit web
planta Plant care tracker NestJS backend, SvelteKit web
storage Cloud storage NestJS backend, SvelteKit web
questions Q&A with web search SvelteKit web
skilltree Skill tree visualization NestJS backend, SvelteKit web
nutriphi Nutrition tracking NestJS backend, SvelteKit web
citycorners City guide NestJS backend, SvelteKit web, Astro landing
presi Presentation tool NestJS backend, SvelteKit web
photos Photo management NestJS backend, SvelteKit web

Getting Started

Prerequisites

  • Node.js 20+
  • pnpm 9.15.0+
  • Docker (for PostgreSQL, Redis, MinIO)

Installation

pnpm install

Development

# Start infrastructure (PostgreSQL, Redis, MinIO)
pnpm docker:up

# Start any app with auto DB setup
pnpm dev:chat:full
pnpm dev:todo:full
pnpm dev:calendar:full
pnpm dev:contacts:full

# Build & quality
pnpm run build
pnpm run type-check
pnpm run format

See CLAUDE.md for comprehensive development documentation.

Architecture

mana-monorepo/
├── apps/                    # Product applications
├── services/                # Microservices (auth, search, LLM, bots)
├── packages/                # Shared packages
├── docker/                  # Docker configuration
└── scripts/                 # Development & deployment scripts

Tooling

  • Package Manager: pnpm 9.15.0
  • Build System: Turborepo
  • Formatting: Prettier (tabs, single quotes, 100 char width)
  • Hosting: Mac Mini (self-hosted) via Docker + Cloudflare Tunnel
  • Analytics: Umami (stats.mana.how)

License

Private - All rights reserved