Commit graph

470 commits

Author SHA1 Message Date
Wuesteon
73dfe57664 🔧 fix: add GHCR authentication for staging server
The staging server needs to authenticate to ghcr.io to pull private images.
Added docker login step using GHCR_PAT secret before deployment.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 18:13:17 +01:00
Wuesteon
59ce92af1a 🔧 fix: deployment workflow - lowercase image prefix, service names, and port fixes
- Fix Docker image prefix to lowercase (memo-2023) for Docker compatibility
- Keep service names with hyphens to match docker-compose.staging.yml
- Add step to sync docker-compose.staging.yml to server before deploy
- Fix calendar port to 3016/5186 to match staging compose

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 17:54:40 +01:00
Wuesteon
9746db1476 🚀 ci: add manacore, todo, calendar, clock to tagged deployment workflow
- Added 4 new projects to workflow_dispatch options
- Configured PROJECT_APPS mappings (manacore: web only, others: backend+web)
- Set proper ports: calendar=3014, clock=3017, todo=3018, web apps have distinct ports
- Handle custom Dockerfiles for apps with shared package dependencies

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 17:35:11 +01:00
Wuesteon
ee091c4b10 ♻️ refactor: migrate manacore-web from Supabase to mana-core-auth
- Add password reset functionality to mana-core-auth using Better Auth
- Add forgot-password and reset-password endpoints with DTOs
- Update shared-auth package with resetPassword method and endpoint
- Update manacore-web auth store with resetPassword method
- Refactor reset-password pages to use mana-core-auth instead of Supabase
- Remove Supabase dependencies from manacore-web package.json
- Remove Supabase server code (hooks.server.ts, supabase.ts, API routes)
- Update Dockerfile to remove shared-supabase dependency

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 17:04:35 +01:00
Wuesteon
48c5cb48f7 🐛 fix: add MIDDLEWARE_URL to manacore-web Dockerfile
Add MIDDLEWARE_URL as build argument and environment variable
for SvelteKit's $env/static/private at build time.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 16:37:18 +01:00
Wuesteon
f0d57c1922 🐛 fix: switch web apps to adapter-node for Docker builds
- Change calendar-web, clock-web, todo-web, manacore-web from adapter-auto/netlify to adapter-node
- This ensures the 'build' directory is created for Docker production stage
- adapter-node outputs to 'build' folder which Dockerfiles expect

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 16:30:04 +01:00
Wuesteon
63a5674c0b 🐛 fix: add build args for SvelteKit env vars in web Dockerfiles
SvelteKit apps using $env/static/public require environment variables
at build time. Added ARG/ENV directives with defaults for Docker builds.
2025-12-08 16:15:42 +01:00
Wuesteon
5e0b5a8e7a 🚀 ci: add Docker deployment for Manacore, Todo, Calendar, and Clock apps
Add complete Docker deployment infrastructure for 4 new applications:
- Dockerfiles for backend (NestJS) and web (SvelteKit) apps
- docker-entrypoint.sh scripts with PostgreSQL wait and schema push
- Updated docker-compose.staging.yml with 7 new services
- Updated CI/CD workflows with build matrix and health checks
2025-12-08 16:04:50 +01:00
Wuesteon
bb4e12c36e 🐛 fix: resolve auth issues in Manacore, Calendar, and Clock apps
- Manacore: fix import path for authStore (authStore.svelte → auth.svelte)
- Calendar: simplify root layout by moving PillNavigation to (app) layout
- Clock: update login page to use correct shared-auth-ui props (onSignIn, logo, goto)
- Add ClockLogo component to shared-branding package
2025-12-08 15:51:57 +01:00
Wuesteon
60756f7105 small linting fixes 2025-12-08 14:44:17 +01:00
Wuesteon
541e227c68 🙈 chore: ignore claude-flow metrics from git tracking
Remove auto-generated system-metrics.json from version control
2025-12-08 14:38:41 +01:00
Wuesteon
67a15cc9ea 🧑‍💻 dx: add automatic database setup and dev:*:full commands
- Add scripts/setup-databases.sh for automatic DB creation and schema push
- Add dev:*:full commands (chat, zitare, contacts, calendar, clock, todo, picture)
- Update docker/init-db to create all databases on first startup
- Add docs/LOCAL_DEVELOPMENT.md with comprehensive local dev guide
- Update CLAUDE.md with new quick start commands

Now developers can run `pnpm dev:chat:full` to automatically:
1. Create the database if missing
2. Push the latest schema
3. Start auth, backend, and web with colored output
2025-12-08 14:38:18 +01:00
Wuesteon
e423785a20 🔧 ci: remove auto-deploy, keep manual/tag-based only 2025-12-08 12:56:06 +01:00
Wuesteon
8de629dd2d 🚀 ci: add dev branch workflow with PR validation
- Rename ci-main.yml to ci.yml for clarity
- Add PR-based validation (type-check, lint) for dev and main branches
- Add path filtering to skip CI on docs-only changes
- Trigger staging deployment only on push to dev branch
- Keep production deployment manual with confirmation
2025-12-08 12:54:25 +01:00
Till-JS
bb59227aff feat(todo): add Kanban board with drag & drop and filters
- Add kanban_columns table for custom column support
- Add columnId and columnOrder fields to tasks
- Create NestJS Kanban module with CRUD endpoints
- Implement KanbanBoard, KanbanColumn, KanbanTaskCard components
- Add drag & drop support between columns using svelte-dnd-action
- Add Quick Add Task inline in each column
- Add filter panel (priority, project, labels, search)
- Add /kanban route and navigation link

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:36:17 +01:00
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