Problem:
- Floating chat had its own separate authentication check using localStorage
- iOS Safari has restrictions on localStorage access, especially with tracking prevention
- This caused logged-in users to still see login prompt in AI chat
Solution:
- Replace local auth state management with global useAuth hook from AuthProvider
- Remove redundant checkAuthStatus() function
- Update all authentication checks to use isAuthenticated from useAuth
- Update token retrieval to get directly from localStorage only when needed
Benefits:
- Single source of truth for authentication across the app
- More reliable authentication state management
- Better compatibility with iOS Safari's privacy features
- Automatic auth state synchronization when user logs in/out
Changes:
- Use useAuth hook instead of local isAuthenticated/authToken state
- Remove checkAuthStatus() function
- Update loadConversations to read token from localStorage directly
- Update loadConversation to read token from localStorage directly
- Update handleSendMessage to read token from localStorage directly
- Simplify handleAuthSuccess to rely on global auth state updates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major updates:
- Replace homepage with clean, minimalist Apple-style landing page
- Focus on donation messaging and mission statement
- Add comprehensive AI chat analysis documentation
- Fix Azure OpenAI configuration with correct endpoints
- Update embedding API to use text-embedding-ada-002 (1536 dims)
Landing Page Features:
- Hero section with tagline "Every Scripture. Every Language. Forever Free"
- Mission statement emphasizing free access
- Matthew 10:8 verse highlight
- 6 feature cards (Global Library, Multilingual, Prayer Wall, AI Chat, Privacy, Offline)
- Donation CTA sections with PayPal and card options
- "Why It Matters" section with dark background
- Clean footer with navigation links
Technical Changes:
- Updated .env.local with new Azure credentials
- Fixed vector-search.ts to support separate embed API version
- Integrated AuthModal into Bible reader and prayers page
- Made prayer filters collapsible and mobile-responsive
- Changed language picker to single-select
Documentation Created:
- AI_CHAT_FIX_PLAN.md - Comprehensive implementation plan
- AI_CHAT_VERIFICATION_FINDINGS.md - Database analysis
- AI_CHAT_ANALYSIS_SUMMARY.md - Executive summary
- AI_CHAT_STATUS_UPDATE.md - Current status and next steps
- logo.svg - App logo (MenuBook icon)
Build: ✅ Successful (Next.js 15.5.3)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Update chat API to require valid authentication tokens for all requests
- Add authentication requirement screens to both chat components
- Show "Create Account / Sign In" prompts for unauthenticated users
- Hide chat input and functionality until user is logged in
- Return 401 errors with clear messages when authentication is missing
- Maintain bilingual support (Romanian/English) for auth prompts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major homepage and SEO enhancements based on optimization document:
**Homepage Content Updates:**
- Updated H1 titles with SEO-optimized text for both RO/EN
- Enhanced hero descriptions with targeted keywords
- Improved feature descriptions for better clarity
- Updated daily verse section with keyword-rich titles
- Added new footer description with SEO focus
**SEO Implementation:**
- Added dynamic metadata generation with locale-specific SEO
- Implemented Open Graph tags for social media sharing
- Added Twitter Card metadata for enhanced sharing
- Integrated Schema.org JSON-LD structured data
- Set up hreflang tags for international SEO
- Added canonical URLs to prevent duplicate content
- Included targeted keywords for both languages
**Technical Improvements:**
- Migrated from Docker to PM2 deployment
- Removed Docker files and updated deployment scripts
- Updated README with PM2 instructions
- Fixed console log cleanup for production
- Added proper favicon with Next.js app directory
- Increased memory limit to 4GB for better performance
- Updated port configuration to 0.0.0.0:3010
- Set Romanian (/ro) as default locale with proper redirects
**Translation Updates:**
- Enhanced Romanian translations with SEO-optimized content
- Updated English translations with matching SEO improvements
- Added new 'seo' namespace for metadata translations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change chat layout from vertical stacking to horizontal side-by-side layout
- History panel (300px width) displays on left with conversation list
- Main chat area takes remaining space on right with messages and input
- Improves UX by making chat history visible alongside active conversation
- Fix JSX structure and nesting for proper component rendering
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix critical async/await bug in chat API token verification
- Add comprehensive authentication debugging logs
- Fix conversations API Zod schema validation for query parameters
- Remove problematic CircularProgress import causing build warnings
- Improve error handling and user feedback in chat component
The main issue was that verifyToken() was called without await, causing
the chat API to receive a Promise object instead of the user payload,
resulting in undefined userId and failed conversation persistence.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix CircularProgress import from correct MUI package
- Fix conversationId validation by omitting null values instead of sending them
- Fix conversations API Zod schema default values (string vs number mismatch)
- Remove debug logging from chat error handling
- AI chat conversations now work properly with authentication
- Chat history loading no longer fails with validation errors
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Phase 1 - Database Schema & Basic API:
- Add ChatConversation and ChatMessage tables with proper relationships
- Create conversation CRUD API endpoints with authentication
- Update chat API to support persistent conversations
- Implement auto-generated conversation titles and language separation
- Add conversation soft delete and user-specific access control
Phase 2 - Enhanced Memory System:
- Implement intelligent context selection beyond simple chronological order
- Add relevance scoring for older messages based on keyword overlap and biblical references
- Create automatic message summarization for very long conversations
- Optimize token usage with smart context management (1500 token budget)
- Add biblical awareness with Romanian/English book name detection
- Implement time-based relevance decay for better context prioritization
Frontend Improvements:
- Add chat history button to floating chat header
- Create basic history panel UI with placeholder content
- Maintain backward compatibility for anonymous users
Database Changes:
- Enhanced schema with conversation relationships and message roles
- Proper indexing for performance and user-specific queries
- Migration completed successfully with prisma db push
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace dynamic live counter with static "thousands of believers" text in both languages
- Fix Discuss this verse feature with proper timing and quote escaping
- Add setTimeout delay to ensure chat input is set after component renders
- Remove unescaped quotes from English daily verse text
- Merge duplicate hero translation objects in both language files
- Clean up debug console.log statements
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add dynamic date and year generation replacing static 2024 values
- Implement "Discuss this verse" feature with AI chat integration
- Fix translation key conflicts by merging duplicate hero objects
- Update Romanian translations with improved messaging
- Enhance floating chat to support initial messages via events
- Fix FORMATTING_ERROR for liveCounter with proper next-intl syntax
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added data-floating-chat attribute to chat component for easy detection
- Updated bible reader keyboard event handler to check if chat is open
- Prevent shortcuts from triggering when user is typing in input fields
- Check for dialogs, modals, and the floating chat before processing shortcuts
- Apply new teal-based color palette (#009688, #00796B, #B2DFDB)
- Update secondary color to accent yellow (#FFC107)
- Replace Material-UI loading states with proper animations and skeletons
- Remove ugly gradient background, replace with clean white
- Update all gradients to use new color scheme
- Improve text colors for better readability (#212121, #757575)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added next-intl for internationalization with Romanian as default locale
- Restructured app directory with [locale] routing (/ro, /en)
- Created comprehensive translation files for both languages
- Fixed Next.js 15 async params compatibility in layout components
- Updated all components to use proper i18n hooks and translations
- Configured middleware for locale routing and fallbacks
- Fixed FloatingChat component translation array handling
- Restored complete home page with internationalized content
- Fixed Material-UI Slide component prop error (mountOnExit → unmountOnExit)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add pgvector support with bible_passages table for vector search
- Create Python ingestion script for Azure OpenAI embed-3 embeddings
- Implement hybrid search combining vector similarity and full-text search
- Update AI chat to use vector search with Azure OpenAI gpt-4o
- Add floating chat component with Material UI design
- Import complete Romanian Bible (FIDELA) with 30K+ verses
- Add vector search library for semantic Bible search
- Create multi-language implementation plan for future expansion
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>