Commit graph

1322 commits

Author SHA1 Message Date
Till-JS
5fe16b5eec feat(auth): add organization management endpoints
Add missing organization features for Teams functionality:
- PUT /auth/organizations/:id - update organization
- DELETE /auth/organizations/:id - delete organization
- PATCH /auth/organizations/:orgId/members/:memberId/role - update member role
- GET /auth/organizations/:id/invitations - list org invitations
- GET /auth/invitations - list user invitations
- DELETE /auth/invitations/:id - cancel or reject invitation
2026-02-16 12:47:49 +01:00
Till-JS
9d618b107c 📝 docs: add SEPA activation checklist with TODOs and test cases 2026-02-16 12:42:02 +01:00
Till-JS
6e7b671a73 feat(lightwrite): add UX improvements and beat library
Phase 1-5 implementation:
- Keyboard shortcuts (Space, arrows, M, L, +/-)
- Dark/Light mode with theme store
- Loop regions for practice sections
- Mobile responsive view with tabs
- Beat library with preview and use functionality

Backend:
- Add library_beats schema
- Add library beat endpoints (GET list, GET download-url, POST use)

Frontend:
- BeatLibrary component with preview player
- BeatUploader tabs (Upload/Library)
- Theme-aware waveform colors
- Compact mobile playback controls

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 12:14:13 +01:00
Till-JS
b5d7524c77 💳 feat(stripe): add SEPA Direct Debit payment option
- Add sepa_debit to payment_method_types for credit purchases
- Add sepa_debit to subscription checkout sessions
- Handle payment_intent.processing webhook for SEPA status tracking
- Add blueprint article analyzing payment options (Stripe vs LSV+/FinTS)

SEPA offers lower fees (0.8% vs 1.5%+€0.25) for DACH customers.
Payments are confirmed 3-14 days after checkout (bank processing).
2026-02-16 12:05:19 +01:00
Till-JS
0e8f6f134e 📝 docs(credits): update documentation for simplified credit system
- Remove free credits and signup bonus references
- Remove B2B organization credits documentation
- Update API responses (no freeCreditsRemaining, dailyFreeCredits)
- Update environment variables (remove CREDITS_SIGNUP_BONUS, CREDITS_DAILY_FREE)
- Update JWT info to reflect EdDSA via Better Auth
- Simplify DATABASE_SCHEMA.md to B2C-only flow
2026-02-16 12:03:35 +01:00
Till-JS
d86e9031bb 🐛 fix(auth): skip body parser for Stripe webhooks
The JSON body parser was consuming the request body before NestJS
could access the rawBody needed for Stripe webhook signature
verification. Now webhooks to /api/v1/webhooks/stripe skip the
body parser middleware.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 12:01:24 +01:00
Till-JS
bfc2737ce5 ♻️ refactor(credits): simplify credit system by removing free credits and B2B
Remove free credits system (signup bonus, daily credits) and B2B organization
credits to simplify the codebase. Credits now only come from purchases or gifts.

Changes:
- Remove freeCreditsRemaining, dailyFreeCredits, lastDailyResetAt from balances
- Remove organizationBalances and creditAllocations tables from schema
- Simplify transaction types to: purchase, usage, refund, gift
- Remove B2B endpoints from credits controller
- Remove checkDailyReset, allocateCredits, deductCredits from service
- Add redeemPendingGifts method to auto-redeem gifts on registration
- Update frontend to remove free credits display
- Add database migration for the changes
- Update all related tests to match simplified system
2026-02-16 11:54:32 +01:00
Till-JS
b9669c3ba5 🎨 refactor(matrix): use elevation system for RoomSettingsPanel
Replace glassmorphic styling with semantic elevation classes:
- bg-surface-elevated for elevated overlays
- bg-surface for nested cards/inputs
- border-border for consistent borders
- hover:bg-surface-hover for hover states
- text-error and bg-success for semantic colors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:45:39 +01:00
Till-JS
2e660391ce 💳 feat(stripe): add ManaCore unified subscription plans
- Create Plus/Pro/Ultra subscription tiers with Stripe products & prices
- Add credit packs (100/500/1000) for one-time purchases
- Update seed script with new plan structure and Stripe IDs
- Configure webhook secret and customer portal
- Add all Stripe environment variables to .env.development

Plans:
- Free: 50 credits/month (default)
- Plus: 100 credits/month @ €4.99/mo or €49.99/yr
- Pro: 500 credits/month @ €11.99/mo or €119.99/yr
- Ultra: 2000 credits/month @ €24.99/mo or €249.99/yr

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:43:04 +01:00
Till-JS
7747ca6a36 📝 docs(devlog): add missing devlogs for Jan 24-27 and Feb 14-15
Add 5 devlogs covering previously undocumented development days:
- 2026-01-24: Guest mode improvements for Clock & Contacts
- 2026-01-25: NutriPhi app, Prometheus monitoring, Watchtower
- 2026-01-27: Matrix self-hosting, Stats/Doc/Ollama bots
- 2026-02-14: Matrix STT bot, gift code UI, onboarding bot
- 2026-02-15: Onboarding modal polish, Calendar ViewsBar
2026-02-16 11:40:37 +01:00
Till-JS
f77edbdedd 🐳 fix(lightwrite): add shared-nestjs-setup to Dockerfile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:31:38 +01:00
Till-JS
bba3d975c1 🔒 chore: update pnpm-lock.yaml for lightwrite shared package
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:30:02 +01:00
Till-JS
ea0bf67f0d 🎨 style(matrix): fix RoomSettingsPanel styling to match app theme
Replace DaisyUI classes with the custom glassmorphic theme:
- Use bg-white/80 dark:bg-black/80 with backdrop-blur
- Use border-black/10 dark:border-white/10 for borders
- Use text-foreground and text-muted-foreground for text
- Add gradient avatars matching rest of app
- Fix tab styling with proper active states

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:25:54 +01:00
Till-JS
52f88af4c5 🐛 fix(clock-bot): enable Redis session storage for widget
Widget module now uses Redis storage mode to share sessions with
the bot module. This enables Matrix-SSO-Link auto-login for widget.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:20:54 +01:00
Till-JS
6797195bdc 🔧 chore(infra): add lightwrite subdomain configuration
- Add lightwrite.mana.how → localhost:5180
- Add lightwrite-api.mana.how → localhost:3010

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:19:54 +01:00
Till-JS
376ba8279d feat(matrix): add widget support to Manalink client
Add the ability to view and interact with Matrix widgets in the room
settings panel. Widgets are displayed in a new "Widgets" tab with
collapsible iframes.

- Add RoomWidget type to types.ts
- Add getRoomWidgets() and buildWidgetUrl() methods to store
- Add Widgets tab to RoomSettingsPanel with iframe display
- Handle Matrix variable substitution ($matrix_user_id, $matrix_room_id)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:16:27 +01:00
Till-JS
78c7383d54 feat(lightwrite): add Beat/Lyrics Editor app
- Add NestJS backend with project, beat, marker, lyrics, export modules
- Add SvelteKit web app with wavesurfer.js waveform visualization
- Add BPM detection using Web Audio API peak detection
- Add marker timeline for parts, hooks, bridges
- Add lyrics editor with timestamp sync
- Add export to LRC, SRT, JSON formats
- Add shared-storage support for lightwrite
- Fix mana-core-auth env loading (add dotenv before validation)
- Add lightwrite to setup-databases.sh
- Fix matrix-onboarding-bot type errors (displayName → fullName)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 11:13:08 +01:00
Till-JS
7b2ae94474 💄 fix(onboarding): use correct elevation layer colors for modal 2026-02-16 10:48:01 +01:00
Till-JS
d7ce61565f 💄 style(onboarding): convert fullscreen to compact modal 2026-02-16 10:41:44 +01:00
Till-JS
2e37925cb0 🔧 chore: add STT_API_KEY to all Matrix bots using STT
- Add STT_API_KEY to matrix-mana-bot and matrix-clock-bot
- Fix STT_URL port (3020/3021 → 3026) for consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 00:12:09 +01:00
Till-JS
0f24e085f6 feat(bot-services): add API key support to TranscriptionService
- Add apiKey option to TranscriptionModuleOptions
- Send X-API-Key header in all STT requests when configured
- Support config via module options, stt.apiKey, or STT_API_KEY env var
- Update CLAUDE.md documentation with API key usage example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 00:11:24 +01:00
Till-JS
32f84678f9 feat(calendar): unify view switcher into new ViewsBar component
- Add new ViewsBar component with same design as InputBar
- Position ViewsBar next to InputBar (left on desktop, above on mobile)
- Remove view switcher from PillNavigation prependElements
- Remove PillViewSwitcher from CalendarToolbarContent
- Clean up unused imports and code from layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 00:07:49 +01:00
Till-JS
9bb8d3a21f 🔥 chore(gifts): remove debug logging after fixing userId undefined 2026-02-16 00:02:49 +01:00
Till-JS
670073e3c2 🐛 fix(gifts): fix userId undefined - guard used userId but controller expected sub 2026-02-15 23:55:42 +01:00
Till-JS
ec8395858b fix(matrix-stt-bot): use same Dockerfile pattern as TTS bot 2026-02-14 14:34:14 +01:00
Till-JS
0a439bb802 fix(matrix-stt-bot): fix Dockerfile build order and port 2026-02-14 14:32:23 +01:00
Till-JS
aabc4a6db8 🔧 chore: build matrix-mana-bot locally for quick fixes 2026-02-14 14:31:45 +01:00
Till-JS
c7039356f1 feat(docker): add matrix-stt-bot to Mac Mini deployment
- Add STT bot container config on port 4021
- Uses mana-stt service via host.docker.internal:3026

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:31:01 +01:00
Till-JS
69f2eaf2e4 🐛 fix(matrix-bot-common): ignore edit events to prevent bot duplicate responses
When a bot edits its message (like timer updates), other bots were
responding to each edit as if it were a new message. This fix adds
isEditEvent() check to ignore m.replace events.
2026-02-14 14:30:49 +01:00
Till-JS
e357f9f292 feat(matrix-stt-bot): add speech-to-text Matrix bot
- New bot that transcribes voice messages to text
- Uses mana-stt service (Whisper/Voxtral) for transcription
- Supports German and English with auto-detection
- Commands: !language, !model, !status, !help
- Runs on port 3024

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:29:34 +01:00
Till-JS
d7236d61fa debug: add detailed logging for gift redemption 2026-02-14 14:28:37 +01:00
Till-JS
79f1155dfd feat(nutriphi-bot): auto-analyze text meal descriptions
- Add looksLikeMealDescription() heuristic to detect meal descriptions
- Add autoAnalyzeText() to handle automatic text analysis
- Text messages with food keywords or numbers are now auto-analyzed
- Skip greetings and questions to avoid false positives
2026-02-14 14:18:10 +01:00
Till-JS
43ac782892 docs(matrix-bot-common): document bot-to-bot loop prevention
Added documentation for the isBot() method and automatic bot message
filtering that prevents infinite loops when multiple bots share a room.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:05:34 +01:00
Till-JS
97264cd849 🔧 chore(clock-bot): add detailed topic update logging 2026-02-14 14:03:04 +01:00
Till-JS
ab677b28c8 🐛 fix(gifts): explicitly set nullable fields to null in DB inserts
Drizzle ORM requires explicit null values for optional fields instead of
leaving them undefined. Added explicit null for organizationId,
idempotencyKey, portionNumber, and creditTransactionId.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 14:02:46 +01:00
Till-JS
102f0df518 🔧 chore(clock-bot): improve room topic error logging 2026-02-14 13:52:20 +01:00
Till-JS
72b162524c 🐛 fix(gifts): convert undefined sourceAppId to null for Drizzle
Drizzle ORM throws "UNDEFINED_VALUE" error when inserting undefined values.
Convert dto.sourceAppId to null using nullish coalescing operator.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:50:01 +01:00
Till-JS
ba818ef256 fix(clock-bot): improve room topic error logging
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:47:15 +01:00
Till-JS
5ef04eabb2 🐛 fix(nutriphi-backend): change user_id from uuid to text
Better Auth generates string IDs, not UUIDs. Updated schema to match
other apps like Calendar that use text for user_id.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:44:05 +01:00
Till-JS
2e8b3b903b fix(matrix-bot-common): ignore messages from other bots
Prevents infinite message loops when multiple bots are in the same room.
Checks if sender has '-bot' in their Matrix user ID localpart.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:40:59 +01:00
Till-JS
c8ab4bbcbe 🐛 fix(nutriphi-web): fix i18n hydration error
- Don't call $t() before i18n is loaded
- Use loading spinner instead of translated text during load
- Conditionally render title in svelte:head

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:39:35 +01:00
Till-JS
992181cc87 feat(clock-bot): add timer status to room topic (Phase 3)
- Store original room topic when timer starts
- Update room topic with timer progress every 10 seconds
- Show status icon, remaining time, percentage, and label
- Restore original topic when timer finishes or is deleted

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:36:08 +01:00
Till-JS
db7f2dfe08 🐛 fix(nutriphi-web): add shared-api-client to Dockerfile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 13:32:52 +01:00
Till-JS
1052dcafca 🐛 fix(nutriphi-web): add missing shared packages to Dockerfile
Add shared-vite-config and shared-tsconfig to Dockerfile COPY statements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:50:01 +01:00
Till-JS
8dad8a8302 🐛 fix(manacore-web): use runtime auth URL instead of hardcoded localhost
Added shared config.ts with getManaAuthUrl() that reads the auth URL from
window.__PUBLIC_MANA_CORE_AUTH_URL__ (injected by hooks.server.ts) instead
of hardcoded localhost:3001. Fixes API calls failing on production.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:47:40 +01:00
Till-JS
5025bfa883 fix(clock-bot): optimize widget styling for Element info panel
- Use transparent background to adapt to Element theme
- Remove min-height and centering (content starts at top)
- Reduce font sizes and spacing for compact display
- Use semi-transparent backgrounds for theme compatibility
- Add flex-wrap for narrow panels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:46:19 +01:00
Till-JS
0a41640c19 chore(onboarding-bot): add bot user creation script
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:43:29 +01:00
Till-JS
a6fc1cb66e feat(onboarding): add Matrix onboarding bot for profile setup
- Add matrix-onboarding-bot service that guides users through profile setup
- Extend mana-core-auth GlobalSettings with displayName, interests, onboardingCompleted fields
- Implement state machine for onboarding flow (NAME → INTERESTS → LANGUAGE → SUMMARY)
- Support commands: !start, !profile, !edit, !skip, !help
- Add German and English localization
- Integrate with mana-core-auth Settings API for profile persistence

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:42:41 +01:00
Till-JS
531ed3e215 📝 docs(nutriphi): update Gemini model version to 2.5 Flash
- Updated Technology Stack to reflect gemini-2.5-flash model
- Added note about getting API key from Google AI Studio

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:41:32 +01:00
Till-JS
e4ac539495 chore: update pnpm-lock.yaml for clock-bot @types/express
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 12:39:16 +01:00