docs: document full environment setup and enforce venv startup

Add a from-scratch setup section covering Python, Node/npm, PostgreSQL, and startup commands, and update the startup script to always create/use .venv instead of falling back to system Python.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-03 23:53:24 +08:00
parent e50c0b1f0b
commit f718807fa4
2 changed files with 60 additions and 33 deletions

View file

@ -25,7 +25,14 @@ $webLogFile = Join-Path $runDir "web.out.log"
$webErrFile = Join-Path $runDir "web.err.log"
$venvPython = Join-Path $projectRoot ".venv\\Scripts\\python.exe"
$pythonExe = if (Test-Path $venvPython) { $venvPython } else { "python" }
if (-not (Test-Path $venvPython)) {
Write-Host "==> .venv not found, creating virtual environment"
python -m venv (Join-Path $projectRoot ".venv")
}
if (-not (Test-Path $venvPython)) {
throw "failed_to_create_venv"
}
$pythonExe = $venvPython
Write-Host "==> Project root: $projectRoot"
Write-Host "==> Using python: $pythonExe"