-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.ps1
More file actions
42 lines (34 loc) · 1.33 KB
/
Copy pathdev.ps1
File metadata and controls
42 lines (34 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# StoryForge local dev launcher
# Starts the FastAPI backend and Next.js frontend in two PowerShell windows.
param(
[int]$FrontendPort = 3001
)
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
$Frontend = Join-Path $Root "frontend"
$BackendPort = 7860
if (-not (Test-Path (Join-Path $Root "app.py"))) {
throw "Cannot find app.py. Run this script from the StoryForge repo root."
}
if (-not (Test-Path (Join-Path $Frontend "package.json"))) {
throw "Cannot find frontend/package.json. Is the frontend folder missing?"
}
Write-Host "Starting StoryForge backend on http://localhost:$BackendPort ..." -ForegroundColor Cyan
Start-Process powershell -WorkingDirectory $Root -ArgumentList @(
"-NoExit",
"-ExecutionPolicy", "Bypass",
"-Command",
"$env:PYTHONNOUSERSITE='1'; python app.py"
)
Write-Host "Starting StoryForge frontend on http://localhost:$FrontendPort ..." -ForegroundColor Cyan
Start-Process powershell -WorkingDirectory $Frontend -ArgumentList @(
"-NoExit",
"-ExecutionPolicy", "Bypass",
"-Command",
"npm run dev -- --port $FrontendPort"
)
Write-Host ""
Write-Host "StoryForge is starting." -ForegroundColor Green
Write-Host "Backend: http://localhost:$BackendPort"
Write-Host "Frontend: http://localhost:$FrontendPort"
Write-Host "Open: http://localhost:$FrontendPort/forge/"