Commit graph

108 commits

Author SHA1 Message Date
Claude
bd72b4d6d5
feat(search): implement mana-search microservice
Central search microservice for all ManaCore apps featuring:

- NestJS API on port 3021
- SearXNG meta-search engine integration (40+ search engines)
- Redis caching layer for search results and extracted content
- Content extraction with markdown conversion
- Prometheus metrics for monitoring

API Endpoints:
- POST /api/v1/search - Web search with categories/engines
- POST /api/v1/extract - Content extraction from URLs
- POST /api/v1/extract/bulk - Bulk extraction
- GET /health - Health check
- GET /metrics - Prometheus metrics

Search categories: general, news, science, it, images, videos
Supported engines: Google, Bing, DuckDuckGo, Wikipedia, arXiv,
GitHub, StackOverflow, and many more.

https://claude.ai/code/session_01Rk3YVJCU3nM8uvVPghRz6r
2026-01-28 20:41:59 +00:00
Till-JS
bea066c7f8 fix(auth): correct JWKS route mapping for OIDC
JWKS is at /api/auth/jwks, not /api/auth/oauth2/jwks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:13:28 +01:00
Till-JS
f6382ead87 fix(auth): map OIDC routes to Better Auth's /api/auth/oauth2/* paths
Better Auth's OIDC Provider plugin uses routes under /api/auth/oauth2/
rather than /api/oidc/. This commit maps incoming routes correctly:
- /.well-known/openid-configuration → /api/auth/.well-known/openid-configuration
- /api/oidc/* → /api/auth/oauth2/*

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:10:41 +01:00
Till-JS
ef7f906215 debug(auth): add OIDC request logging
Add console.log statements to debug OIDC routing issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:05:45 +01:00
Till-JS
e2a3277fa1 feat(matrix-clock-bot): add Matrix bot for time tracking
- Add Docker build configuration with npm overrides for matrix-sdk
- Update port from 3317 to 3318 to avoid conflict with Zitare bot
- Add tsconfig.build.json for production builds
- Add clock-bot service to docker-compose.macmini.yml
- Bot supports timers, alarms, and world clocks via Matrix chat

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:04:45 +01:00
Till-JS
9a7afea7fe fix(auth): use object syntax for global prefix excludes
Use { path, method } syntax for NestJS global prefix excludes to ensure
OIDC routes (.well-known/*, api/oidc/*) are properly excluded from the
/api/v1 prefix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:52:27 +01:00
Till-JS
00d28bc522 feat(auth): add OIDC Controller for Matrix SSO endpoints
- Add OidcController to expose Better Auth OIDC Provider endpoints
- Add handleOidcRequest method to BetterAuthService
- Exclude OIDC routes from global /api/v1 prefix
- Register OidcController in AuthModule

Endpoints:
- GET /.well-known/openid-configuration
- GET /api/oidc/authorize
- POST /api/oidc/token
- GET /api/oidc/userinfo
- GET /api/oidc/jwks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:49:26 +01:00
Till-JS
a532790d99 feat(matrix-zitare-bot): add Matrix bot for daily inspiration quotes
Features:
- Random quotes and daily quote of the day
- 10 categories (motivation, wisdom, love, life, success, etc.)
- Search functionality
- Login integration with Zitare backend
- Favorites and lists management
- Voice note transcription via mana-stt
- Natural language command support (German/English)
2026-01-28 16:45:11 +01:00
Till-JS
158aaf7e67 feat(auth): add OIDC Provider for Matrix SSO integration
- Add OIDC Provider plugin to Better Auth configuration
- Add OIDC database tables (oauth_applications, oauth_access_tokens,
  oauth_authorization_codes, oauth_consents)
- Configure Synapse as OIDC client in homeserver.yaml
- Update Element Web config for SSO support
- Add seed script for OIDC clients (db:seed:oidc)
- Update Cloudflare tunnel config with Matrix URLs

This enables Single Sign-On between Mana Core Auth and Matrix/Synapse,
allowing users to authenticate via their existing Mana account.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:40:33 +01:00
Till-JS
dbd14f7134 feat(matrix-clock-bot): add Matrix bot for time tracking
Features:
- Timer commands: !timer 25m, !stop, !resume, !reset, !status
- Alarm commands: !alarm 07:30, !alarms
- World clock: !zeit, !weltuhr Berlin, !weltuhren
- Voice note support via mana-stt transcription
- Natural language parsing for German time formats
2026-01-28 16:27:49 +01:00
Till-JS
1f5df44cb0 🙈 chore(matrix-nutriphi-bot): add dockerignore 2026-01-28 16:13:32 +01:00
Till-JS
3b9d99ccd9 feat(matrix-bots): add voice note transcription via mana-stt
- Switch matrix-project-doc-bot from OpenAI Whisper to local mana-stt
- Add voice note support to matrix-nutriphi-bot (auto-analyze meals)
- Add voice note support to matrix-todo-bot (create todos via voice)
- All bots now use STT_URL config for the mana-stt service (port 3020)
2026-01-28 16:10:20 +01:00
Till-JS
57b9d4cb37 feat(matrix-nutriphi-bot): add Matrix bot for nutrition tracking
- NestJS bot with matrix-bot-sdk integration
- Commands: !help, !login, !analyze, !today, !week, !goals, !favorites, !tips
- Integrates with NutriPhi backend API (port 3023)
- User session management with JWT authentication
- Image analysis via Gemini AI (NutriPhi backend)
- Port 3316

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:57:49 +01:00
Till-JS
111fc473d9 🐛 fix(auth): implement password reset email link handler
- Add GET /api/auth/reset-password/:token endpoint to handle email links
- Create password-reset-redirect store to track source app URLs
- Include callbackURL in reset emails for proper app redirection
- Add redirectTo parameter to forgotPassword in shared-auth
- Create /reset-password page in calendar app with DE/EN translations
- Update calendar authStore with resetPasswordWithToken method

Fixes 404 error when clicking password reset link from email
2026-01-28 15:49:33 +01:00
Till-JS
2c341b5328 feat(matrix): add Matrix Todo Bot service
GDPR-compliant task management bot for Matrix with:
- Task CRUD: !add, !list, !done, !delete
- Priority support: !p1 to !p4
- Date shortcuts: @heute, @morgen, @übermorgen
- Project tags: #projektname
- Natural language keywords: hilfe, zeige aufgaben, heute
- Welcome messages and auto-pin help on room join
- Per-user task isolation via Matrix user ID
- Local JSON storage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:47:33 +01:00
Till-JS
ee630158c5 feat(matrix-ollama-bot): add natural language commands and welcome messages
- Add keyword detection for German/English commands (hilfe, modelle, status)
- Send welcome message when users join the room
- Send bot introduction when invited to new rooms
- Add !pin command to pin help message
- Auto-pin help when joining new rooms
- Update help text with simpler command overview

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:56:32 +01:00
Till-JS
e4145324b2 feat(matrix-ollama-bot): add vision commands and filter non-chat models
- Add !vision command to analyze images with vision models
- Add !vision:all command to compare all vision models
- Filter out specialized models (deepseek-r1) from !all comparison
- Add chatWithImage method to OllamaService for vision requests
- Switch Dockerfile from pnpm to npm for better compatibility
- Add .dockerignore and tsconfig.build.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:23:30 +01:00
Till-JS
836b341b3e feat(matrix-ollama-bot): add !all command for model comparison
- Add !all [question] command to query all models and compare responses
- Show response times for each model
- Update help text with new command and rename to Mana Chat

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:43:58 +01:00
Till-JS
8eac78599d fix(matrix-project-doc-bot): fix main.js path in Dockerfile
The dist output is at dist/src/main.js due to drizzle.config.ts at root level.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:01:06 +01:00
Till-JS
96e64b2a37 fix(matrix-bots): exclude crypto-nodejs module that fails on Alpine
Use pnpm overrides to replace @matrix-org/matrix-sdk-crypto-nodejs with
an empty package since E2E encryption is not needed for these bots.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:57:12 +01:00
Till-JS
8e6adfdb10 feat(services): add Telegram bot services for NutriPhi, Todo, and Zitare
Add three new Telegram bot services:

- telegram-nutriphi-bot: Nutrition tracking bot with Gemini AI analysis
  - Photo meal analysis
  - Daily nutrition goals and tracking
  - Statistics and reports

- telegram-todo-bot: Todo list management bot
  - Integration with Todo backend API
  - Reminder scheduling
  - User preferences per chat

- telegram-zitare-bot: Daily inspiration quotes bot
  - Scheduled daily quotes
  - Quote database with authors
  - User subscription management

All bots use NestJS with nestjs-telegraf for Telegram integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:52:01 +01:00
Till-JS
f778e95455 🐛 fix(auth): use node:20-slim for DuckDB glibc compatibility 2026-01-28 12:44:04 +01:00
Till-JS
53653743f0 fix(matrix-bots): add --ignore-scripts to Dockerfiles
Skip postinstall scripts for matrix-sdk-crypto-nodejs which
doesn't build on Alpine Linux. E2E encryption not needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:42:11 +01:00
Till-JS
b50376dfdb fix(matrix-bots): update to matrix-bot-sdk v0.7 API
- Import LogLevel separately instead of LogService.LogLevel
- Change sendTyping to setTyping
- Use any type for event handler to avoid generic type issues
- Fix Buffer to Uint8Array conversion for OpenAI File API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:40:28 +01:00
Till-JS
9dfad0128a 📈 feat(monitoring): upgrade to VictoriaMetrics + DuckDB analytics
- Replace Prometheus with VictoriaMetrics (2-year retention)
- Add DuckDB analytics module for business KPIs (unlimited retention)
- Add master overview dashboard combining all metrics
- Add business metrics dashboard for user growth tracking
- Add backup script for VictoriaMetrics snapshots and DuckDB
- Add ADR documentation for monitoring stack decision

Analytics API endpoints:
- GET /api/v1/analytics/health - Service health
- GET /api/v1/analytics/latest - Latest metrics snapshot
- GET /api/v1/analytics/growth - User growth over time
- GET /api/v1/analytics/monthly - Monthly aggregates
- POST /api/v1/analytics/snapshot - Manual snapshot trigger
2026-01-28 12:38:04 +01:00
Claude
7c5e9e3c49
feat(matrix): add Stats Bot and Project Doc Bot services
Complete GDPR-compliant bot suite for Matrix:

matrix-stats-bot (port 3312):
- Analytics reports from Umami
- Commands: !stats, !today, !week, !realtime, !users
- Scheduled daily/weekly reports to Matrix room

matrix-project-doc-bot (port 3313):
- Project documentation with photos, voice, text
- Voice transcription via OpenAI Whisper
- Blog generation with 5 styles (casual, technical, tutorial, social, story)
- Commands: !new, !projects, !switch, !status, !generate, !export
- Uses PostgreSQL + S3 (MinIO) for storage

Changes:
- docker-compose.macmini.yml: Added both Matrix bots
- health-check.sh: Added health checks for both bots

Environment variables required:
- MATRIX_STATS_BOT_TOKEN, MATRIX_PROJECT_DOC_BOT_TOKEN
- OPENAI_API_KEY (for Project Doc Bot)

https://claude.ai/code/session_01E3r5aFW3YLAhEJfsL2ryhv
2026-01-28 00:44:28 +00:00
Claude
aabe328b51
feat(matrix): add Matrix Ollama Bot service
GDPR-compliant replacement for telegram-ollama-bot using Matrix protocol:

New service: services/matrix-ollama-bot/
- NestJS application with matrix-bot-sdk
- Same functionality as telegram-ollama-bot
- Commands: !help, !models, !model, !mode, !clear, !status
- System prompts: default, classify, summarize, translate, code
- Chat history per user (last 10 messages)

Changes:
- docker-compose.macmini.yml: Added matrix-ollama-bot service
- health-check.sh: Added Matrix Ollama Bot health check

Environment variables required:
- MATRIX_OLLAMA_BOT_TOKEN: Bot access token
- MATRIX_OLLAMA_BOT_ROOMS: Optional room restrictions

https://claude.ai/code/session_01E3r5aFW3YLAhEJfsL2ryhv
2026-01-28 00:35:35 +00:00
Till-JS
e72f3b7865 🧑‍💻 feat(dx): improve local development experience
- Add dev credentials pre-fill on login page (dev@manacore.local)
- Add initialPassword prop to LoginPage component
- Add seed script for dev user (pnpm db:seed:dev in mana-core-auth)
- Add OLLAMA_URL to .env.development for Mac Mini connection
2026-01-27 16:58:11 +01:00
Till-JS
6402f287e8 feat(telegram-bot): add local STT support and Prometheus metrics
- Fix telegram_user_id column type (integer -> bigint) for large user IDs
- Add local STT support via mana-stt service (Whisper MLX + Voxtral)
- Add STT provider config (local/openai) with fallback support
- Add Grafana dashboard for mana-stt service metrics
- Add ollama-metrics-proxy for LLM metrics collection
- Add Grafana dashboard for Ollama LLM metrics

Services added/updated:
- telegram-project-doc-bot: local STT integration
- mana-stt: Grafana dashboard
- ollama-metrics-proxy: new service for Ollama metrics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:51:09 +01:00
Till-JS
7c20d88649 feat(services): add telegram-project-doc-bot service
Add new NestJS-based Telegram bot for project documentation with:
- Drizzle ORM for database access
- OpenAI integration for AI features
- S3 storage support via AWS SDK
- Monorepo integration (dev scripts, database setup, MinIO bucket)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 03:29:08 +01:00
Till-JS
bff80b552a fix(stt): remove unsupported add_generation_prompt kwarg 2026-01-27 03:24:43 +01:00
Till-JS
a2233dc366 fix(stt): properly encode audio as base64 for Voxtral 2026-01-27 02:13:34 +01:00
Till-JS
49255ac794 fix(stt): use correct AutoModel for Voxtral multimodal architecture 2026-01-27 01:58:32 +01:00
Till-JS
92a700ac7e fix(stt): change default model to large-v3 (large-v3-turbo not supported by lightning-whisper-mlx) 2026-01-27 01:36:49 +01:00
Till-JS
bf0fa04e7e feat(stt): add speech-to-text service for Mac Mini
Add mana-stt service with Whisper and Voxtral support for local
transcription. Includes setup script and launchd integration for
automatic startup on Mac Mini server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:33:10 +01:00
Till-JS
2ccd063628 feat(auth): redirect users to source app after email verification
Add sourceAppUrl tracking during registration to redirect users back
to the app they registered from after email verification. Includes
URL validation for security (only *.mana.how, mana.how, localhost).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:31:31 +01:00
Till-JS
ad4ae93f29 feat(auth): add email verification endpoint for Better Auth
Better Auth generates verification URLs with /api/auth/verify-email path,
but NestJS uses /api/v1 prefix. This adds a passthrough controller to
handle the native Better Auth routes and properly verify user emails.

- Add BetterAuthPassthroughController for /api/auth/* routes
- Add verifyEmail method to BetterAuthService
- Exclude /api/auth/* from global prefix in main.ts
- Register passthrough controller in AuthModule

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 20:28:30 +01:00
Till-JS
14aaf01fa3 fix(auth): move email verification config to correct location
Better Auth requires emailVerification config to be a separate top-level
option, not under emailAndPassword. Added sendOnSignUp: true to trigger
verification emails on registration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:54:35 +01:00
Till-JS
3f64c7422f feat(telegram-ollama-bot): add Telegram bot for local LLM inference via Ollama
- NestJS-based Telegram bot with nestjs-telegraf
- Ollama service for API communication with Gemma 3 4B
- Commands: /start, /help, /models, /model, /mode, /clear, /status
- Multiple modes: default, classify, summarize, translate, code
- Chat history with context (last 10 messages)
- User access control via TELEGRAM_ALLOWED_USERS
- Health endpoint for monitoring
- Updated MAC_MINI_SERVER.md with Ollama documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:43:41 +01:00
Till-JS
2975e5d2a1 fix(auth): add explicit types to email handlers
Fix TypeScript implicit any errors in sendVerificationEmail and
sendResetPassword handlers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:41:00 +01:00
Till-JS
5098250364 feat(auth): enable email verification for new user registrations
- Add sendVerificationEmail function in email.service.ts
- Enable requireEmailVerification in Better Auth config
- New users must verify their email before logging in

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:35:25 +01:00
Till-JS
8e1f44369a fix(auth): use correct Better Auth API method for password reset
Change from auth.api.forgetPassword to auth.api.requestPasswordReset
to match Better Auth's actual endpoint naming.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 15:20:16 +01:00
Till-JS
f173a2287e fix(auth): fix inviter name access in sendInvitationEmail
Access inviter.user.name instead of inviter.name to match Better Auth's
organization plugin type structure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 14:54:39 +01:00
Till-JS
fafa550a60 feat(auth): add Brevo SMTP email service for transactional emails
- Add nodemailer-based email service with Brevo SMTP integration
- Implement password reset, invitation, and welcome email templates
- Update better-auth.config.ts to use email service for sendResetPassword and sendInvitationEmail
- Add SMTP environment variables to docker-compose.macmini.yml
- Change minimum password length from 12 to 8 characters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 14:07:31 +01:00
Till-JS
85e8ff047a fix(auth): reduce minimum password length to 8 characters
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:14:10 +01:00
Till-JS
021c6e789e 🔧 fix(telegram-bot): improve database connection logging and error messages
- Add connection test on startup (SELECT 1)
- Log masked database URL on connection attempt
- Better error messages for /users command
2026-01-26 11:14:52 +01:00
Till-JS
0cd2bc858a feat(stats): add user statistics to Prometheus metrics and Grafana
- Add user metrics to mana-core-auth MetricsService:
  - auth_users_total: Total registered users
  - auth_users_verified: Email-verified users
  - auth_users_created_today/this_week/this_month
- Create Grafana user-statistics dashboard with:
  - User overview stats (total, verified, verification rate, new today)
  - Registration period breakdown (today/week/month)
  - User growth trends over time
- Enhance telegram-stats-bot /users command:
  - Add yesterday comparison with trends
  - Add week-over-week comparison
  - Add mini bar chart for last 7 days registration
- Include user stats in daily Telegram report
2026-01-26 10:53:57 +01:00
Till-JS
1c5a1b8442 feat(metrics): add Prometheus metrics to all backends
- Add metrics module to calendar, chat, clock, contacts backends
- Add metrics module to mana-core-auth service
- Expose /metrics endpoint for Prometheus scraping
- Track HTTP requests, response times, and custom business metrics

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-26 09:35:01 +01:00
Till-JS
f29ef4aa3a feat(infra): add Telegram Stats Bot for ManaCore analytics
Adds a NestJS service that delivers Umami analytics via Telegram:

- Telegram commands: /start, /stats, /today, /week, /realtime, /users
- Scheduled reports: Daily at 9:00, Weekly on Monday at 9:00
- Umami API integration with token management
- User statistics from auth database
- Docker + CI/CD pipeline integration

Bot: @stats_mana_bot

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:39:04 +01:00
Till-JS
e29f52135d fix: resolve build errors for mana-core-auth and clock-backend
- Add rememberMe field to sessions schema
- Mock non-existent service imports in tests
- Add missing docker-entrypoint.sh for clock-backend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 22:48:58 +01:00