managarten/apps/mana/apps/web
Till JS 697d96daec fix(mana/web): unblock api-keys, reset-password, dashboard widgets, skilltree stats
Six unrelated type-error pockets that were each blocking a different
page from compiling clean. Grouped because none individually warrants
its own commit and they all touch the same module's call sites.

api-keys/+page.svelte
  - Removed the `key: undefined as unknown as string` workaround for
    stripping the secret from the local list. Replaced with a clean
    object-rest destructure that produces a row matching the ApiKey
    shape (no `key` field). The cast was the source of two type
    errors AND was lying about the runtime shape.
  - Badge `variant="secondary"` and `variant="outline"` aren't valid
    BadgeVariant — narrowed to `default` and `info` respectively.
  - Button `variant="destructive"` and Badge `variant="destructive"`
    don't exist in the shared-ui union — both → `danger`.
  - Rate-limit input bound a `number` to a `<Input>` component whose
    `value` is typed `string`. Switched to a string state and
    parseInt on submit. Prevents the binding cast that the type
    checker (correctly) rejected.

reset-password/+page.svelte
  - Calling `authStore.resetPassword(token, password)` with two args
    on a method that takes one (sends the reset email). The method
    that actually performs the reset is `resetPasswordWithToken`.
    Two args, no API contract change needed.
  - `<Input minlength={12}>` — minlength isn't a prop on the shared
    Input component (it's not a passthrough wrapper). Removed; the
    runtime check still gates submit.

dashboard/widgets/{Credits,Transactions}Widget.svelte
  - `let state = $state<...>(...)` — variable named `state` shadows
    the `$state` rune call, which TypeScript flags as
    "Block-scoped variable '$state' used before its declaration"
    + "Untyped function calls may not accept type arguments".
    Renamed both to `loadState`.

dashboard/widgets/TasksTodayWidget.svelte
  - Referenced `task.dueTime`, which doesn't exist on LocalTask
    (only `dueDate`, ISO timestamp). Dropped the dead branch — the
    time was already encoded in `dueDate` and the widget never
    surfaced anything actionable from it anyway.

skilltree/components/StatsOverview.svelte
  - Was manually wiring `.subscribe()` callbacks because the old
    queries.ts returned raw Dexie Observables. After the
    Observable→useLiveQueryWithDefault migration, those return
    `{value, loading, error}` instead — `subscribe` doesn't exist
    on them. Replaced the manual state plumbing with direct
    `.value` reads inside `$derived`. Net: less code, fewer
    levels of indirection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 18:48:28 +02:00
..
e2e feat(events): bring list (wer bringt was?) — Phase 2 2026-04-07 19:31:39 +02:00
src fix(mana/web): unblock api-keys, reset-password, dashboard widgets, skilltree stats 2026-04-09 18:48:28 +02:00
static feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
.env.example chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
.gitignore feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
Dockerfile fix(mana/web): unwrap $state proxy in workbench-scenes Dexie writes 2026-04-09 00:44:00 +02:00
eslint.config.js chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
MIDDLEWARE_SECURITY.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
package.json feat(shared-types): add Zod schemas for AI structured outputs 2026-04-09 16:59:28 +02:00
playwright.config.ts test(events): playwright e2e specs + flake-resistant config 2026-04-07 18:36:45 +02:00
README.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
SETUP.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
svelte.config.js feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
tailwind.config.js feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
tsconfig.json feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
vite.config.ts fix(local-llm): set Vite worker.format='es' for code-splitting support 2026-04-09 01:33:03 +02:00
WELCOME_ROUTE_SETUP.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00

Mana Web

Modern SvelteKit web application for Mana credit/mana management system.

Features

  • 🔐 Authentication with Supabase
  • 🎨 Tailwind CSS for styling
  • 📱 Responsive design
  • 🔄 Real-time updates
  • 🏢 Organization management
  • 👥 Team management
  • 💰 Credit/Mana transfers
  • 🧪 Comprehensive testing

Tech Stack

  • Framework: SvelteKit 2.x with Svelte 5 (Runes)
  • Language: TypeScript
  • Styling: Tailwind CSS 3.x
  • Backend: Supabase (PostgreSQL + Auth)
  • Middleware: Mana Middleware API
  • Testing: Vitest + Playwright
  • Deployment: Vercel/Netlify ready

Getting Started

Prerequisites

  • Node.js 20+ and pnpm
  • Supabase account and project
  • Access to Mana Middleware

Installation

# Install dependencies
pnpm install

# Copy environment variables
cp .env.example .env

# Update .env with your credentials:
# - PUBLIC_SUPABASE_URL
# - PUBLIC_SUPABASE_ANON_KEY
# - PUBLIC_MIDDLEWARE_URL

Development

# Start dev server
pnpm dev

# Run type checking
pnpm check

# Run tests
pnpm test

# Run E2E tests
pnpm test:e2e

Building

# Build for production
pnpm build

# Preview production build
pnpm preview

Project Structure

src/
├── routes/              # File-based routing
│   ├── (auth)/         # Auth routes (login, register)
│   ├── (app)/          # Protected app routes
│   │   ├── dashboard/
│   │   ├── organizations/
│   │   ├── teams/
│   │   └── settings/
│   └── api/            # API endpoints
├── lib/
│   ├── components/     # Reusable components
│   │   ├── ui/        # UI primitives
│   │   └── features/  # Feature components
│   ├── stores/        # Svelte stores
│   ├── utils/         # Utilities
│   ├── types/         # TypeScript types
│   └── server/        # Server-only code
│       ├── db/        # Database utilities
│       ├── auth/      # Auth helpers
│       └── api/       # API integration
├── hooks.server.ts    # Server hooks
└── app.css            # Global styles

Environment Variables

Public Variables (exposed to client)

  • PUBLIC_SUPABASE_URL - Supabase project URL
  • PUBLIC_SUPABASE_ANON_KEY - Supabase anonymous key
  • PUBLIC_MIDDLEWARE_URL - Mana Middleware URL
  • PUBLIC_APP_NAME - Application name

Private Variables (server-only)

Add any private API keys or secrets here.

Deployment

Netlify (Production Setup)

The app is currently deployed to https://app.mana.how using Netlify.

Prerequisites

# Install Netlify CLI globally
npm install -g netlify-cli

# Login to Netlify
netlify login

Initial Setup (One-time)

The project is already configured with @sveltejs/adapter-netlify. If you need to set it up from scratch:

# Install the Netlify adapter
pnpm add -D @sveltejs/adapter-netlify

Update svelte.config.js:

import adapter from '@sveltejs/adapter-netlify';

Environment Variables

Ensure your .env file exists with the following variables:

PUBLIC_SUPABASE_URL=your_supabase_url
PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
MIDDLEWARE_URL=https://mana-middleware-111768794939.europe-west3.run.app

Important: Set these same environment variables in Netlify Dashboard → Site Settings → Environment Variables for production builds.

Deployment

# 1. Install dependencies (if needed)
pnpm install

# 2. Build for production
pnpm build

# 3. Deploy to production (site: mana)
netlify deploy --prod --site mana --dir build

The build process creates:

  • build/ - Static assets and client code
  • .netlify/ - Serverless functions for SSR

Build Output

After running pnpm build, you should see:

  • Client bundle in build/
  • Server functions in .netlify/
  • Netlify configuration (_headers, _redirects)

Vercel (Alternative)

# Install Vercel adapter instead
pnpm add -D @sveltejs/adapter-vercel

# Deploy
vercel

Docker

# Build image
docker build -t mana-web .

# Run container
docker run -p 3000:3000 mana-web

Contributing

  1. Create a feature branch
  2. Make your changes
  3. Run tests and type checking
  4. Submit a pull request

License

Private - All rights reserved