Reorganize the Web App to match the GsmNode project layout: a Go backend-for-frontend in server/ that embeds the built SPA and reverse-proxies /api/* to the API Server, with the Vue 3 + Vite frontend moved into web/. - Move all frontend files into web/ (history preserved via renames) - Point vite build output at ../server/dist for Go embedding - Add server/ Go BFF (main.go, go.mod, .env.example, Run-WebApp.ps1) - Drop Docker/nginx deploy (Dockerfile, docker-compose.yml, nginx.conf.template, .dockerignore) in favor of the BFF, matching GsmNode - Update .claude/launch.json to run the dev server from web/ - Rewrite README.md for the new layout Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
887 B
PowerShell
30 lines
887 B
PowerShell
# Builds the Vue frontend (if needed) and runs the Web App BFF.
|
|
#
|
|
# ./Run-WebApp.ps1 # build frontend then serve
|
|
# ./Run-WebApp.ps1 -SkipBuild # serve existing dist only
|
|
|
|
param([switch]$SkipBuild)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$serverDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$root = Split-Path -Parent $serverDir # the "Web App" folder
|
|
$webDir = Join-Path $root "web"
|
|
|
|
$goBin = "C:\Program Files\Go\bin"
|
|
if (Test-Path $goBin) { $env:Path = "$goBin;$env:Path" }
|
|
|
|
if (-not $SkipBuild) {
|
|
Write-Host "Building frontend..." -ForegroundColor Cyan
|
|
Push-Location $webDir
|
|
try {
|
|
if (-not (Test-Path "node_modules")) { npm install }
|
|
npm run build
|
|
} finally { Pop-Location }
|
|
}
|
|
|
|
Push-Location $serverDir
|
|
try {
|
|
Write-Host "Starting Web App on :8090 (Ctrl+C to stop)..." -ForegroundColor Cyan
|
|
go run .
|
|
} finally { Pop-Location }
|