|
# System Integration TODO - Merging ASP.NET Chatbot with Existing Backend
|
|
|
|
## Overview
|
|
Integrate the ASP.NET chatbot service into the existing Node.js backend system to provide specialized interview capabilities while maintaining the current architecture.
|
|
|
|
## Phase 1: Container Integration
|
|
|
|
### 1.1 Add Chatbot Service to Docker Compose
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Add the ASP.NET chatbot service to the main docker-compose.yml file
|
|
- **Files**: `docker-compose.yml`
|
|
- **Details**: Configure service with proper networking, environment variables, and dependencies
|
|
|
|
### 1.2 Update Backend Docker Compose
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Update backend docker-compose.yml to include chatbot service dependency
|
|
- **Files**: `backend/docker-compose.yml`
|
|
- **Details**: Add chatbot service and ensure proper service communication
|
|
|
|
### 1.3 Create Chatbot Service Dockerfile
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Create proper Dockerfile for the ASP.NET chatbot service
|
|
- **Files**: `tuna/tuna/Dockerfile`
|
|
- **Details**: Multi-stage build with proper .NET 9.0 runtime and configuration
|
|
|
|
## Phase 2: Backend Service Integration
|
|
|
|
### 2.1 Create ChatbotService
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Create new service to handle communication with ASP.NET chatbot
|
|
- **Files**: `backend/src/services/ChatbotService.ts`
|
|
- **Details**: HTTP client wrapper for chatbot service with error handling and fallback
|
|
|
|
### 2.2 Update AIService to Use Chatbot
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Modify AIService to proxy requests to chatbot service instead of direct OpenRouter
|
|
- **Files**: `backend/src/services/AIService.ts`
|
|
- **Details**: Add chatbot service integration while maintaining fallback to direct OpenRouter
|
|
|
|
### 2.3 Update AIController
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Modify AIController to use new chatbot service integration
|
|
- **Files**: `backend/src/controllers/rest/AIController.ts`
|
|
- **Details**: Update chat endpoints to use chatbot service, maintain existing interview flow
|
|
|
|
### 2.4 Add Environment Variables
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Add new environment variables for chatbot service configuration
|
|
- **Files**: `env.example`, `env.production`, `env.cloudflare`
|
|
- **Details**: Add chatbot service URL, timeout, and fallback configuration
|
|
|
|
## Phase 3: ASP.NET Service Modifications
|
|
|
|
### 3.1 Add MySQL Database Support
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Replace SQLite with MySQL database connection in ASP.NET service
|
|
- **Files**: `tuna/tuna/AISApp/AIS.cs`, `tuna/tuna/AISApp/Program.cs`
|
|
- **Details**: Add MySQL connection string and update database operations
|
|
|
|
### 3.2 Add Interview Context Endpoints
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Create endpoints for interview initialization and context management
|
|
- **Files**: `tuna/tuna/AISApp/Program.cs`
|
|
- **Details**: Add endpoints for interview start, status, and completion
|
|
|
|
### 3.3 Implement Conversation Sync
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Sync conversation data between ASP.NET service and MySQL database
|
|
- **Files**: `tuna/tuna/AISApp/AIS.cs`
|
|
- **Details**: Update conversation persistence to use MySQL instead of SQLite
|
|
|
|
### 3.4 Add Interview-Specific Prompts
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Modify system prompts based on job requirements and interview context
|
|
- **Files**: `tuna/tuna/AISApp/prompt.txt`, `tuna/tuna/AISApp/AIS.cs`
|
|
- **Details**: Dynamic prompt generation based on job details and interview stage
|
|
|
|
## Phase 4: Database Integration
|
|
|
|
### 4.1 Update Database Schema
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Add any required database changes for chatbot integration
|
|
- **Files**: `database/` (if needed)
|
|
- **Details**: Ensure conversation tables support chatbot service requirements
|
|
|
|
### 4.2 Add Database Migration Scripts
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Create migration scripts for any database schema changes
|
|
- **Files**: `backend/` (new migration files)
|
|
- **Details**: SQL scripts for any required table modifications
|
|
|
|
## Phase 5: Configuration and Environment
|
|
|
|
### 5.1 Update Nginx Configuration
|
|
- **Status**: ✅ Completed (Not Required)
|
|
- **Description**: Add nginx routing for chatbot service if needed
|
|
- **Files**: `nginx/nginx.conf`
|
|
- **Details**: Add proxy rules for chatbot service endpoints
|
|
|
|
### 5.2 Update Environment Files
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Update all environment files with chatbot service configuration
|
|
- **Files**: `env.example`, `env.production`, `env.cloudflare`
|
|
- **Details**: Add chatbot service environment variables
|
|
|
|
### 5.3 Update Docker Compose Environment
|
|
- **Status**: ✅ Completed
|
|
- **Description**: Add chatbot service environment variables to docker-compose
|
|
- **Files**: `docker-compose.yml`
|
|
- **Details**: Add environment variable mapping for chatbot service
|
|
|
|
## Phase 6: Testing and Validation
|
|
|
|
### 6.1 Service Communication Test
|
|
- **Status**: Pending
|
|
- **Description**: Test communication between backend and chatbot service
|
|
- **Details**: Verify HTTP requests work correctly between services
|
|
|
|
### 6.2 Database Integration Test
|
|
- **Status**: Pending
|
|
- **Description**: Test database operations in chatbot service
|
|
- **Details**: Verify conversation sync and data persistence
|
|
|
|
### 6.3 End-to-End Interview Flow Test
|
|
- **Status**: Pending
|
|
- **Description**: Test complete interview flow with chatbot integration
|
|
- **Details**: Verify mandatory questions → chat → completion flow works
|
|
|
|
## Phase 7: Documentation and Cleanup
|
|
|
|
### 7.1 Update API Documentation
|
|
- **Status**: Pending
|
|
- **Description**: Update API documentation to reflect chatbot integration
|
|
- **Files**: `backend/ADMIN_API.md`, `backend/AI_CONFIGURATION.md`
|
|
- **Details**: Document new chatbot service endpoints and configuration
|
|
|
|
### 7.2 Update Deployment Scripts
|
|
- **Status**: Pending
|
|
- **Description**: Update deployment scripts to include chatbot service
|
|
- **Files**: `deploy-production.ps1`, `deploy-production.sh`
|
|
- **Details**: Add chatbot service to deployment process
|
|
|
|
### 7.3 Clean Up Temporary Files
|
|
- **Status**: Pending
|
|
- **Description**: Remove any temporary files created during integration
|
|
- **Details**: Clean up test files and temporary configurations
|
|
|
|
## Notes
|
|
- All changes maintain backward compatibility
|
|
- Fallback to direct OpenRouter if chatbot service fails
|
|
- No frontend changes required initially
|
|
- Maintain existing interview flow and database structure
|
|
- Chatbot service runs on port 5000 internally, exposed via nginx if needed
|