11 Commits
Author SHA1 Message Date
GandClaude Opus 4.8 26b042cd86 chore(infra): remove Vercel references — self-hosted now (#120)
Botsmann now runs self-hosted on the Hetzner box "bitbaum" behind Caddy
(botsmann.orangecat.ch); Vercel is fully decommissioned.

- CI: rename the "Deploy to Vercel" workflow to a vendor-neutral CI workflow
  (build/lint/test only). Actual deploy runs from .husky/pre-push → Hetzner
  deploy script. Remove vercel.json and the Vercel-only deploy-monitor.sh.
- Docs: rewrite current-setup deploy/hosting text in .claude/CLAUDE.md,
  README badge, docs/COMMANDS.md and docs/SHARED_CONTEXT.md to the self-hosted
  box. Repoint the dead botsmann.vercel.app URL → botsmann.orangecat.ch.
- Code: neutralize "(Vercel)" route-segment comments; reword the warmup cron
  comment; update the demo page tech-stack line to self-hosted.
- Keep: secret-scan guardrail (VERCEL_OIDC_TOKEN) and `env -u VERCEL` in the
  husky hooks, the educational hosting-comparison page, historical docs/archive,
  and executive-docs business/finance planning material (see PR body).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 09:23:49 +02:00
g-butandClaude Opus 4.6 5c046fd1dc refactor(logging): replace console calls with structured logger
Create lib/logger.ts — lightweight wrapper that outputs plain text in dev
and structured JSON in production. Replace 117 console.log/error/warn
calls across 31 files (27 API routes + 4 lib files) with logger.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:55:28 +01:00
g-butandClaude Opus 4.6 61fe42d15b feat(documents): auto-detect domains during document processing
When a document is processed and has no user-assigned domains, analyze
its text content with the keyword-based domain detector and auto-tag it.
This ensures documents are correctly filtered when professionals search
for relevant context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:23:16 +01:00
g-butandClaude Opus 4.5 24e7caa1cb perf(api): add HTTP caching headers to reduce database load
Add Cache-Control header support to API response utilities:
- NONE: no-store for mutations and sensitive data
- PRIVATE_SHORT: 1 minute for user-specific data
- PRIVATE_MEDIUM: 5 minutes for less frequent user data
- PUBLIC_SHORT: 5 minutes for public data
- PUBLIC_MEDIUM: 1 hour for semi-static data
- IMMUTABLE: 1 day for truly static data

Apply caching to key routes:
- GET /api/settings: private, 1 min cache
- GET /api/health: public, 5 min cache
- GET /api/documents: private, 1 min cache
- GET /api/stats: private, 1 min cache
- GET /api/conversations: private, 1 min cache
- All mutations (POST/PUT/DELETE): no-store
- All errors: no-store (automatic)

Expected impact: 2-3x reduction in database queries for
repeated requests within cache window.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:06:43 +01:00
g-butandClaude Opus 4.5 d10360c231 refactor: code quality improvements (DRY, SSOT, inline styles)
- Remove duplicate MAX_FILE_SIZE constant, use VALIDATION.MAX_FILE_SIZE (SSOT)
- Refactor CustomBotPage sendMessage logic to eliminate code duplication (DRY)
- Convert inline animation-delay styles to Tailwind arbitrary values
- Add development-only check to ErrorBoundary console.error
- Remove deprecated MAX_FILE_SIZE export from types/document.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 01:06:06 +01:00
g-butandClaude Opus 4.5 1c7abeebac docs(claude): add global standards reference and update date
- Add @~/.claude/CLAUDE.md import for global engineering standards
- Update Last Updated date to 2026-01-23

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:22:36 +01:00
g-butandClaude Opus 4.5 beae8512a7 feat: add user-centric architecture with profiles and domain tagging
Implements user-centric data model where users are the constant and
professionals are lenses into their data. Follows DRY, SSOT, and SoC principles.

Database changes (migration 009):
- Add user_profiles table with RLS policies
- Add domains column to documents table (TEXT[])
- Add professional_slug column to conversations table
- Add triggers for auto-updating user stats
- Add ensure_user_profile() helper function

New files:
- lib/domains.ts: SSOT for all domain definitions
- lib/validations/domain.ts: Zod schemas for domain validation
- lib/validations/user-profile.ts: User profile validation schemas
- app/api/user/profile/route.ts: GET/PATCH user profile API
- app/api/documents/[id]/route.ts: GET/PATCH document API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 15:10:53 +01:00
g-butandClaude Opus 4.5 a93e462e4f feat: improve UX with skip option, PDF support, and better CTAs
- Add "Skip and chat directly" button in DemoIntake to reduce friction
- Create /api/demo/parse-pdf endpoint for unauthenticated PDF parsing
- Add PDF upload support to /try page
- Change homepage CTA from "Meet Your Professionals" to "Try Now - Free"
- Add typing indicator with animated bouncing dots in DemoChat
- Fix pdf-parse v2 import (use named export and class API)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 23:41:39 +01:00
g-butandClaude Sonnet 4.5 9aa417e273 refactor: clean up API routes and components, add shared utilities
Refactored multiple API routes and components to improve code organization and reduce duplication:
- Simplified API route implementations across chat, documents, consultations, and other endpoints
- Reorganized navigation components for better maintainability
- Added shared utility functions and hooks
- Created reusable Avatar and Logo components
- Added validation schemas and API utilities
- Improved type definitions and constants management

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-16 11:04:19 +01:00
g-but e648f4cca7 feat: add extended timeouts for embedding routes and improve error handling
- Add maxDuration config for chat, search, and process routes
- Add timeout wrapper for embedding generation with clear error message
- Add detailed logging throughout chat API for debugging
2026-01-15 04:20:51 +01:00
g-butandClaude Opus 4.5 403c9bf5a7 Add Phase 3: Document upload and RAG chat
- Add Transformers.js for local embeddings generation
- Create document upload API with Supabase Storage
- Create document processing pipeline (parse, chunk, embed)
- Create semantic search API using pgvector
- Create RAG chat API combining search + LLM
- Add documents page UI with upload, process, and chat
- Add database migration for document status columns
- Configure Next.js to externalize ONNX packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:39:43 +01:00