Switch to angular #1

Closed
pratik wants to merge 18 commits from f/updates into main
3 changed files with 57 additions and 169 deletions
Showing only changes of commit c5b85126c0 - Show all commits

View File

@@ -57,8 +57,20 @@ services:
timeout: 10s timeout: 10s
retries: 3 retries: 3
# Frontend service removed from default compose - use dev-start.sh for development frontend:
# For production with built frontend, use: docker-compose -f docker-compose.production.yml up build:
context: .
dockerfile: Dockerfile.frontend
ports:
- "4200:80"
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
volumes: volumes:
postgres_data: postgres_data:

View File

@@ -1,8 +1,6 @@
[CmdletBinding()] [CmdletBinding()]
param( param(
[switch]$Rebuild, [switch]$Rebuild,
[switch]$FullStack,
[switch]$Dev,
[switch]$Help [switch]$Help
) )
@@ -10,24 +8,22 @@ $ErrorActionPreference = "Stop"
if ($Help) { if ($Help) {
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Test Artifact Data Lake - Quick Start" -ForegroundColor Cyan Write-Host "Obsidian - Quick Start" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "" Write-Host ""
Write-Host "Usage: .\quickstart.ps1 [OPTIONS]" -ForegroundColor White Write-Host "Usage: .\quickstart.ps1 [OPTIONS]" -ForegroundColor White
Write-Host "" Write-Host ""
Write-Host "Options:" -ForegroundColor Yellow Write-Host "Options:" -ForegroundColor Yellow
Write-Host " -Rebuild Force rebuild of all containers" -ForegroundColor White Write-Host " -Rebuild Force rebuild of all containers" -ForegroundColor White
Write-Host " -FullStack Start complete stack including frontend (production build)" -ForegroundColor White
Write-Host " -Dev Start backend only, use separate dev server for frontend" -ForegroundColor White
Write-Host " -Help Show this help message" -ForegroundColor White Write-Host " -Help Show this help message" -ForegroundColor White
Write-Host "" Write-Host ""
Write-Host "Default: Starts backend services only (recommended for development)" -ForegroundColor Green Write-Host "Brings up the complete stack: database, backend API, and frontend" -ForegroundColor Green
Write-Host "" Write-Host ""
exit 0 exit 0
} }
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Test Artifact Data Lake - Quick Start" -ForegroundColor Cyan Write-Host "Obsidian - Quick Start" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "" Write-Host ""
@@ -72,104 +68,46 @@ if ($Rebuild) {
Write-Host "Rebuilding containers..." -ForegroundColor Yellow Write-Host "Rebuilding containers..." -ForegroundColor Yellow
Write-Host "Stopping existing containers..." -ForegroundColor White Write-Host "Stopping existing containers..." -ForegroundColor White
if ($FullStack) { if ($ComposeCmd -eq "docker compose") {
if ($ComposeCmd -eq "docker compose") { & docker compose down
& docker compose -f "docker-compose.production.yml" down Write-Host "Removing existing images for rebuild..." -ForegroundColor White
Write-Host "Removing existing images for full rebuild..." -ForegroundColor White & docker compose down --rmi local 2>$null
& docker compose -f "docker-compose.production.yml" down --rmi local 2>$null Write-Host "Building and starting all services..." -ForegroundColor White
Write-Host "Building and starting full stack..." -ForegroundColor White & docker compose up -d --build
& docker compose -f "docker-compose.production.yml" up -d --build
} else {
& docker-compose -f "docker-compose.production.yml" down
Write-Host "Removing existing images for full rebuild..." -ForegroundColor White
& docker-compose -f "docker-compose.production.yml" down --rmi local 2>$null
Write-Host "Building and starting full stack..." -ForegroundColor White
& docker-compose -f "docker-compose.production.yml" up -d --build
}
} else { } else {
if ($ComposeCmd -eq "docker compose") { & docker-compose down
& docker compose down Write-Host "Removing existing images for rebuild..." -ForegroundColor White
Write-Host "Removing existing backend images for rebuild..." -ForegroundColor White & docker-compose down --rmi local 2>$null
& docker compose down --rmi local 2>$null Write-Host "Building and starting all services..." -ForegroundColor White
Write-Host "Building and starting backend services..." -ForegroundColor White & docker-compose up -d --build
& docker compose up -d --build
} else {
& docker-compose down
Write-Host "Removing existing backend images for rebuild..." -ForegroundColor White
& docker-compose down --rmi local 2>$null
Write-Host "Building and starting backend services..." -ForegroundColor White
& docker-compose up -d --build
}
} }
} else { } else {
# Regular startup Write-Host "Starting all services..." -ForegroundColor Green
if ($FullStack) { if ($ComposeCmd -eq "docker compose") {
Write-Host "Starting full production stack (backend + frontend)..." -ForegroundColor Green & docker compose up -d
if ($ComposeCmd -eq "docker compose") {
& docker compose -f "docker-compose.production.yml" up -d
} else {
& docker-compose -f "docker-compose.production.yml" up -d
}
} else { } else {
Write-Host "Starting backend services..." -ForegroundColor Green & docker-compose up -d
if ($ComposeCmd -eq "docker compose") {
& docker compose up -d
} else {
& docker-compose up -d
}
} }
} }
Write-Host "" Write-Host ""
Write-Host "Waiting for services to be ready..." -ForegroundColor Yellow Write-Host "Waiting for services to be ready..." -ForegroundColor Yellow
Start-Sleep -Seconds 15 Start-Sleep -Seconds 20
Write-Host "" Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
if ($FullStack) { Write-Host "Complete Stack is running!" -ForegroundColor Green
Write-Host "Complete Stack is running!" -ForegroundColor Green
} else {
Write-Host "Backend Services are running!" -ForegroundColor Green
}
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "" Write-Host ""
Write-Host "Frontend: http://localhost:4200" -ForegroundColor White
Write-Host "API: http://localhost:8000" -ForegroundColor White Write-Host "API: http://localhost:8000" -ForegroundColor White
Write-Host "API Docs: http://localhost:8000/docs" -ForegroundColor White Write-Host "API Docs: http://localhost:8000/docs" -ForegroundColor White
Write-Host "MinIO Console: http://localhost:9001" -ForegroundColor White Write-Host "MinIO Console: http://localhost:9001" -ForegroundColor White
Write-Host " Username: minioadmin" -ForegroundColor Gray Write-Host " Username: minioadmin" -ForegroundColor Gray
Write-Host " Password: minioadmin" -ForegroundColor Gray Write-Host " Password: minioadmin" -ForegroundColor Gray
Write-Host "" Write-Host ""
Write-Host "To view logs: $ComposeCmd logs -f" -ForegroundColor Yellow
if ($FullStack) { Write-Host "To stop: $ComposeCmd down" -ForegroundColor Yellow
Write-Host "Frontend: http://localhost:80" -ForegroundColor White
Write-Host " (Production build with Nginx)" -ForegroundColor Gray
Write-Host ""
Write-Host "To view logs: $ComposeCmd -f docker-compose.production.yml logs -f" -ForegroundColor Yellow
Write-Host "To stop: $ComposeCmd -f docker-compose.production.yml down" -ForegroundColor Yellow
} else {
Write-Host "To view logs: $ComposeCmd logs -f" -ForegroundColor Yellow
Write-Host "To stop: $ComposeCmd down" -ForegroundColor Yellow
Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Frontend Options:" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Development (with hot reload):" -ForegroundColor White
Write-Host " .\dev-start.ps1" -ForegroundColor Green
Write-Host " Frontend will be available at: http://localhost:4200" -ForegroundColor Gray
Write-Host ""
Write-Host "Or start full production stack:" -ForegroundColor White
Write-Host " .\quickstart.ps1 -FullStack" -ForegroundColor Green
Write-Host " Complete stack at: http://localhost:80" -ForegroundColor Gray
}
Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Rebuild Options:" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Force rebuild backend: .\quickstart.ps1 -Rebuild" -ForegroundColor Yellow
Write-Host "Force rebuild full stack: .\quickstart.ps1 -Rebuild -FullStack" -ForegroundColor Yellow
Write-Host "" Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Testing the API..." -ForegroundColor Cyan Write-Host "Testing the API..." -ForegroundColor Cyan
@@ -185,11 +123,8 @@ try {
if ($response.status -eq "healthy") { if ($response.status -eq "healthy") {
Write-Host "[OK] API is healthy!" -ForegroundColor Green Write-Host "[OK] API is healthy!" -ForegroundColor Green
Write-Host "" Write-Host ""
if (-not $FullStack) { Write-Host "All services are ready!" -ForegroundColor Green
Write-Host "Ready for development!" -ForegroundColor Green Write-Host ""
Write-Host "Run '.\dev-start.ps1' to start the frontend with hot reload" -ForegroundColor Yellow
Write-Host ""
}
Write-Host "Example: Upload a test file" -ForegroundColor White Write-Host "Example: Upload a test file" -ForegroundColor White
Write-Host "----------------------------" -ForegroundColor Gray Write-Host "----------------------------" -ForegroundColor Gray
Write-Host 'echo "test,data" > test.csv' -ForegroundColor Green Write-Host 'echo "test,data" > test.csv' -ForegroundColor Green
@@ -210,4 +145,5 @@ catch {
Write-Host "" Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Setup complete!" -ForegroundColor Green Write-Host "Setup complete!" -ForegroundColor Green
Write-Host "=========================================" -ForegroundColor Cyan Write-Host "Open http://localhost:4200 in your browser" -ForegroundColor Yellow
Write-Host "=========================================" -ForegroundColor Cyan

View File

@@ -3,7 +3,7 @@
set -e set -e
echo "=========================================" echo "========================================="
echo "Test Artifact Data Lake - Quick Start" echo "Obsidian - Quick Start"
echo "=========================================" echo "========================================="
echo "" echo ""
@@ -26,8 +26,6 @@ fi
# Parse command line arguments # Parse command line arguments
REBUILD=false REBUILD=false
FULL_STACK=false
DEV_MODE=false
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
@@ -35,24 +33,14 @@ while [[ $# -gt 0 ]]; do
REBUILD=true REBUILD=true
shift shift
;; ;;
--full-stack)
FULL_STACK=true
shift
;;
--dev)
DEV_MODE=true
shift
;;
--help) --help)
echo "Usage: $0 [OPTIONS]" echo "Usage: $0 [OPTIONS]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " --rebuild Force rebuild of all containers" echo " --rebuild Force rebuild of all containers"
echo " --full-stack Start complete stack including frontend (production build)"
echo " --dev Start backend only, use separate dev server for frontend"
echo " --help Show this help message" echo " --help Show this help message"
echo "" echo ""
echo "Default: Starts backend services only (recommended for development)" echo "Brings up the complete stack: database, backend API, and frontend"
echo "" echo ""
exit 0 exit 0
;; ;;
@@ -80,79 +68,33 @@ if [ "$REBUILD" = true ]; then
echo "🔄 Rebuilding containers..." echo "🔄 Rebuilding containers..."
echo "Stopping existing containers..." echo "Stopping existing containers..."
$COMPOSE_CMD down $COMPOSE_CMD down
echo "Removing existing images for rebuild..."
if [ "$FULL_STACK" = true ]; then $COMPOSE_CMD down --rmi local 2>/dev/null || true
echo "Removing existing images for full rebuild..." echo "Building and starting all services..."
$COMPOSE_CMD -f docker-compose.production.yml down --rmi local 2>/dev/null || true $COMPOSE_CMD up -d --build
echo "Building and starting full stack..."
$COMPOSE_CMD -f docker-compose.production.yml up -d --build
else
echo "Removing existing backend images for rebuild..."
$COMPOSE_CMD down --rmi local 2>/dev/null || true
echo "Building and starting backend services..."
$COMPOSE_CMD up -d --build
fi
else else
# Regular startup echo "Starting all services..."
if [ "$FULL_STACK" = true ]; then $COMPOSE_CMD up -d
echo "Starting full production stack (backend + frontend)..."
$COMPOSE_CMD -f docker-compose.production.yml up -d
else
echo "Starting backend services..."
$COMPOSE_CMD up -d
fi
fi fi
echo "" echo ""
echo "Waiting for services to be ready..." echo "Waiting for services to be ready..."
sleep 15 sleep 20
echo "" echo ""
echo "=========================================" echo "========================================="
if [ "$FULL_STACK" = true ]; then echo "Complete Stack is running! 🚀"
echo "Complete Stack is running! 🚀"
else
echo "Backend Services are running!"
fi
echo "=========================================" echo "========================================="
echo "" echo ""
echo "Frontend: http://localhost:4200"
echo "API: http://localhost:8000" echo "API: http://localhost:8000"
echo "API Docs: http://localhost:8000/docs" echo "API Docs: http://localhost:8000/docs"
echo "MinIO Console: http://localhost:9001" echo "MinIO Console: http://localhost:9001"
echo " Username: minioadmin" echo " Username: minioadmin"
echo " Password: minioadmin" echo " Password: minioadmin"
echo "" echo ""
echo "To view logs: $COMPOSE_CMD logs -f"
if [ "$FULL_STACK" = true ]; then echo "To stop: $COMPOSE_CMD down"
echo "Frontend: http://localhost:80"
echo " (Production build with Nginx)"
echo ""
echo "To view logs: $COMPOSE_CMD -f docker-compose.production.yml logs -f"
echo "To stop: $COMPOSE_CMD -f docker-compose.production.yml down"
else
echo "To view logs: $COMPOSE_CMD logs -f"
echo "To stop: $COMPOSE_CMD down"
echo ""
echo "========================================="
echo "Frontend Options:"
echo "========================================="
echo ""
echo "Development (with hot reload):"
echo " ./dev-start.sh"
echo " Frontend will be available at: http://localhost:4200"
echo ""
echo "Or start full production stack:"
echo " ./quickstart.sh --full-stack"
echo " Complete stack at: http://localhost:80"
fi
echo ""
echo "========================================="
echo "Rebuild Options:"
echo "========================================="
echo ""
echo "Force rebuild backend: ./quickstart.sh --rebuild"
echo "Force rebuild full stack: ./quickstart.sh --rebuild --full-stack"
echo "" echo ""
echo "=========================================" echo "========================================="
echo "Testing the API..." echo "Testing the API..."
@@ -166,11 +108,8 @@ sleep 5
if curl -s http://localhost:8000/health | grep -q "healthy"; then if curl -s http://localhost:8000/health | grep -q "healthy"; then
echo "✓ API is healthy!" echo "✓ API is healthy!"
echo "" echo ""
if [ "$FULL_STACK" = false ]; then echo "🎯 All services are ready!"
echo "🎯 Ready for development!" echo ""
echo "Run './dev-start.sh' to start the frontend with hot reload"
echo ""
fi
echo "Example: Upload a test file" echo "Example: Upload a test file"
echo "----------------------------" echo "----------------------------"
echo 'echo "test,data" > test.csv' echo 'echo "test,data" > test.csv'
@@ -186,4 +125,5 @@ fi
echo "=========================================" echo "========================================="
echo "Setup complete! 🚀" echo "Setup complete! 🚀"
echo "Open http://localhost:4200 in your browser"
echo "=========================================" echo "========================================="