Commit graph

355 commits

Author SHA1 Message Date
Till-JS
7b8335a3fb fix(settings): unify global settings across web apps
- Add desktopPosition prop to Clock layout for nav sync
- Remove duplicate local theme/locale controls from Clock, Calendar, Todo, Zitare
- Move GlobalSettingsSection to proper position in settings pages
- Remove weekStartsOn from Calendar (now handled by GlobalSettingsSection)

All web apps now consistently use GlobalSettingsSection for:
- Navigation (desktopPosition, sidebarCollapsed)
- Theme (mode, colorScheme)
- Language (locale)
- General (startPage, weekStartsOn, soundsEnabled)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:28:00 +01:00
Till-JS
9ece591bb5 docs: add referral system implementation plan
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:11:23 +01:00
Till-JS
833a828cfb fix(picture): update API client to v1 endpoint and rename steps param
- Change API base path from /api to /api/v1 for all fetch calls
- Rename numInferenceSteps to steps in generate params to match backend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:11:04 +01:00
Till-JS
6f8585e9bb fix(manacore): improve API response handling and auth flow
- Fix calendar/todo API services to handle wrapped response format
  ({ events: [...] }, { tasks: [...] }, etc.)
- Add null-safety guards in dashboard widgets for data arrays
- Simplify default dashboard to 3 widgets: Clock, Tasks, Calendar
- Fix auth layout initialization to prevent redirect race conditions
- Update auth store import path in dashboard page

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:10:51 +01:00
Till-JS
6d918315c7 feat(auth): add fraud detection, cron jobs, and admin endpoints to referral system
- Add FraudDetectionService with IP/device fingerprinting, velocity checks,
  email pattern detection, and review queue management
- Add ReferralCronService for retention checks (hourly), daily stats
  aggregation, rate limit cleanup, and weekly tier recalculation
- Add ReferralsAdminController with endpoints for review queue,
  fraud patterns, and user referral management
- Integrate referral initialization into user registration flow
  (auto-create referral code, initialize tier, apply referral code)
- Add @nestjs/schedule dependency for cron jobs
- Export referrals schema from db/schema/index.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:09:39 +01:00
Till-JS
e3ba35b20e refactor(todo): unify task views into single page with collapsible sections
- Remove separate /today, /upcoming, and /completed routes
- Add unified view with CollapsibleSection components for Overdue, Today, Upcoming, and Completed
- Add new fetchAllTasks() method to tasks store
- Simplify navigation from 4 items to 2 (Tasks + Settings)
- Refactor settings page with shared-ui components and theme controls

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:06:08 +01:00
Till-JS
a6cc0b83aa fix(manacore): auth flow and dashboard widget API fixes
Auth fixes:
- Update fetchInterceptor skip patterns for ManaCore auth endpoints
- Fix URL matching to compare full origins instead of partial matches
- Update token manager state after successful login
- Remove Supabase session dependency from layouts
- Use authStore for auth state in route layouts

Dashboard fixes:
- Add network error detection in base-client to prevent infinite retries
- Update all 9 dashboard widgets to not retry on service unavailable
- Add /api/v1 prefix to all backend service URLs (chat, calendar, contacts, todo, zitare, picture, manadeck)

Commands:
- Add dev:manacore:backends to start all 9 dashboard backends
- Add dev:manacore:full to start web + all backends together
- Update COMMANDS.md with new commands and backend port table

Auth service:
- Fix TypeScript error: crossApp → cross_app in referrals schema

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 14:44:58 +01:00
Till-JS
ee52f6c144 chore: remove empty archived app stubs from apps/
Remove leftover empty folders for maerchenzauber, memoro, nutriphi,
reader, and wisekeep from apps/ directory. These apps were already
fully moved to apps-archived/ but the empty stubs remained.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 13:23:45 +01:00
Wuesteon
d41d060bb3 Merge branch 'dev-1' into dev 2025-12-05 17:57:26 +01:00
Wuesteon
9be11259a9 update docs 2025-12-05 17:18:40 +01:00
Till-JS
86a6ff23c7 fix(context): add expo-font dependency and fix TypeScript issues
- Add expo-font package for font loading
- Fix various TypeScript type issues in components
- Update i18n utilities

Note: Some TypeScript errors remain and will be addressed in follow-up.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:30:31 +01:00
Till-JS
dbf5745c0e fix(mana-core-auth): configure helmet for cross-origin requests
Update helmet middleware to allow cross-origin resource policy and
opener policy for proper CORS functionality with frontend apps.

Also add debug logging for configured CORS origins.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:30:12 +01:00
Till-JS
12f59176dd docs: update CLAUDE.md for archived apps
Move inventory, presi, storage to archived projects section and remove
from active projects list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:29:58 +01:00
Till-JS
44897ae758 chore: archive inventory, presi, storage apps
Move these apps to apps-archived/ as they are not actively developed:
- inventory: Inventory management app
- presi: Presentation tool
- storage: Cloud storage app

These can be reactivated by moving back to apps/ when needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:22:38 +01:00
Till-JS
bb0e0cf5cb 🚚 feat(context): integrate context app into monorepo
Restructure the context app (formerly basetext) to follow the monorepo
pattern with proper workspace configuration.

Changes:
- Move app files to apps/context/apps/mobile/
- Rename package to @context/mobile
- Update bundle ID to com.manacore.context
- Create pnpm-workspace.yaml for project workspace
- Add dev scripts to root package.json
- Update CLAUDE.md with project documentation

The app structure is prepared for future web/backend additions.

Note: Existing TypeScript errors in the original codebase are preserved.
These should be fixed in a follow-up PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 15:09:04 +01:00
Till-JS
34c879929b chore: add techbase to apps-archived
Integrated techbase (software comparison platform) into monorepo structure:
- Created NestJS backend with votes and comments modules
- Migrated from external Supabase to own PostgreSQL
- Set up Drizzle ORM schema for votes and comments
- Created API client replacing Supabase in Astro frontend
- Added environment configuration (port 3021)

Archived immediately as it's not yet ready for active development.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 13:47:39 +01:00
Till-JS
17313473aa fix(mana-core-auth): use JWKS with jose for JWT verification
The JWT guards were using RS256 algorithm with jsonwebtoken library,
but Better Auth generates EdDSA tokens. This caused all authenticated
requests to fail with "Invalid token".

Changes:
- Replace jsonwebtoken with jose library
- Use JWKS endpoint for key fetching instead of static publicKey
- Support EdDSA algorithm used by Better Auth

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 13:26:19 +01:00
Till-JS
8e414c12ba feat(games): add worldream game to monorepo
- Integrate worldream (text-first world-building platform) into games/
- Configure as @worldream/web workspace package
- Remove standalone git repo, now part of monorepo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 13:24:06 +01:00
Till-JS
ace7fa8f7f chore: archive finance, mail, moodlit apps and rename voxel-lava
- Move finance, mail, moodlit to apps-archived for later development
- Rename games/voxel-lava to games/voxelava

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 13:13:15 +01:00
Wuesteon
da4f05adc3 fix(shared-auth): add UUID fallback for HTTP contexts
crypto.randomUUID() requires HTTPS (secure context). Staging uses HTTP,
so add fallback using crypto.getRandomValues() which works in insecure
contexts.

Fallback chain:
1. crypto.randomUUID() - native, requires HTTPS
2. crypto.getRandomValues() - works on HTTP
3. Math.random() - last resort fallback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:26:34 +01:00
Till-JS
c3c272abc9 chore: update config files and dependencies
- Add inventory app to environment and docker config
- Update fetchInterceptor in shared-auth
- Update package.json with inventory commands
- Update lockfile

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:20:35 +01:00
Till-JS
fca93a9d35 fix(manacore): update app layout
Minor updates to manacore app layout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:20:27 +01:00
Till-JS
fd3341ff4d refactor(zitare): reorganize routes into (app) layout group
Move all authenticated routes into (app) layout group for better
code organization and layout management.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:20:21 +01:00
Till-JS
862560f376 refactor(todo): reorganize routes into (app) layout group
Move all authenticated routes into (app) layout group for better
code organization and layout management. Add navigation store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:20:16 +01:00
Till-JS
4a6d946f33 refactor(presi): reorganize routes into (app) and (auth) layout groups
Move authenticated routes into (app) layout group and auth routes
into (auth) layout group for better code organization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:20:11 +01:00
Till-JS
2f7450b5af refactor(mail): reorganize routes into (app) layout group
Move all authenticated routes into (app) layout group for better
code organization and layout management. Add missing stores.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:20:06 +01:00
Till-JS
ebec369a57 refactor(finance): reorganize routes into (app) layout group
Move all authenticated routes into (app) layout group for better
code organization and layout management. Add missing stores.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:20:02 +01:00
Till-JS
4a41b45efb refactor(clock): reorganize routes into (app) layout group
Move all authenticated routes into (app) layout group for better
code organization and layout management.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:19:56 +01:00
Till-JS
a514879e4b refactor(calendar): reorganize routes into (app) layout group
Move all authenticated routes into (app) layout group for better
code organization and layout management.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:19:51 +01:00
Till-JS
f1ed3e3f2e feat(inventory): add new Inventory app scaffolding
Add new Inventory management app with:
- Backend NestJS setup with Drizzle schema for items, categories, locations
- Web SvelteKit app with item management UI
- Shared branding config (logo, icon, colors)
- Storage bucket configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:19:36 +01:00
Wuesteon
0fe397504c fix(cd): use drizzle-kit push for schema migration
- Change db:migrate (non-existent) to drizzle-kit push --force
- Add --force flag to skip interactive confirmation in CI
- Document Problem 7: Missing Database Schema
- Add lessons learned about schema vs database creation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:16:32 +01:00
Wuesteon
113495add3 docs: add client-side env injection and CORS troubleshooting
Documented two additional staging deployment issues discovered today:

Problem 5: Client-Side Calling localhost Instead of Public IP
- Root cause: process.env not available in browser
- Solution: Use hooks.server.ts transformPageChunk to inject window.__VAR__
- Pattern: Separate _CLIENT env vars for browser access

Problem 6: CORS Blocking Cross-Origin Requests
- Root cause: Different ports = different origins
- Solution: Add CORS_ORIGINS env var to mana-core-auth
- Verification: Test with curl OPTIONS preflight

Also added:
- Updated checklist with CORS and client URL verification
- 4 new lessons learned (#7-#10)
- Environment variable flow diagram

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:09:11 +01:00
Wuesteon
00281a86d3 fix(staging): add CORS_ORIGINS to mana-core-auth
Allow cross-origin requests from chat-web (port 3000) and chat-backend (port 3002)
to mana-core-auth (port 3001) on staging server.

Without this, browser requests from chat-web to mana-core-auth are blocked
by CORS policy since they're on different ports (3000 vs 3001).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:56:30 +01:00
Till-JS
5fd5423f8e feat(manacore): add Picture, ManaDeck, and Clock dashboard widgets
- Add 3 new widget types: picture-recent, manadeck-progress, clock-timers
- Create API services for Picture, ManaDeck, and Clock apps
- Add PictureRecentWidget showing recent AI-generated images
- Add ManadeckProgressWidget showing learning progress and due cards
- Add ClockTimersWidget showing active timers and alarms
- Update WidgetContainer to include new widget components
- Add i18n translations (DE/EN) for all new widgets
- Extend WIDGET_REGISTRY with metadata for new widgets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:45:07 +01:00
Wuesteon
44608074fc fix(chat-web): inject runtime env vars for client-side auth
Problem: Browser was calling localhost:3001 instead of staging server IP
because environment variables from Docker aren't available client-side.

Solution:
1. Add PUBLIC_*_CLIENT env vars to docker-compose.staging.yml for browser URLs
2. Inject these into window.__PUBLIC_*__ via hooks.server.ts transformPageChunk
3. Auth store reads from window variable for client-side requests

This pattern properly handles:
- SSR: Uses Docker internal URLs (http://mana-core-auth:3001)
- Client: Uses public URLs (http://46.224.108.214:3001)
- Local dev: Falls back to localhost

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:38:53 +01:00
Till-JS
acb5d74420 📝 docs: add release plan and manacore roadmap
- Add RELEASE-PLAN.md with prioritized app release order
- Add MANACORE-TODOS.md with detailed development roadmap
- Update apps.ts config with all 14 active apps
- Remove archived apps (memoro, storyteller) from config
- Add features and descriptions for all apps
- Add helper functions for app categories

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:38:27 +01:00
Till-JS
cfbc8a2c15 ♻️ refactor: unify web app patterns across monorepo
- Rename authStore.svelte.ts to auth.svelte.ts (manacore, manadeck, moodlit)
- Add i18n setup to Finance and Mail apps (DE, EN, FR, ES, IT)
- Add feedback pages using shared component to Finance and Mail
- Create @manacore/shared-api-client package with API client factory
- Create @manacore/shared-vite-config package with SSR config helpers
- Create @manacore/shared-stores package with toast, navigation, theme factories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:35:26 +01:00
Wuesteon
0c05097459 docs: add staging deployment troubleshooting guide
Comprehensive documentation of the staging deployment journey including:

- Problem 1: GitHub workflow file extensions (.yml.bak to disable)
- Problem 2: chat-backend health check path (/api/v1/health not /api/health)
- Problem 3: SvelteKit static env imports (use runtime patterns for Docker)
- Problem 4: Orphan Docker containers

Also fixes the cd-staging.yml health check path for chat-backend to match
the actual NestJS endpoint at /api/v1/health.

Includes checklists, debugging commands, and lessons learned.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:35:10 +01:00
Wuesteon
4a56c888b0 fix(staging): correct chat-backend health check path to /api/v1/health
The chat-backend NestJS health endpoint is at /api/v1/health, not /api/health.
This was causing the container to be marked as unhealthy, preventing chat-web
from starting due to its depends_on condition.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:32:22 +01:00
Wuesteon
0aa9ba0c7e chore(ci): disable PR and dependency workflows for minimal setup
Only active workflows now:
- ci-main.yml (Docker builds)
- cd-staging.yml (staging deploy)
- cd-staging-tagged.yml (tagged releases)
- cd-production.yml (production deploy)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:06:24 +01:00
Wuesteon
c1d14a4aff chore(ci): rename backup files to .bak to prevent GitHub detection
GitHub was running .full.yml files as workflows. Changed extension
to .bak which GitHub won't recognize.

To restore:
  mv file.yml.bak file.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:04:01 +01:00
Wuesteon
be37808966 fix(chat-web): use runtime env vars instead of static imports
Changed PUBLIC_MANA_CORE_AUTH_URL from $env/static/public to runtime
environment variables so the Docker build doesn't fail.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:49:32 +01:00
Wuesteon
8253fbba9b chore(ci): disable test workflows for rapid iteration
Renamed test.yml and test-coverage.yml to .disabled extension to
completely stop them from running during rapid iteration testing.

Only mana-core-auth and chat Docker builds run now on main branch.

To re-enable later:
  mv .github/workflows/test.yml.disabled .github/workflows/test.yml
  mv .github/workflows/test-coverage.yml.disabled .github/workflows/test-coverage.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:47:20 +01:00
Wuesteon
eaf82b49c4 fix(ci): remove validate job - Docker builds are self-contained
Before: validate job installed ALL deps + built ALL packages (~10 min)
After: Just build 3 Docker images in parallel (~3-5 min)

Each Dockerfile handles its own dependencies, no pre-validation needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:45:06 +01:00
Wuesteon
1ecdee462b chore(ci): simplify pipelines for rapid testing
- ci-main.yml: Only builds mana-core-auth, chat-backend, chat-web
- test.yml: Disabled (manual trigger only)
- test-coverage.yml: Disabled (manual trigger only)

Archived full configs with .full.yml suffix for restoration.

To restore full pipelines:
  cp .github/workflows/ci-main.full.yml .github/workflows/ci-main.yml
  cp .github/workflows/test.full.yml .github/workflows/test.yml
  cp .github/workflows/test-coverage.full.yml .github/workflows/test-coverage.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:12:59 +01:00
Wuesteon
714298f7c8 feat(chat-web): add Docker deployment for chat frontend
- Add @sveltejs/adapter-node for server-side rendering
- Create Dockerfile for chat web SvelteKit app
- Add /health endpoint for container health checks
- Add chat-web service to docker-compose.staging.yml
- Update CI/CD workflow with chat-web health check

The chat app now deploys with both backend and web frontend:
- mana-core-auth (port 3001) - central auth
- chat-backend (port 3002) - API
- chat-web (port 3000) - web frontend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:10:32 +01:00
Wuesteon
80f80053f3 refactor(staging): simplify CI/CD to mana-core-auth + chat-backend only
Archived full staging config for future restoration:
- docker-compose.staging.full.yml (includes manadeck, nginx)
- .github/workflows/cd-staging.full.yml (includes all health checks)

Simplified staging deployment:
- Only deploys postgres, redis, mana-core-auth, chat-backend
- Added database creation step for manacore_auth and chat DBs
- Faster iteration for testing central auth integration

To restore full config:
  cp docker-compose.staging.full.yml docker-compose.staging.yml
  cp .github/workflows/cd-staging.full.yml .github/workflows/cd-staging.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 01:33:01 +01:00
Wuesteon
6c3b2971bf fix route 2025-12-05 00:50:23 +01:00
Wuesteon
b6115a63c7 add health route 2025-12-05 00:15:44 +01:00
Wuesteon
952f246055 fix styleing 2025-12-04 23:40:25 +01:00