-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.ps1
More file actions
54 lines (45 loc) · 1.73 KB
/
Copy pathrun.ps1
File metadata and controls
54 lines (45 loc) · 1.73 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
43
44
45
46
47
48
49
50
51
52
53
54
# FloatNote - dev runner
# Launches the backend (Python), the React app (Vite), and Electron,
# each in its own PowerShell window.
#
# Usage:
# .\run.ps1 # start all three
# .\run.ps1 -NoElectron # backend + react only
#
# Requires: root .venv (Python deps installed), npm deps installed in
# frontend\react-app and frontend\electron.
param(
[switch]$NoElectron
)
$ErrorActionPreference = "Stop"
$root = $PSScriptRoot
$venvPython = Join-Path $root ".venv\Scripts\python.exe"
if (-not (Test-Path $venvPython)) {
Write-Warning "Root .venv not found at $venvPython - falling back to 'python' on PATH."
$venvPython = "python"
}
$backendDir = Join-Path $root "backend"
$reactDir = Join-Path $root "frontend\react-app"
$electronDir = Join-Path $root "frontend\electron"
Write-Host "Starting FloatNote dev stack..." -ForegroundColor Cyan
# 1) Backend - python main.py (run from backend\ so ai_modules resolves)
Write-Host " -> Backend : $backendDir" -ForegroundColor Green
Start-Process powershell -ArgumentList @(
"-NoExit", "-Command",
"Set-Location '$backendDir'; & '$venvPython' main.py"
)
# 2) React app - npm run dev
Write-Host " -> React app: $reactDir" -ForegroundColor Green
Start-Process powershell -ArgumentList @(
"-NoExit", "-Command",
"Set-Location '$reactDir'; npm run dev"
)
# 3) Electron - npm start (give Vite a moment to come up first)
if (-not $NoElectron) {
Write-Host " -> Electron : $electronDir" -ForegroundColor Green
Start-Process powershell -ArgumentList @(
"-NoExit", "-Command",
"Set-Location '$electronDir'; Start-Sleep -Seconds 3; npm start"
)
}
Write-Host "All processes launched in separate windows. Close those windows to stop." -ForegroundColor Cyan