managarten/apps/mana/apps/web
Till JS c5e5963cbe fix(macmini): repair container auto-recovery (broken --env-file path)
Two unrelated bugs in scripts/mac-mini/ensure-containers-running.sh,
both caught while debugging a mana-auth crash loop on 2026-04-08:

1. The recovery path passed --env-file "$PROJECT_ROOT/.env.macmini" to
   docker compose, but that file has never existed on the server — only
   .env does, and compose auto-loads it from the working directory. The
   explicit --env-file silently caused recovered containers to start with
   empty secrets (e.g. blank MANA_AUTH_KEK), which made mana-auth crash
   the moment it came back up. The auto-recovery loop was therefore
   self-defeating: it kept "fixing" auth into the same broken state
   every 5 minutes for hours, with no notification because compose
   exited 0. Drop --env-file entirely and cd into PROJECT_ROOT so
   compose's standard .env discovery applies.

2. mana-infra-minio-init is a one-shot job container that legitimately
   sits in "exited" state after running once. The script flagged it as
   "stuck" every cycle, tried to "recover" it, and spammed the log with
   ERROR lines. Add an explicit ONESHOT_INIT_CONTAINERS allowlist and
   skip those names in both the initial scan and the post-recovery
   verification.

Also tee compose output into the log so future failures actually leave
a breadcrumb instead of disappearing into the void.

Also: bump @mlc-ai/web-llm from a transitive dep (via @mana/local-llm)
to a direct dep of @mana/web. SvelteKit's adapter-node post-build
Rollup pass uses the web app's direct deps as its externals heuristic;
without this entry it warns "@mlc-ai/web-llm ... could not be resolved
- treating it as an external dependency" on every build. Functionally
harmless (the dynamic import in LocalLLMEngine only fires in the
browser), but the warning hid a real adapter-node misconfiguration
that would have bitten us if we'd ever tried to SSR /llm-test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 18:17:31 +02:00
..
e2e feat(events): bring list (wer bringt was?) — Phase 2 2026-04-07 19:31:39 +02:00
src fix(mana/web): SessionWarning + SuggestionToast into bottom-stack 2026-04-08 18:16:55 +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): commit module-registry + module.config.ts files (build-critical) 2026-04-07 19:49:58 +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 fix(macmini): repair container auto-recovery (broken --env-file path) 2026-04-08 18:17:31 +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(mana/web): unblock voice capture — permissions policy, notification mount, dev SW 2026-04-08 15:36: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