Add PostgreSQL analytics dashboard prototype and realistic sample data

This commit is contained in:
maxwes08
2026-11-03 09:13:00 +01:00
commit 70b94f8672
38 changed files with 2873 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
$ErrorActionPreference = 'Stop'
$repoRoot = Split-Path $PSScriptRoot -Parent
if ($env:DATABASE_URL) { return }
$localRoot = Join-Path $repoRoot '.local'
$pgCtl = Join-Path $localRoot 'pgsql\bin\pg_ctl.exe'
$dataPath = Join-Path $localRoot 'pgdata'
if (!(Test-Path -LiteralPath $pgCtl)) { throw 'Run mockups/setup-database.ps1 first.' }
& $pgCtl status -D $dataPath *> $null
if ($LASTEXITCODE -ne 0) {
$argsForPg = @('start','-D',('"'+$dataPath+'"'),'-l',('"'+(Join-Path $localRoot 'postgres.log')+'"'),'-o','"-h 127.0.0.1 -p 55432"','-w','-t','30')
$startResult = Start-Process -FilePath $pgCtl -ArgumentList $argsForPg -WindowStyle Hidden -PassThru
if (!$startResult.WaitForExit(35000)) { throw 'PostgreSQL start timed out. See .local/postgres.log.' }
if ($startResult.ExitCode -ne 0) { throw 'PostgreSQL could not start. See .local/postgres.log.' }
}