- Add 3 user roles: user, admin, super_admin
- Restrict LLM config management to super_admin only
- Restrict audit logs and statistics to super_admin only
- Update AdminPage with role-based tab visibility
- Add complete 5 Why prompt from 5why-analyzer.jsx
- Add system documentation and authorization guide
- Add ErrorModal component and seed test users script
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major Features:
- ✨ Multi-LLM provider support (DeepSeek, Ollama, OpenAI, Custom)
- 🤖 Admin panel LLM configuration management UI
- 🔄 Dynamic provider switching without restart
- 🧪 Built-in API connection testing
- 🔒 Secure API key management
Backend Changes:
- Add routes/llmConfig.js: Complete LLM config CRUD API
- Update routes/analyze.js: Use database LLM configuration
- Update server.js: Add LLM config routes
- Add scripts/add-deepseek-config.js: DeepSeek setup script
Frontend Changes:
- Update src/pages/AdminPage.jsx: Add LLM Config tab + modal
- Update src/services/api.js: Add LLM config API methods
- Provider presets for DeepSeek, Ollama, OpenAI
- Test connection feature in config modal
Configuration:
- Update .env.example: Add DeepSeek API configuration
- Update package.json: Add llm:add-deepseek script
Documentation:
- Add docs/LLM_CONFIGURATION_GUIDE.md: Complete guide
- Add DEEPSEEK_INTEGRATION.md: Integration summary
- Quick setup instructions for DeepSeek
API Endpoints:
- GET /api/llm-config: List all configurations
- GET /api/llm-config/active: Get active configuration
- POST /api/llm-config: Create configuration
- PUT /api/llm-config/🆔 Update configuration
- PUT /api/llm-config/:id/activate: Activate configuration
- DELETE /api/llm-config/🆔 Delete configuration
- POST /api/llm-config/test: Test API connection
Database:
- Uses existing llm_configs table
- Only one config active at a time
- Fallback to Ollama if no database config
Security:
- Admin-only access to LLM configuration
- API keys never returned in GET requests
- Audit logging for all config changes
- Cannot delete active configuration
DeepSeek Model:
- Model: deepseek-chat
- High-quality 5 Why analysis
- Excellent Chinese language support
- Cost-effective pricing
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Added Windows-optimized launcher:
- start-dev.bat: Simple batch file using npm run dev
- Automatically kills processes on ports 3001 and 5173
- Uses concurrently to run both services
- Single window, simpler than Python launcher
- Recommended for Windows users
Improved app.py:
- Better error output capture and display
- Increased wait time to 3 seconds
- Shows last 500 characters of error output
Windows users now have 3 options:
1. start-dev.bat (simplest - recommended)
2. python app.py (advanced with port management)
3. npm run dev (manual)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Enhanced app.py with port management:
- Added check_port_available() to detect if ports are in use
- Added kill_process_on_port() to automatically free ports
- Checks ports 3001 (backend) and 5173 (frontend) before starting
- Automatically kills existing processes on those ports
- Cross-platform support (Windows netstat/taskkill, Linux lsof/kill)
This fixes the 'EADDRINUSE' error when ports are already occupied.
Benefits:
✅ No manual port cleanup needed
✅ Graceful handling of port conflicts
✅ User-friendly warning messages
✅ Automatic retry after port cleanup
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed npm detection on Windows by using npm.cmd instead of npm.
This resolves the 'npm is not installed or not in PATH' error on Windows systems.
Changes:
- Updated check_npm_installed() to use npm.cmd on Windows
- Uses self.is_windows flag to determine correct command
- Maintains cross-platform compatibility
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Added USAGE_GUIDE.md with:
- Three ways to run the application
- Step-by-step setup instructions
- Detailed feature documentation
- User roles and permissions guide
- Comprehensive troubleshooting section
- Security best practices
- System monitoring commands
- Performance optimization tips
Covers:
✅ 5 Why Analysis Tool usage
✅ Analysis History management
✅ Admin Dashboard features
✅ User, Admin, and Super Admin roles
✅ Common issues and solutions
✅ Database troubleshooting
✅ Network and connectivity issues
✅ Production deployment tips
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive application launcher:
- app.py - Python script to start both backend and frontend
- start.bat - Windows batch file wrapper
- START_HERE.md - Quick start guide with troubleshooting
- Updated package.json with 'npm start' command
Features:
✅ Pre-flight checks (Node.js, npm, dependencies, .env)
✅ Starts both backend (port 3001) and frontend (port 5173)
✅ Colored terminal output with status messages
✅ Process monitoring and health checks
✅ Graceful shutdown with Ctrl+C
✅ Cross-platform support (Windows/Linux/Mac)
✅ Automatic cleanup of child processes
Usage:
python app.py
OR
npm start
OR (Windows only)
start.bat
Benefits:
- Single command to start entire application
- No need for multiple terminal windows
- Automatic error detection and reporting
- User-friendly colored output
- Test account information displayed on startup
- Easy for non-technical users
Documentation:
- START_HERE.md provides complete quick start guide
- Includes troubleshooting section
- Lists all access points and test accounts
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Created preview.html with 4 main sections:
1. 5 Why Analysis Tool Interface
- Input forms for Finding and Job Content
- Multi-language selection (7 languages)
- Sample 3-perspective analysis results
- Interactive guidelines section
2. Analysis History Page
- Sortable data table with filters
- CSV import/export buttons
- Pagination controls
- Search and date filtering
3. Admin Dashboard
- Statistics overview (4 key metrics)
- User management table with CRUD operations
- LLM API configuration interface
- System settings panel
- Audit logs viewer
4. Login Page
- Modern gradient design
- Remember me function
- Forgot password link
Features:
- Fully responsive design
- Tailwind CSS styling
- Tab-based navigation
- Interactive elements
- Color-coded status indicators
- Professional UI/UX
Ready for user approval before Phase 4 development.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>