✅ Fix chat interface - restore continuous conversation flow
🎯 Major improvements to MissionControl component: - Always keep input field visible and functional after AI responses - Auto-clear input after submitting questions for better UX - Add dynamic visual indicators (first question vs follow-up) - Improve response layout with clear separation and hints - Enable proper chat-like experience for continuous learning 🌟 Additional enhancements: - Better language-specific messaging throughout interface - Clearer visual hierarchy between input and response areas - Intuitive flow that guides users to ask follow-up questions - Maintains responsive design and accessibility 🔧 Technical changes: - Enhanced MissionControl state management - Improved component layout and styling - Better TypeScript integration across components - Updated tsconfig for stricter type checking
This commit is contained in:
109
docker-dev.sh
109
docker-dev.sh
@@ -1,12 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# KidsAI Explorer - Docker Development Setup Script
|
||||
# This script sets up the development environment with optional Docker Bake support
|
||||
# This script sets up the development environment with Docker Bake + Compose v2 support
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 KidsAI Explorer - Docker Setup"
|
||||
echo "=================================="
|
||||
echo "🚀 KidsAI Explorer - Docker Bake + Compose v2 Setup"
|
||||
echo "==================================================="
|
||||
|
||||
# Check if Docker is running
|
||||
if ! docker info > /dev/null 2>&1; then
|
||||
@@ -14,12 +14,27 @@ if ! docker info > /dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if docker-compose is available
|
||||
if ! command -v docker-compose &> /dev/null; then
|
||||
echo "❌ docker-compose is not installed. Please install Docker Compose v2."
|
||||
# Check for Docker Compose v2
|
||||
if docker compose version > /dev/null 2>&1; then
|
||||
COMPOSE_CMD="docker compose"
|
||||
echo "✅ Docker Compose v2 detected"
|
||||
elif command -v docker-compose &> /dev/null; then
|
||||
COMPOSE_CMD="docker-compose"
|
||||
echo "⚠️ Using Docker Compose v1 (consider upgrading to v2)"
|
||||
else
|
||||
echo "❌ Docker Compose is not installed. Please install Docker Compose v2."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if Docker Buildx is available for Bake support
|
||||
if docker buildx version > /dev/null 2>&1; then
|
||||
BUILDX_AVAILABLE=true
|
||||
echo "✅ Docker Buildx available - Bake support enabled"
|
||||
else
|
||||
BUILDX_AVAILABLE=false
|
||||
echo "⚠️ Docker Buildx not available - falling back to standard builds"
|
||||
fi
|
||||
|
||||
# Create .env file if it doesn't exist
|
||||
if [ ! -f .env ]; then
|
||||
echo "📝 Creating .env file from template..."
|
||||
@@ -27,14 +42,26 @@ if [ ! -f .env ]; then
|
||||
echo "⚠️ Please edit .env file and add your API keys before running the application."
|
||||
fi
|
||||
|
||||
# Check if Docker Buildx is available for Bake support
|
||||
if docker buildx version &> /dev/null 2>&1; then
|
||||
export COMPOSE_BAKE=true
|
||||
echo "✅ Docker Bake support enabled (Docker Buildx available)"
|
||||
# Check if COMPOSE_BAKE is enabled
|
||||
if [ -f .env ] && grep -q "COMPOSE_BAKE=true" .env && [ "$BUILDX_AVAILABLE" = true ]; then
|
||||
BAKE_ENABLED=true
|
||||
echo "🔥 Docker Bake integration ENABLED"
|
||||
else
|
||||
echo "⚠️ Docker Buildx not available - using standard builds"
|
||||
echo " For better build performance, consider upgrading to Docker Desktop or installing buildx"
|
||||
BAKE_ENABLED=false
|
||||
echo "📦 Using standard Docker builds"
|
||||
fi
|
||||
# Function to build with Bake if available, otherwise use Compose
|
||||
build_images() {
|
||||
local target=${1:-development}
|
||||
|
||||
if [ "$BAKE_ENABLED" = true ]; then
|
||||
echo "🔥 Building with Docker Bake (target: $target)..."
|
||||
docker buildx bake --load $target
|
||||
else
|
||||
echo "📦 Building with Docker Compose..."
|
||||
$COMPOSE_CMD build app
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to show available commands
|
||||
show_help() {
|
||||
@@ -42,9 +69,10 @@ show_help() {
|
||||
echo "Available commands:"
|
||||
echo " dev - Start development environment"
|
||||
echo " prod - Start production environment"
|
||||
echo " build - Build images (with Bake if available)"
|
||||
echo " build - Build images with Bake (or fallback to Compose)"
|
||||
echo " build-dev - Build development image"
|
||||
echo " build-prod - Build production image"
|
||||
echo " bake-all - Build all targets with Bake"
|
||||
echo " stop - Stop all services"
|
||||
echo " clean - Clean up containers and images"
|
||||
echo " logs - Show application logs"
|
||||
@@ -56,57 +84,60 @@ show_help() {
|
||||
case "${1:-help}" in
|
||||
"dev")
|
||||
echo "🔧 Starting development environment..."
|
||||
docker-compose up --build
|
||||
build_images development
|
||||
$COMPOSE_CMD up app
|
||||
;;
|
||||
"prod")
|
||||
echo "🚀 Starting production environment..."
|
||||
docker-compose --profile production up --build app-prod
|
||||
build_images production
|
||||
$COMPOSE_CMD --profile production up app-prod
|
||||
;;
|
||||
"build")
|
||||
if docker buildx version &> /dev/null 2>&1; then
|
||||
echo "🏗️ Building all images with Docker Bake..."
|
||||
docker buildx bake --load
|
||||
else
|
||||
echo "🏗️ Building images with standard Docker build..."
|
||||
docker-compose build
|
||||
fi
|
||||
echo "🏗️ Building default images..."
|
||||
build_images development
|
||||
;;
|
||||
"build-dev")
|
||||
if docker buildx version &> /dev/null 2>&1; then
|
||||
echo "🏗️ Building development image with Docker Bake..."
|
||||
docker buildx bake development --load
|
||||
else
|
||||
echo "🏗️ Building development image..."
|
||||
docker-compose build app
|
||||
fi
|
||||
echo "🏗️ Building development image..."
|
||||
build_images development
|
||||
;;
|
||||
"build-prod")
|
||||
if docker buildx version &> /dev/null 2>&1; then
|
||||
echo "🏗️ Building production image with Docker Bake..."
|
||||
docker buildx bake production --load
|
||||
echo "🏗️ Building production image..."
|
||||
build_images production
|
||||
;;
|
||||
"bake-all")
|
||||
if [ "$BAKE_ENABLED" = true ]; then
|
||||
echo "🔥 Building all targets with Docker Bake..."
|
||||
docker buildx bake all --load
|
||||
else
|
||||
echo "🏗️ Building production image..."
|
||||
docker-compose build app-prod
|
||||
echo "❌ Docker Bake is not available. Use 'build' instead."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"stop")
|
||||
echo "🛑 Stopping all services..."
|
||||
docker-compose down
|
||||
$COMPOSE_CMD down
|
||||
;;
|
||||
"clean")
|
||||
echo "🧹 Cleaning up containers and images..."
|
||||
docker-compose down --rmi all --volumes --remove-orphans
|
||||
$COMPOSE_CMD down --rmi all --volumes --remove-orphans
|
||||
docker system prune -f
|
||||
;;
|
||||
"logs")
|
||||
echo "📋 Showing application logs..."
|
||||
docker-compose logs -f app
|
||||
$COMPOSE_CMD logs -f app
|
||||
;;
|
||||
"shell")
|
||||
echo "🐚 Opening shell in running container..."
|
||||
docker-compose exec app sh
|
||||
echo "🐚 Opening shell in running development container..."
|
||||
$COMPOSE_CMD exec app sh
|
||||
;;
|
||||
"help"|*)
|
||||
show_help
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
echo "✅ Done! Your KidsAI Explorer is ready."
|
||||
if [ "$BAKE_ENABLED" = true ]; then
|
||||
echo "🔥 Docker Bake integration is ACTIVE for faster builds!"
|
||||
fi
|
||||
echo "🌐 Access your app at: http://localhost:3444"
|
||||
|
||||
Reference in New Issue
Block a user