Commit graph

231 commits

Author SHA1 Message Date
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
Wuesteon
9c47119535 Fix wrong type
import, make auth and chat work
2025-12-04 23:25:25 +01:00
Wuesteon
b8f9bc107c 🐛 fix(chat-backend): remove type-only ConfigService import
Fixed NestJS dependency injection error in ChatService by converting type-only import to regular import.

Root cause: Type-only imports are erased at compile time, causing NestJS to fail dependency injection at runtime.

Error: "Nest can't resolve dependencies of the ChatService (?, DATABASE_CONNECTION)"

This was the same issue we fixed in mana-core-auth services.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 23:02:26 +01:00
Wuesteon
9b26caf5a1 🐛 fix(mana-core-auth): remove type-only imports from services and controllers
Fixed remaining NestJS dependency injection issues by converting type-only imports to regular imports for all injectable services used in controllers and service dependencies.

Changes:
- feedback.service.ts: Fixed AiService import (was causing "argument Function at index [1]" error)
- auth.controller.ts: Fixed BetterAuthService import
- feedback.controller.ts: Fixed FeedbackService import
- credits.controller.ts: Fixed CreditsService import
- settings.controller.ts: Fixed SettingsService import

Root cause: Type-only imports (`import { type X }`) are erased at compile time, causing NestJS to fail dependency injection at runtime. All injectable classes must use regular imports.

Verified locally: All modules initialize successfully without DI errors.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 22:58:45 +01:00
Wuesteon
60ecc24f6c 🐛 fix(auth): remove all type-only ConfigService imports
Found and fixed type-only ConfigService imports in 6 service files that were causing "Nest can't resolve dependencies" errors:

- better-auth.service.ts (BetterAuthService)
- ai.service.ts (AiService)
- settings.service.ts
- feedback.service.ts
- credits.service.ts
- jwt-auth.guard.ts
- optional-auth.guard.ts

Type-only imports are erased at compile time, preventing NestJS from injecting the ConfigService class at runtime.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 21:53:28 +01:00
Wuesteon
a865da99a8 📝 docs: add NestJS dependency injection troubleshooting
Document the type-only import issue that causes "Nest can't resolve dependencies" errors. This was the root cause of the AiService injection failure that took significant debugging to identify.

Key learnings:
- Type-only imports are erased at compile time
- NestJS needs actual class imports for DI
- Docker cache can mask source code changes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:09:38 +01:00
Wuesteon
d69cc60744 🐛 fix(auth): remove type-only import of ConfigService in AiService
The `type` keyword on ConfigService import was causing NestJS to fail resolving the dependency at runtime, as type-only imports are erased during compilation. Changed to regular import to fix DI.

Error was: "Nest can't resolve dependencies of the AiService (?)"

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:08:37 +01:00
Wuesteon
040d044496 🐛 fix(mana-core-auth): add ConfigModule import to AiModule
Fixes NestJS dependency injection error where AiService couldn't
resolve ConfigService dependency.

Error:
> Nest can't resolve dependencies of the AiService (?).
> Please make sure that the argument Function at index [0] is available

Root cause: AiModule was missing ConfigModule in its imports array,
but AiService constructor requires ConfigService to read ai.geminiApiKey.

This was preventing mana-core-auth from starting in staging deployment.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:46:39 +01:00
Wuesteon
234703a130 ♻️ refactor(cd): hardcode non-sensitive config in staging workflow
Reduced GitHub Secrets requirements from 21 to 12 by hardcoding
non-sensitive configuration values directly in the workflow file.

Changes:
- Hardcoded: DB/Redis host/port, STAGING_HOST, STAGING_USER, MANA_SERVICE_URL
- Keep as secrets: passwords, API keys, JWT keys, SSH private key
- Updated generate-staging-secrets.sh to reflect reduced secret list
- Added get-ssh-key.sh helper script for SSH key extraction

Benefits:
- Fewer secrets to manage in GitHub
- Configuration visible in code review
- Easier to update non-sensitive values (no UI navigation)
- Better separation of config vs secrets

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:11:36 +01:00
Wuesteon
cf2b6aaa2b 🐛 fix(cd): fix postgres startup and health check issues in staging
Fixes two critical deployment issues:

1. Postgres Container Startup Failure:
   - Remove missing init.sql volume mount that caused postgres to fail
   - Postgres was trying to mount ./docker/postgres/init.sql which doesn't exist
   - Added REDIS_PASSWORD environment variable

2. Health Check SSH Issues:
   - Consolidated health checks into single SSH session
   - Increased wait time from 30s to 60s for services to fully initialize
   - Improved health check output with clear status messages
   - Added container status logging for debugging

3. Docker Compose Improvements:
   - Remove obsolete 'version: 3.9' field (deprecated in Compose v2)
   - Increase initial startup wait from 10s to 15s

Changes to docker-compose.staging.yml:
- Removed non-existent init.sql volume mount from postgres
- Removed obsolete version field

Changes to .github/workflows/cd-staging.yml:
- Added REDIS_PASSWORD to environment variables
- Consolidated health checks into single SSH session (fixes "ssh: command not found")
- Increased wait times for service initialization
- Improved logging and error messages

This should fix the "dependency failed to start: container manacore-postgres-staging is unhealthy" error.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 04:21:15 +01:00
Wuesteon
f7986bc1a7 🐛 fix(cd): fix staging deployment registry authentication and missing images
Changes to .github/workflows/cd-staging.yml:
- Add Docker login step for GitHub Container Registry (ghcr.io)
- Add permissions for packages:read
- Update service deployment options to only include services with Dockerfiles
- Update health checks to match deployed services

Changes to docker-compose.staging.yml:
- Comment out services without Dockerfiles:
  - maerchenzauber-backend (no Dockerfile yet)
  - nutriphi-backend (no Dockerfile yet)
  - news-api (no Dockerfile yet)
- Keep only services with Docker images:
  - mana-core-auth 
  - chat-backend 
  - manadeck-backend 
- Update nginx dependencies to remove disabled services

This fixes the "error from registry: denied" error that was preventing
staging deployments. The deployment was trying to pull Docker images
that were never built because those services don't have Dockerfiles.

Now only services with actual Docker images will be deployed to staging.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 03:22:07 +01:00
Wuesteon
a87e1389cf 🐛 fix(docker): fix manadeck backend Dockerfile to use pnpm
Changes:
- Replace npm with pnpm for workspace dependency support
- Copy workspace files (pnpm-workspace.yaml, package.json, pnpm-lock.yaml)
- Copy and build shared package dependencies:
  - @manacore/shared-errors
  - @manacore/manadeck-database
  - @mana-core/nestjs-integration
- Use pnpm install --frozen-lockfile
- Update base image to node:20-alpine
- Use dumb-init for proper signal handling

This fixes the "Unsupported URL Type 'workspace:'" error that was
preventing Docker builds. The new approach matches the pattern used
by the chat backend Dockerfile.

Fixes build error in CI/CD pipeline.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 02:43:58 +01:00
Wuesteon
aca6cdbaa5 🐛 fix(build): fix build errors and add troubleshooting docs
Fixes multiple build errors discovered after removing recursive turbo calls:

1. Documentation:
   - Add comprehensive TROUBLESHOOTING.md covering recursive turbo issues
   - Includes prevention checklist and validation scripts
   - Documents both build and linting recursive problems

2. Storage app fixes:
   - Fix nested button HTML validation in FileCard, FolderCard, FileRow, FolderRow
   - Fix theme constant imports (DEFAULT_VARIANT, THEME_VARIANTS)
   - Fix auth component imports (StorageLogo → ManaIcon)

3. Presi app fixes:
   - Fix authStore import mismatch (authStore → auth)

Build time improved from infinite loop to 36.3s (39/39 tasks successful).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 02:19:11 +01:00
Wuesteon
e32e4b1b3a 🐛 fix(build): remove recursive build scripts from parent packages
Parent workspace packages (apps/*/package.json, games/*/package.json) had
build scripts that called 'turbo run build' or 'pnpm run --recursive build',
creating infinite recursion when root turbo orchestrates builds.

When root turbo runs 'build', it finds packages with build scripts and
executes them. If those scripts also call 'turbo run build', it spawns
another turbo process → infinite loop.

Changes:
- Removed 'build' script from 7 parent packages (calendar, contacts, zitare, picture, presi, mana-games, voxel-lava)
- Also removed redundant 'clean', 'lint', 'type-check' scripts where they had recursive calls
- Root turbo.json already handles orchestration of these tasks

This follows the guideline in CLAUDE.md:
> Parent workspace packages must NEVER have scripts that call turbo run
> for tasks that turbo orchestrates from the root.

Fixes CI build timeout (was running for 10+ minutes with infinite task spawning).
2025-12-04 01:59:53 +01:00
Nils Weiser
88c10e4ef7
Merge pull request #8 from Memo-2023/feat/code-quality
🔧 Improve code quality: Unified ESLint config with optimizations
2025-12-04 01:37:17 +01:00
Wuesteon
16a605097f 🐛 fix(ci): correct GitHub context property in test workflow
- Change `context.repo.name` to `context.repo.repo` (line 387)
- Fixes 404 error when posting PR comments
- GitHub Actions context uses `repo.repo` not `repo.name`

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 01:26:04 +01:00
Wuesteon
5ea7767833 🐛 fix(chat-backend): add missing shared-nestjs-auth package to Dockerfile
- Copy packages/shared-nestjs-auth in build stage
- Build shared-nestjs-auth before backend
- Resolves TS2307 errors in Docker build CI

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 01:16:02 +01:00
Wuesteon
4900106021 🎨 style: fix Prettier formatting issues
Fixed formatting in 21 files across calendar, contacts, manacore, manadeck,
picture, storage apps and shared-ui package.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 01:05:10 +01:00
Wuesteon
843cf1e678 fixes 2025-12-04 00:51:40 +01:00
Wuesteon
e9caa4a217 fix lint 2025-12-04 00:32:13 +01:00
Wuesteon
16cb8e753b improve code quality 2025-12-03 23:42:37 +01:00
Wuesteon
ec23630755 🔧 chore: add lint:root and lint:fix scripts
- lint:root: run ESLint with root config on all files
- lint:fix: run ESLint with auto-fix

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 13:58:40 +01:00
Wuesteon
f720a25c20 🔧 chore: enforce stricter ESLint rules
- no-explicit-any: warn (was off)
- no-unused-vars: error (was warn)
- Removed no-require-imports override (use default)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 13:52:30 +01:00
Wuesteon
fd962c30b2 🔧 chore: add root ESLint config and enable lint in pre-commit
- Add eslint.config.mjs at root with TypeScript/JS rules
- Configure lint-staged to run ESLint --fix on JS/TS files
- Add ESLint dependencies to root package.json
- Set "type": "module" in package.json to fix module warning
- Ignore projects with their own ESLint configs

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 13:49:57 +01:00
Wuesteon
0086e33910 🔧 chore(voxel-lava): add ESLint v9 flat config for backend
- Add eslint.config.mjs with ESLint v9 flat config
- Add missing dependencies (@eslint/js, globals, typescript-eslint)
- Auto-fix formatting issues from ESLint --fix

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 13:45:37 +01:00
Till-JS
110c6779a8 🐛 fix(calendar): shift FAB buttons when PillNav is in sidebar mode
FAB buttons (calendar icon and new event) are now positioned further
right when PillNav is displayed as a sidebar to avoid overlap.
2025-12-03 12:46:34 +01:00
Till-JS
80f8a0338e feat(calendar): add event detail modal and structured location fields
- Fix API response extraction for events and calendars (fixes Invalid Date)
- Convert event detail page to URL-based modal overlay (/?event=<id>)
- Add structured location fields (street, postal code, city, country)
- Add location details toggle in EventForm and QuickEventOverlay
- Add YearView component
- Improve calendar views with URL-based event navigation
- Move calendar settings to settings page
2025-12-03 12:44:39 +01:00
Till-JS
ba746fce04 Merge branch 'main' of https://github.com/Memo-2023/manacore-monorepo 2025-12-03 11:57:30 +01:00
Till-JS
e56485f21e feat(calendar): improve header UI and add quick event overlay
- Compact header styling with smaller buttons and reduced padding
- Add configurable hour filter display in header
- Add QuickEventOverlay component for fast event creation
- Add allDayDisplayMode to event metadata types
- Extend settings store with filter hours configuration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 11:54:17 +01:00
Wuesteon
09477e0aae 🐛 fix(mana-games): clean dist before Astro build
Fixes race condition in CI where stale dist/renderers.mjs causes build failures.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 02:38:38 +01:00
Wuesteon
8cdb950cad 🐛 fix(mana-games): use openai package for Azure OpenAI client
Replace @azure/openai with openai package - AzureOpenAI class is
exported from the official openai SDK, not @azure/openai v2.
2025-12-03 02:20:09 +01:00
Wuesteon
86da45a0c8 🔧 chore: add lint-staged for pre-commit formatting
- Install lint-staged to format staged files before commit
- Update pre-commit hook to run lint-staged then type-check
- Auto-format ts, tsx, js, jsx, json, md, svelte, astro files
2025-12-03 02:04:41 +01:00
Wuesteon
ea3582d487 💄 style: apply prettier formatting across codebase
Run prettier --write to fix formatting inconsistencies in 80 files
across calendar, contacts, picture, presi, storage, zitare apps
and shared packages/documentation.
2025-12-03 02:02:09 +01:00
Wuesteon
6c9e8972a7 fix: update docker registry to ghcr.io/memo-2023 2025-12-03 01:46:16 +01:00
Wuesteon
0b539bde6b 📝 docs: add comprehensive Claude Code guidelines
Add detailed documentation for Claude Code in .claude/ directory:
- code-style.md: formatting, naming, linting rules
- database.md: Drizzle ORM patterns and schema conventions
- testing.md: Jest/Vitest patterns with mock factories
- nestjs-backend.md: controller, service, DTO patterns
- error-handling.md: Go-style Result types and error codes
- sveltekit-web.md: Svelte 5 runes and store patterns
- expo-mobile.md: React Native with NativeWind
- authentication.md: Mana Core Auth integration

Update root CLAUDE.md to reference new guidelines
2025-12-03 00:44:49 +01:00
Till-JS
482509a574 🐛 fix(theme): add ShadCN-style CSS variable aliases for shared components
- Add aliases without color- prefix (--background, --foreground, --primary, etc.)
- Fix Mana/Subscription page styling across all apps
- Remove conflicting legacy aliases from contacts app.css
- Update contacts mana page to use toast instead of alert

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:20:49 +01:00
Till-JS
b01153ba87 🐛 fix(calendar): improve drag & drop and resize behavior
- Add hasMoved state to prevent accidental updates on simple clicks
- Only persist changes when actual drag/resize movement occurred
- Add Escape key handler to cancel drag/resize operations
- Improve visual feedback during resize with dashed outline
- Fix click handler to properly ignore clicks after drag/resize

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:14:47 +01:00
Till-JS
0e5d923faf feat(auth): add centralized user settings synced across all apps
- Add settings module to mana-core-auth with REST API endpoints
- Create user_settings table with globalSettings and appOverrides (JSONB)
- Add createUserSettingsStore() factory in shared-theme package
- Integrate user settings in all app layouts (calendar, chat, contacts, etc.)
- Support for nav position, theme, locale settings with per-app overrides
- Optimistic updates with localStorage caching for offline support
- Add comprehensive documentation in docs/USER_SETTINGS.md

API Endpoints:
- GET /api/v1/settings - Get all user settings
- PATCH /api/v1/settings/global - Update global settings
- PATCH /api/v1/settings/app/:appId - Set app override
- DELETE /api/v1/settings/app/:appId - Remove app override

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 00:09:47 +01:00
Wuesteon
2154c3b37a 🔧 chore: add Husky pre-commit hook for type-check
Set up Husky to run pnpm run type-check before every commit,
preventing commits with TypeScript errors.
2025-12-03 00:08:06 +01:00
Wuesteon
2635281fd4 feat(storage): add shared package types and configuration
Add missing tsconfig.json and source files for @storage/shared package
to fix type-check failures. Includes type definitions for StorageFile,
StorageFolder, FileVersion, Share, Tag, and FileTag interfaces.
2025-12-03 00:04:35 +01:00
Till-JS
0f2aae631d feat(calendar): add drag & drop and page-level scrolling
- Add drag & drop for events in all 6 calendar views (Day, Week, Month, 5/10/14-day)
- Add resize handles for adjusting event start/end times
- Remove internal scroll containers for page-level scrolling
- Add 15-minute snap-to-grid for time adjustments
- Add view type selector in CalendarHeader
- Add sidebar collapsed state management
2025-12-02 23:42:03 +01:00
Till-JS
9d8c1849ee feat(calendar): add comprehensive settings and profile pages
- Add settings store with localStorage persistence for user preferences
- Implement language selection (DE, EN, FR, ES, IT) in settings
- Add calendar view settings: default view, week start day, time format
- Add weekday-only filter and week number display options
- Add event defaults: duration and reminder settings
- Integrate settings into WeekView, MonthView, MultiDayView components
- Add profile page to calendar and contacts web apps
- Support drag & drop and resize for events in WeekView

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 23:18:49 +01:00
Till-JS
02c82c7547 feat(a11y): add accessibility settings and theme improvements
Add comprehensive accessibility support across shared packages:
- A11y store with contrast, colorblind mode, and reduce motion settings
- A11yQuickToggles and A11ySettings UI components
- PillNavigation and PillDropdown components in shared-ui
- Calendar app updates to integrate new theme/a11y features

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:56:09 +01:00
Till-JS
6cc9f70a4a feat(contacts): add archive, favorites, groups, and feedback pages
- Add feedback service and route
- Add archive page for deleted contacts
- Add favorites page for starred contacts
- Add groups page for contact organization
- Add mana integration page

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 14:42:01 +01:00
Till-JS
fa13f98a65 🔧 fix(auth): skip migrations in Docker entrypoint
- Skip automatic migrations in Docker - tables are managed via 'pnpm db:push' locally
- Simplifies startup and avoids migration conflicts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 14:41:34 +01:00
Till-JS
19500e8467 feat(storage): add Storage app scaffolding and root config
- Add storage app directory structure
- Add storage dev scripts to root package.json
- Add storage backend and web env generation in generate-env.mjs
- Update COMMANDS.md with calendar app reference

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 14:41:15 +01:00
Till-JS
1a88dec0a5 🔧 fix(shared-storage): update build configuration for CommonJS
- Change module from ESNext to CommonJS for NestJS compatibility
- Update moduleResolution from bundler to node
- Add build script and dist exports to package.json
- Remove .js extensions from imports for better compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 14:40:55 +01:00
Till-JS
2a040102b6 feat(branding): add Calendar and Storage app branding
- Add calendar and storage SVG icons to app-icons.ts
- Add CalendarLogo.svelte and StorageLogo.svelte components
- Add Calendar and Storage to MANA_APPS with descriptions
- Add APP_URLS entries for calendar and storage
- Update AppId type to include 'calendar'
- Fix Picture port from 5179 to 5185

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 14:40:30 +01:00