Unify quickstart: bring up complete stack (frontend + backend + database) in one command

- Add frontend service to docker-compose.yml (port 4200)
- Simplify quickstart scripts to start all services together
- Remove need for separate dev-start scripts and proxy config
- Frontend now accessible at http://localhost:4200 with nginx proxying API requests
This commit is contained in:
pratik
2025-10-15 13:59:03 -05:00
parent ed511b1e3c
commit d3a14a2b31
3 changed files with 57 additions and 169 deletions

View File

@@ -1,8 +1,6 @@
[CmdletBinding()]
param(
[switch]$Rebuild,
[switch]$FullStack,
[switch]$Dev,
[switch]$Help
)
@@ -10,24 +8,22 @@ $ErrorActionPreference = "Stop"
if ($Help) {
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 ""
Write-Host "Usage: .\quickstart.ps1 [OPTIONS]" -ForegroundColor White
Write-Host ""
Write-Host "Options:" -ForegroundColor Yellow
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 ""
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 ""
exit 0
}
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 ""
@@ -72,104 +68,46 @@ if ($Rebuild) {
Write-Host "Rebuilding containers..." -ForegroundColor Yellow
Write-Host "Stopping existing containers..." -ForegroundColor White
if ($FullStack) {
if ($ComposeCmd -eq "docker compose") {
& 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 {
& 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
}
if ($ComposeCmd -eq "docker compose") {
& docker compose down
Write-Host "Removing existing images for rebuild..." -ForegroundColor White
& docker compose down --rmi local 2>$null
Write-Host "Building and starting all services..." -ForegroundColor White
& docker compose up -d --build
} else {
if ($ComposeCmd -eq "docker compose") {
& 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 {
& 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
}
& docker-compose down
Write-Host "Removing existing images for rebuild..." -ForegroundColor White
& docker-compose down --rmi local 2>$null
Write-Host "Building and starting all services..." -ForegroundColor White
& docker-compose up -d --build
}
} else {
# Regular startup
if ($FullStack) {
Write-Host "Starting full production stack (backend + frontend)..." -ForegroundColor Green
if ($ComposeCmd -eq "docker compose") {
& docker compose -f "docker-compose.production.yml" up -d
} else {
& docker-compose -f "docker-compose.production.yml" up -d
}
Write-Host "Starting all services..." -ForegroundColor Green
if ($ComposeCmd -eq "docker compose") {
& docker compose up -d
} else {
Write-Host "Starting backend services..." -ForegroundColor Green
if ($ComposeCmd -eq "docker compose") {
& docker compose up -d
} else {
& docker-compose up -d
}
& docker-compose up -d
}
}
Write-Host ""
Write-Host "Waiting for services to be ready..." -ForegroundColor Yellow
Start-Sleep -Seconds 15
Start-Sleep -Seconds 20
Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan
if ($FullStack) {
Write-Host "Complete Stack is running!" -ForegroundColor Green
} else {
Write-Host "Backend Services are running!" -ForegroundColor Green
}
Write-Host "Complete Stack is running!" -ForegroundColor Green
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Frontend: http://localhost:4200" -ForegroundColor White
Write-Host "API: http://localhost:8000" -ForegroundColor White
Write-Host "API Docs: http://localhost:8000/docs" -ForegroundColor White
Write-Host "MinIO Console: http://localhost:9001" -ForegroundColor White
Write-Host " Username: minioadmin" -ForegroundColor Gray
Write-Host " Password: minioadmin" -ForegroundColor Gray
Write-Host ""
if ($FullStack) {
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 "To view logs: $ComposeCmd logs -f" -ForegroundColor Yellow
Write-Host "To stop: $ComposeCmd down" -ForegroundColor Yellow
Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Testing the API..." -ForegroundColor Cyan
@@ -185,11 +123,8 @@ try {
if ($response.status -eq "healthy") {
Write-Host "[OK] API is healthy!" -ForegroundColor Green
Write-Host ""
if (-not $FullStack) {
Write-Host "Ready for development!" -ForegroundColor Green
Write-Host "Run '.\dev-start.ps1' to start the frontend with hot reload" -ForegroundColor Yellow
Write-Host ""
}
Write-Host "All services are ready!" -ForegroundColor Green
Write-Host ""
Write-Host "Example: Upload a test file" -ForegroundColor White
Write-Host "----------------------------" -ForegroundColor Gray
Write-Host 'echo "test,data" > test.csv' -ForegroundColor Green
@@ -210,4 +145,5 @@ catch {
Write-Host ""
Write-Host "=========================================" -ForegroundColor Cyan
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