mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 16:59:41 +02:00
§1 AppId derivation (shared-branding):
- `AppId` is now `keyof typeof APP_BRANDING` (config.ts) instead of a
hand-maintained union in types.ts. Adding/removing an entry in
`APP_BRANDING` automatically updates the union — eliminates the
drift class that produced the ContextLogo type-error.
- `AppBranding.id` relaxed to `string` to break the circular type
reference (key in `APP_BRANDING` is the authoritative id).
§2 Route-drift smoke test (registry.spec.ts):
- New 4th test: parses every `routes/(app)/*+page.svelte`, extracts
the `<RoutePage appId="…">` literal, asserts the id is registered
in the workbench app-registry. Catches drift like the earlier
`appId="broadcasts"` vs id `'broadcast'` bug structurally.
- ROUTE_ONLY_APP_IDS allowlist for routes that intentionally don't
back a workbench module (gifts, llm-test, milestones, organizations,
teams, tags).
- Caught two real drifts in the process and fixed them:
/agents/+page.svelte → appId="ai-agents" → "agents"
/agents/templates/+page.svelte → same
§3 MANA_APPS hochgezogen (kontext, wishes):
- kontext (Web-Context URL crawler) + wishes (Wunschliste) had module
+ workbench card but no MANA_APPS branding entry. Both got proper
description, longDescription and a fresh APP_ICONS entry (globe-
with-text-lines for kontext, shooting-star for wishes).
- Removed both from WORKBENCH_ONLY in spec — they're full apps now.
- Note: `myday` was already in MANA_APPS, the WORKBENCH_ONLY entry
was redundant and had been silently double-counting.
§4 apps.ts — top-level INDEX comment:
- 80 registerApp() calls were chronological-by-when-added — basically
unsearchable. Added an §1–§4 navigation comment near the top
grouping apps by role (entity / module surface / AI Workbench /
System) so devs can jump to a section. Physical reordering of
the 80 blocks deferred to avoid disturbing the active multi-
terminal session — the TOC delivers ~80% of the navigation win.
Bonus: register `forms` module that the parallel session added but
hadn't wired into the workbench yet — the new route-drift test caught
this immediately on first run.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| e2e | ||
| scripts | ||
| src | ||
| static | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile | ||
| eslint.config.js | ||
| MIDDLEWARE_SECURITY.md | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| svelte.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
| WELCOME_ROUTE_SETUP.md | ||
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 URLPUBLIC_SUPABASE_ANON_KEY- Supabase anonymous keyPUBLIC_MIDDLEWARE_URL- Mana Middleware URLPUBLIC_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
- Create a feature branch
- Make your changes
- Run tests and type checking
- Submit a pull request
License
Private - All rights reserved