From 7f9cf79a21a977f3b1d83dc2a2c092a5b1caac34 Mon Sep 17 00:00:00 2001 From: Nixon Date: Sat, 20 Sep 2025 11:56:15 +0200 Subject: [PATCH] Merged the projects --- AISApp/Dockerfile | 46 +++++++++++++++++++++++++++++++++++++ TODO.md | 10 ++++---- backend/docker-compose.yml | 2 +- docker-compose.yml | 6 ++--- frontend/FRONTEND_README.md | 2 +- 5 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 AISApp/Dockerfile diff --git a/AISApp/Dockerfile b/AISApp/Dockerfile new file mode 100644 index 0000000..b8776c0 --- /dev/null +++ b/AISApp/Dockerfile @@ -0,0 +1,46 @@ +# Multi-stage build for ASP.NET Core application +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /app + +# Copy project files +COPY AISApp.csproj . +COPY . . + +# Restore dependencies +RUN dotnet restore AISApp.csproj + +# Build the application +RUN dotnet build AISApp.csproj -c Release -o /app/build + +# Publish the application +RUN dotnet publish AISApp.csproj -c Release -o /app/publish + +# Runtime stage +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime +WORKDIR /app + +# Install curl for health checks +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* + +# Copy published application +COPY --from=build /app/publish . + +# Copy prompt.txt file +COPY prompt.txt . + +# Create directory for static files +RUN mkdir -p static + +# Expose port +EXPOSE 80 + +# Set environment variables +ENV ASPNETCORE_URLS=http://+:80 +ENV ASPNETCORE_ENVIRONMENT=Production + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ + CMD curl -f http://localhost/api/chat || exit 1 + +# Run the application +ENTRYPOINT ["dotnet", "AISApp.dll"] diff --git a/TODO.md b/TODO.md index e120213..6d97058 100644 --- a/TODO.md +++ b/TODO.md @@ -20,7 +20,7 @@ Integrate the ASP.NET chatbot service into the existing Node.js backend system t ### 1.3 Create Chatbot Service Dockerfile - **Status**: ✅ Completed - **Description**: Create proper Dockerfile for the ASP.NET chatbot service -- **Files**: `tuna/tuna/Dockerfile` +- **Files**: `AISApp/Dockerfile` - **Details**: Multi-stage build with proper .NET 9.0 runtime and configuration ## Phase 2: Backend Service Integration @@ -54,25 +54,25 @@ Integrate the ASP.NET chatbot service into the existing Node.js backend system t ### 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` +- **Files**: `AISApp/AISApp/AIS.cs`, `AISApp/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` +- **Files**: `AISApp/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` +- **Files**: `AISApp/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` +- **Files**: `AISApp/AISApp/prompt.txt`, `AISApp/AISApp/AIS.cs` - **Details**: Dynamic prompt generation based on job details and interview stage ## Phase 4: Database Integration diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index dbf7ad9..6eb1d56 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -22,7 +22,7 @@ services: chatbot: build: - context: ../../tuna/tuna + context: ../../AISApp dockerfile: Dockerfile image: candidat/chatbot:latest container_name: backend-chatbot diff --git a/docker-compose.yml b/docker-compose.yml index e273d6d..764d7aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -82,7 +82,7 @@ services: # Frontend Service frontend: build: - context: ./frontend/candidat-frontend + context: ./frontend dockerfile: Dockerfile image: candidat/frontend:${APP_VERSION:-latest} container_name: candidat-frontend @@ -93,7 +93,7 @@ services: - "${FRONTEND_PORT:-3000}:3000" volumes: # Development hot reloading (only if NODE_ENV=development) - - ./frontend/candidat-frontend/src:/app/src:ro + - ./frontend/src:/app/src:ro depends_on: backend: condition: service_healthy @@ -116,7 +116,7 @@ services: # Chatbot Service chatbot: build: - context: ./tuna/tuna + context: ./AISApp dockerfile: Dockerfile image: candidat/chatbot:${APP_VERSION:-latest} container_name: candidat-chatbot diff --git a/frontend/FRONTEND_README.md b/frontend/FRONTEND_README.md index 552d542..4305af5 100644 --- a/frontend/FRONTEND_README.md +++ b/frontend/FRONTEND_README.md @@ -29,7 +29,7 @@ A stunning, responsive frontend built with Next.js 15, TypeScript, and Tailwind ## 🏗️ **Project Structure** ``` -frontend/candidat-frontend/ +frontend/ ├── src/ │ ├── app/ │ │ ├── page.tsx # Main landing page