mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 19:19:41 +02:00
SUMMARY:
Consolidate shared UI components into @manacore/shared-ui and add
AppSlider to all login screens for a consistent Mana ecosystem experience.
CHANGES:
1. UI Components Migration:
- Added Card.svelte to @manacore/shared-ui with variants (elevated, outlined, ghost)
- Migrated Manacore (7 files) and Manadeck (7 files) to use shared-ui
- Removed local ui/ directories from both apps (8 components total)
2. AppSlider Unification:
- Created shared AppSlider in @manacore/shared-ui with configurable props
- Props: apps[], title, isDark, statusLabels, comingSoonLabel, openAppLabel, onAppClick
- Supports both i18n and static text configurations
- Updated Memoro AppSlider to use shared component with svelte-i18n
- Updated Manacore AppSlider to use shared component
- Created new AppSlider for ManaDeck and Märchenzauber
3. Login Page Enhancements:
- Extended LoginPage in @manacore/shared-auth-ui with new snippets:
- appSlider: Renders AppSlider at bottom (initial mode only)
- headerControls: Renders controls (theme toggle, etc.) top-right
- Updated all app login pages to include AppSlider:
- ManaCore: indigo theme (#6366f1)
- ManaDeck: violet theme (#8b5cf6)
- Märchenzauber: pink theme (#FF6B9D)
4. Subscription Page Consolidation:
- Created SubscriptionPage component in @manacore/shared-subscription-ui
- Moved subscription data (plans, packages, costs) to shared package
- Reduced subscription page code from ~100 to ~18 lines per app
FILES CHANGED:
- packages/shared-ui: Added Card, AppSlider, updated exports
- packages/shared-auth-ui: Extended LoginPage with snippets
- packages/shared-subscription-ui: Added SubscriptionPage, data files
- manacore/web: Migrated 7 files to shared-ui, updated login
- manadeck/web: Migrated 7 files to shared-ui, added AppSlider, updated login
- maerchenzauber/web: Added AppSlider, updated login
- memoro/web: Updated AppSlider to use shared component
DELETED (moved to shared packages):
- manacore/web/src/lib/components/ui/* (3 files)
- manadeck/web/src/lib/components/ui/* (5 files)
- memoro/web/src/lib/data/*.json (3 files)
- Various pnpm-lock.yaml and pnpm-workspace.yaml files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| src | ||
| static | ||
| .env.example | ||
| .gitignore | ||
| MIDDLEWARE_SECURITY.md | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| SETUP.md | ||
| svelte.config.js | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
| WELCOME_ROUTE_SETUP.md | ||
ManaCore Web
Modern SvelteKit web application for ManaCore 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 Core Middleware API
- Testing: Vitest + Playwright
- Deployment: Vercel/Netlify ready
Getting Started
Prerequisites
- Node.js 20+ and pnpm
- Supabase account and project
- Access to Mana Core 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 Core 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.manacore.ai 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-core-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: manacore)
netlify deploy --prod --site manacore --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 manacore-web .
# Run container
docker run -p 3000:3000 manacore-web
Contributing
- Create a feature branch
- Make your changes
- Run tests and type checking
- Submit a pull request
License
Private - All rights reserved