From edf8b4b9cbf82cd3ce85146dcf9272d26a27cca5 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:03:39 -0230 Subject: [PATCH 01/12] Add files via upload --- REQUIREMENTS.md | 182 ++++++++++++++++++++++++++++++++++++++++++++++++ start.bat | 29 ++++++++ 2 files changed, 211 insertions(+) create mode 100644 REQUIREMENTS.md create mode 100644 start.bat diff --git a/REQUIREMENTS.md b/REQUIREMENTS.md new file mode 100644 index 0000000..147837a --- /dev/null +++ b/REQUIREMENTS.md @@ -0,0 +1,182 @@ +# Control Center — Requirements + +Local-first business dashboard from +https://github.com/mreflow/control-center + +This file lists what you need to install and run Control Center on Windows +with the included `setup.bat`. The official app does **not** ship its own +REQUIREMENTS.md; npm packages are locked in `package-lock.json`. + +--- + +## 1. Required + +| Item | Version / detail | Why | +|---|---|---| +| Windows | 10 22H2 or Windows 11 | `setup.bat`, portable Node, Ollama | +| Node.js | **24.19.0 or newer** | Official engine. `setup.bat` installs portable **24.20.0 LTS** if needed | +| npm | Comes with Node (project pins npm 11.x) | Installs app packages from `package-lock.json` | +| Modern desktop browser | Chrome, Edge, Firefox, Brave | UI is `http://127.0.0.1:3000` | +| Disk (app only) | ~500 MB | Repo + `node_modules` + Next.js build | +| RAM (app only) | 4 GB free | Dashboard, collectors, SQLite | + +Git is optional. If Git is installed, `setup.bat` clones the repo. If not, it downloads the GitHub ZIP instead. + +Admin rights are **not** required. Portable Node lands in: + +`%LOCALAPPDATA%\ControlCenter-Runtime\node` + +--- + +## 2. Network and ports + +| Port | Bind | Used by | +|---|---|---| +| **3000** | `127.0.0.1` only | Control Center | +| **11434** | `127.0.0.1` only | Ollama local AI | + +The app rejects non-loopback Host/Origin headers. Do not expose it on your LAN without your own auth proxy. + +First run needs internet for: + +- GitHub clone or ZIP +- `npm ci` (locked dependencies) +- Optional Node / Ollama / model downloads + +After that, the dashboard itself is local-first. Collectors still need internet to fetch public news, sites, and audience pages. + +--- + +## 3. Application packages (installed by `npm run launch`) + +From the official `package.json` (v0.3.1). You do not install these by hand. + +**Runtime** + +- next +- react +- react-dom +- lucide-react +- fast-xml-parser + +**Dev / build** + +- typescript +- tsx +- eslint +- eslint-config-next +- @types/node +- @types/react +- @types/react-dom + +`npm run launch` runs `npm ci` against `package-lock.json` when needed, then builds and starts the server. + +--- + +## 4. Optional — local AI (Ollama) + +No cloud key is required. Newsletter intelligence **does** need some model, local or cloud. + +| Item | Detail | +|---|---| +| Ollama | Windows app from https://ollama.com/download/windows or `winget install Ollama.Ollama` | +| API | `http://127.0.0.1:11434` (Control Center accepts loopback only) | +| Loaded model | Control Center lists **currently loaded** text models, not every model on disk | + +`setup.bat` picks a recommended model from RAM: + +| Installed RAM | Model | Download | Role | +|---|---|---|---| +| Under ~10 GB | `gemma3:4b` | ~3.3 GB | Fits smaller laptops | +| Typical PC (default) | `qwen2.5:7b` | ~4.7 GB | Summaries, ranking, newsletters | +| ~20 GB or more | `qwen2.5:14b` | ~9 GB | Higher quality, same tasks | + +Override with: + +```bat +setup.bat /model=qwen2.5:7b +setup.bat /skip-ollama +``` + +Keep the Ollama tray app running while the dashboard is open. After a reboot, start Ollama first or run `start.bat` (it will try to start `ollama serve`). + +In the app: **Settings → AI curation → Ollama · local → Reload models**. + +--- + +## 5. Optional — cloud AI keys + +Only needed if you do not use Ollama / LM Studio. Keys can go in Settings or in `.env.local`: + +``` +OPENAI_API_KEY= +ANTHROPIC_API_KEY= +GEMINI_API_KEY= +XAI_API_KEY= +``` + +A key does nothing until that provider is selected in Settings. Local Ollama does not use `OLLAMA_API_KEY` (that name is reserved for Ollama Cloud). + +LM Studio alternative endpoint: `http://127.0.0.1:1234`. + +--- + +## 6. Optional — Gmail newsletters + +- Google Cloud project +- Gmail API enabled +- OAuth client ID + secret (read-only) +- Any Gmail account + +Configured later under **Settings → Newsletters**. Not installed by `setup.bat`. + +--- + +## 7. Folders created by setup + +| Path | Contents | +|---|---| +| `F:\AI\apps\mattwolfe\control-center` | App source (or whatever folder you chose) | +| `%LOCALAPPDATA%\Control Center` | `settings.json`, SQLite, snapshots | +| `%LOCALAPPDATA%\ControlCenter-Runtime\node` | Portable Node 24.20 if winget was unavailable | +| `control-center\.env.local` | Copied from `.env.example` on first run | +| `control-center\start.bat` | Later launches | + +Optional override in `.env.local`: + +``` +CONTROL_CENTER_DATA_DIR= +``` + +Must be an absolute path if set. + +--- + +## 8. What `setup.bat` does automatically + +1. Finds or installs Node.js 24.19+ +2. `git clone` (or ZIP) of `mreflow/control-center` +3. Creates the data folder and `.env.local` +4. Installs Ollama, pulls the recommended model, keeps it loaded +5. Points Settings at Ollama +6. Runs `npm run launch` (install + build + server + browser) + +Useful commands after install, from the project folder: + +```bat +npm run launch +npm run launch -- --no-open +npm run launch -- --port=3001 +npm run doctor +npm run backup +``` + +--- + +## 9. Quick check that it is running + +- Command Prompt window titled **Control Center** is still open +- Browser opens `http://127.0.0.1:3000` +- Optional: `http://127.0.0.1:11434/api/tags` returns JSON if Ollama is up + +If the Command Prompt closes, the dashboard stops. Use `start.bat` to bring it back. diff --git a/start.bat b/start.bat new file mode 100644 index 0000000..795d8ed --- /dev/null +++ b/start.bat @@ -0,0 +1,29 @@ +@echo off +if not defined CC_KEEPOPEN ( + set "CC_KEEPOPEN=1" + title Control Center + cmd /k "%~f0" %* + exit /b +) +title Control Center +cd /d "F:\AI\apps\mattwolfe\control-center" +set "NODE_HOME=C:\Users\SODKGB\AppData\Local\ControlCenter-Runtime\node" +if not exist "%NODE_HOME%\node.exe" set "NODE_HOME=%ProgramFiles%\nodejs" +set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%" +echo Starting Control Center... +echo This window IS the server. Do not close it. +echo Dashboard: http://127.0.0.1:3000 +echo Leave the Ollama app running for local AI. +echo. +if exist "%LOCALAPPDATA%\Control Center\launcher.lock" del /f /q "%LOCALAPPDATA%\Control Center\launcher.lock" >nul 2>&1 +where ollama >nul 2>&1 +if not errorlevel 1 ( + curl.exe -s -m 2 http://127.0.0.1:11434/api/tags >nul 2>&1 + if errorlevel 1 start "Ollama Serve" /MIN cmd /c "ollama serve" +) +"%NODE_HOME%\node.exe" -v +"%NODE_HOME%\node.exe" "scripts\launch.mjs" +if errorlevel 1 "%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 +echo. +echo Control Center stopped. This window will stay open. +pause From b3fdc2dc5e150220dbbac5f458e9592a079ecad3 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:05:50 -0230 Subject: [PATCH 02/12] Add files via upload --- setup (6).bat | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 setup (6).bat diff --git a/setup (6).bat b/setup (6).bat new file mode 100644 index 0000000..34e4430 --- /dev/null +++ b/setup (6).bat @@ -0,0 +1,156 @@ +@echo off +setlocal EnableExtensions EnableDelayedExpansion +title Control Center +cd /d "%~dp0" + +if not defined CC_KEEPOPEN ( + set "CC_KEEPOPEN=1" + cmd /k "%~f0" %* + exit /b +) + +set "PULL_MODEL=" +for %%A in (%*) do ( + set "ARG=%%~A" + if /i "!ARG:~0,7!"=="/model=" set "PULL_MODEL=!ARG:~7!" +) + +set "REPO_URL=https://github.com/mreflow/control-center.git" +set "REPO_ZIP=https://github.com/mreflow/control-center/archive/refs/heads/main.zip" +set "NODE_VER=24.20.0" +set "NODE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" +set "DATA_DIR=%LOCALAPPDATA%\Control Center" +set "OLLAMA_URL=http://127.0.0.1:11434" +set "SCRIPT_DIR=%~dp0" +if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%" + +rem In-repo: setup.bat sits next to package.json. +rem Outside-repo: setup.bat sits beside a control-center folder. +if exist "%SCRIPT_DIR%\package.json" ( + findstr /C:"self-hosted-control-center" "%SCRIPT_DIR%\package.json" >nul 2>&1 + if not errorlevel 1 ( + set "INSTALL_DIR=%SCRIPT_DIR%" + goto HAVE_DIR + ) +) +if exist "%SCRIPT_DIR%\control-center\package.json" ( + set "INSTALL_DIR=%SCRIPT_DIR%\control-center" + goto HAVE_DIR +) +set "INSTALL_DIR=%SCRIPT_DIR%\control-center" + +:HAVE_DIR +echo. +echo Control Center setup +echo Project: %INSTALL_DIR% +echo. + +if exist "%NODE_HOME%\node.exe" goto NODE_OK +if exist "%ProgramFiles%\nodejs\node.exe" set "NODE_HOME=%ProgramFiles%\nodejs" & goto NODE_OK + +echo Downloading portable Node.js %NODE_VER%... +set "ARCH=x64" +if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64" +set "ZIP=%TEMP%\node-v%NODE_VER%-win-%ARCH%.zip" +if not exist "%ZIP%" curl.exe -L --fail -o "%ZIP%" "https://nodejs.org/dist/v%NODE_VER%/node-v%NODE_VER%-win-%ARCH%.zip" +if not exist "%ZIP%" goto FAIL +set "EXTRACT=%TEMP%\cc-node-unpack" +if exist "%EXTRACT%" rmdir /s /q "%EXTRACT%" +mkdir "%EXTRACT%" +tar.exe --force-local -xf "%ZIP%" -C "%EXTRACT%" 2>nul +if not exist "%EXTRACT%\node-v%NODE_VER%-win-%ARCH%\node.exe" ( + "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -Command "Expand-Archive -LiteralPath '%ZIP%' -DestinationPath '%EXTRACT%' -Force" +) +if not exist "%NODE_HOME%" mkdir "%NODE_HOME%" +robocopy "%EXTRACT%\node-v%NODE_VER%-win-%ARCH%" "%NODE_HOME%" /E /NFL /NDL /NJH /NJS /NP >nul +if not exist "%NODE_HOME%\node.exe" goto FAIL + +:NODE_OK +set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\WindowsPowerShell\v1.0" +echo Node: +"%NODE_HOME%\node.exe" -v + +if exist "%INSTALL_DIR%\package.json" goto SOURCE_OK +echo Downloading Control Center... +if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%" +where git >nul 2>&1 +if not errorlevel 1 ( + git clone --depth 1 "%REPO_URL%" "%INSTALL_DIR%" + if not errorlevel 1 goto SOURCE_OK +) +set "APPZIP=%TEMP%\control-center-main.zip" +curl.exe -L --fail -o "%APPZIP%" "%REPO_ZIP%" +tar.exe --force-local -xf "%APPZIP%" -C "%TEMP%" 2>nul +if exist "%TEMP%\control-center-main\package.json" xcopy /e /i /y /q "%TEMP%\control-center-main\*" "%INSTALL_DIR%\" >nul +if not exist "%INSTALL_DIR%\package.json" goto FAIL + +:SOURCE_OK +if not exist "%DATA_DIR%" mkdir "%DATA_DIR%" +if exist "%INSTALL_DIR%\.env.example" if not exist "%INSTALL_DIR%\.env.local" copy /y "%INSTALL_DIR%\.env.example" "%INSTALL_DIR%\.env.local" >nul +if exist "%SCRIPT_DIR%\start.bat" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy /y "%SCRIPT_DIR%\start.bat" "%INSTALL_DIR%\start.bat" >nul +if exist "%SCRIPT_DIR%\REQUIREMENTS.md" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy /y "%SCRIPT_DIR%\REQUIREMENTS.md" "%INSTALL_DIR%\REQUIREMENTS.md" >nul +echo Source ready. + +if exist "%LOCALAPPDATA%\Programs\Ollama\ollama.exe" set "PATH=%LOCALAPPDATA%\Programs\Ollama;%PATH%" +where ollama >nul 2>&1 +if errorlevel 1 ( + echo Ollama not found. Dashboard will still run. + goto APP +) +curl.exe -s -m 2 "%OLLAMA_URL%/api/tags" >nul 2>&1 +if errorlevel 1 start "Ollama" /MIN cmd /c "ollama serve" + +set "MODEL=" +if not "%PULL_MODEL%"=="" ( + echo Downloading requested model %PULL_MODEL%... + ollama pull %PULL_MODEL% + set "MODEL=%PULL_MODEL%" +) else ( + echo Local Ollama models: + ollama list + for /f "skip=1 tokens=1" %%M in ('ollama ps 2^>nul') do if not defined MODEL set "MODEL=%%M" + if not defined MODEL for /f "skip=1 tokens=1" %%M in ('ollama list 2^>nul') do if not defined MODEL set "MODEL=%%M" +) + +if "%MODEL%"=="" ( + echo No local model selected. Nothing will be downloaded. + echo Optional later: ollama pull qwen2.5:7b + echo Or: setup.bat /model=qwen2.5:7b + goto APP +) + +echo Using existing model %MODEL% +curl.exe -s -m 60 "%OLLAMA_URL%/api/generate" -H "Content-Type: application/json" -d "{\"model\":\"%MODEL%\",\"prompt\":\"ok\",\"stream\":false,\"keep_alive\":-1}" >nul 2>&1 +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),path=require('path');const p=path.join(process.env.LOCALAPPDATA,'Control Center','settings.json');let s={};try{s=JSON.parse(fs.readFileSync(p,'utf8').replace(/^\uFEFF/,''))}catch(e){} s.ai=s.ai||{};s.ai.provider='ollama';s.ai.model=process.env.MODEL;s.ai.localBaseUrls=Object.assign({lmstudio:'http://127.0.0.1:1234',ollama:'http://127.0.0.1:11434'},s.ai.localBaseUrls||{});fs.mkdirSync(path.dirname(p),{recursive:true});fs.writeFileSync(p,JSON.stringify(s,null,2)+'\n');" + +:APP +cd /d "%INSTALL_DIR%" +if exist "%DATA_DIR%\launcher.lock" del /f /q "%DATA_DIR%\launcher.lock" >nul 2>&1 +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p);if(b[0]===0xEF&&b[1]===0xBB&&b[2]===0xBF)fs.writeFileSync(p,b.subarray(3));" + +echo Installing app packages... +call "%NODE_HOME%\npm.cmd" run setup +if errorlevel 1 call "%NODE_HOME%\npm.cmd" ci +if not exist "node_modules\next\dist\bin\next" goto FAIL +if not exist ".next\BUILD_ID" ( + echo Building dashboard... + call "%NODE_HOME%\npm.cmd" run build + if errorlevel 1 goto FAIL +) + +echo. +echo Starting server. Leave this window open. +echo Dashboard: http://127.0.0.1:3000 +echo. +start "" "http://127.0.0.1:3000" +"%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 +echo. +echo Server stopped. +pause +exit /b 0 + +:FAIL +echo. +echo Setup could not finish. Check the message above. +pause +exit /b 1 From 73334c755d60d95da8f616cca04a64142b4ab66e Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:07:11 -0230 Subject: [PATCH 03/12] Rename setup (6).bat to setup.bat --- setup (6).bat => setup.bat | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename setup (6).bat => setup.bat (100%) diff --git a/setup (6).bat b/setup.bat similarity index 100% rename from setup (6).bat rename to setup.bat From 37f0bd00a0062d52a27e38e1565bd65413f68d65 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:27:59 -0230 Subject: [PATCH 04/12] Add files via upload --- REQUIREMENTS (1).md | 66 ++++++++++++++ setup (7).bat | 205 ++++++++++++++++++++++++++++++++++++++++++++ start (1).bat | 55 ++++++++++++ 3 files changed, 326 insertions(+) create mode 100644 REQUIREMENTS (1).md create mode 100644 setup (7).bat create mode 100644 start (1).bat diff --git a/REQUIREMENTS (1).md b/REQUIREMENTS (1).md new file mode 100644 index 0000000..c8173a6 --- /dev/null +++ b/REQUIREMENTS (1).md @@ -0,0 +1,66 @@ +# Control Center — Windows requirements + +App: https://github.com/mreflow/control-center + +These three files live in the repo root: + +- REQUIREMENTS.md +- setup.bat +- start.bat + +## Required + +- Windows 10 22H2 or Windows 11 +- Internet for the first install +- A desktop browser +- About 500 MB disk for the app +- 4 GB RAM free for the dashboard + +setup.bat installs Node.js 24.20 if it is missing. Git is optional. + +## Optional local AI (Ollama) + +setup.bat will: + +- Install Ollama if it is missing (winget, then OllamaSetup.exe) +- Read installed RAM +- Pick a default model: + - under 10 GB RAM: gemma3:4b + - 10-19 GB RAM: qwen2.5:7b + - 20 GB+ RAM: qwen2.5:14b +- Download that model if it is not already installed +- Point Settings at Ollama on http://127.0.0.1:11434 + +Override the model: + + setup.bat /model=qwen2.5:7b + +If the chosen model is already on disk, it is not downloaded again. +Keep the Ollama tray app running while you use the dashboard. +In the app: Settings -> AI curation -> Ollama -> Reload models. + +## Ports + +- http://127.0.0.1:3000 Control Center +- http://127.0.0.1:11434 Ollama + +## Folders + +- App: this repo folder +- Data: %LOCALAPPDATA%\Control Center +- Portable Node: %LOCALAPPDATA%\ControlCenter-Runtime\node + +## How to use + +From the repo root: + + setup.bat + +Later launches: + + start.bat + +Leave the Command Prompt open. That window is the server. +Open http://127.0.0.1:3000 if the browser does not open. + +Ctrl+C stops the server. diff --git a/setup (7).bat b/setup (7).bat new file mode 100644 index 0000000..a60d303 --- /dev/null +++ b/setup (7).bat @@ -0,0 +1,205 @@ +@echo off +setlocal EnableExtensions EnableDelayedExpansion +title Control Center +cd /d "%~dp0" + +if not defined CC_KEEPOPEN ( + set "CC_KEEPOPEN=1" + cmd /k "%~f0" %* + exit /b +) + +set "PULL_MODEL=" +for %%A in (%*) do ( + set "ARG=%%~A" + if /i "!ARG:~0,7!"=="/model=" set "PULL_MODEL=!ARG:~7!" +) + +set "REPO_URL=https://github.com/mreflow/control-center.git" +set "REPO_ZIP=https://github.com/mreflow/control-center/archive/refs/heads/main.zip" +set "NODE_VER=24.20.0" +set "NODE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" +set "DATA_DIR=%LOCALAPPDATA%\Control Center" +set "OLLAMA_URL=http://127.0.0.1:11434" +set "SCRIPT_DIR=%~dp0" +if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%" + +rem In-repo: setup.bat sits next to package.json. +rem Outside-repo: setup.bat sits beside a control-center folder. +if exist "%SCRIPT_DIR%\package.json" ( + findstr /C:"self-hosted-control-center" "%SCRIPT_DIR%\package.json" >nul 2>&1 + if not errorlevel 1 ( + set "INSTALL_DIR=%SCRIPT_DIR%" + goto HAVE_DIR + ) +) +if exist "%SCRIPT_DIR%\control-center\package.json" ( + set "INSTALL_DIR=%SCRIPT_DIR%\control-center" + goto HAVE_DIR +) +set "INSTALL_DIR=%SCRIPT_DIR%\control-center" + +:HAVE_DIR +echo. +echo Control Center setup +echo Project: %INSTALL_DIR% +echo. + +set "PORTABLE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" +set "NODE_HOME=%PORTABLE_HOME%" + +if exist "%PORTABLE_HOME%\node.exe" ( + call :node_new_enough "%PORTABLE_HOME%" + if not errorlevel 1 goto NODE_OK + echo Portable Node is older than 24.19.0. Replacing it... +) + +if exist "%ProgramFiles%\nodejs\node.exe" ( + call :node_new_enough "%ProgramFiles%\nodejs" + if not errorlevel 1 ( + set "NODE_HOME=%ProgramFiles%\nodejs" + goto NODE_OK + ) + echo System Node is older than 24.19.0. Installing portable %NODE_VER%... +) + +rem Incompatible binary may live under Program Files. Always install into the portable folder. +set "NODE_HOME=%PORTABLE_HOME%" +echo Downloading portable Node.js %NODE_VER%... +set "ARCH=x64" +if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64" +set "ZIP=%TEMP%\node-v%NODE_VER%-win-%ARCH%.zip" +if not exist "%ZIP%" curl.exe -L --fail -o "%ZIP%" "https://nodejs.org/dist/v%NODE_VER%/node-v%NODE_VER%-win-%ARCH%.zip" +if not exist "%ZIP%" goto FAIL +set "EXTRACT=%TEMP%\cc-node-unpack" +if exist "%EXTRACT%" rmdir /s /q "%EXTRACT%" +mkdir "%EXTRACT%" +tar.exe --force-local -xf "%ZIP%" -C "%EXTRACT%" 2>nul +if not exist "%EXTRACT%\node-v%NODE_VER%-win-%ARCH%\node.exe" ( + "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -Command "Expand-Archive -LiteralPath '%ZIP%' -DestinationPath '%EXTRACT%' -Force" +) +if not exist "%NODE_HOME%" mkdir "%NODE_HOME%" +robocopy "%EXTRACT%\node-v%NODE_VER%-win-%ARCH%" "%NODE_HOME%" /E /NFL /NDL /NJH /NJS /NP >nul +if not exist "%NODE_HOME%\node.exe" goto FAIL + +:NODE_OK +set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\WindowsPowerShell\v1.0" +echo Node: +"%NODE_HOME%\node.exe" -v + +if exist "%INSTALL_DIR%\package.json" goto SOURCE_OK +echo Downloading Control Center... +if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%" +where git >nul 2>&1 +if not errorlevel 1 ( + git clone --depth 1 "%REPO_URL%" "%INSTALL_DIR%" + if not errorlevel 1 goto SOURCE_OK +) +set "APPZIP=%TEMP%\control-center-main.zip" +curl.exe -L --fail -o "%APPZIP%" "%REPO_ZIP%" +tar.exe --force-local -xf "%APPZIP%" -C "%TEMP%" 2>nul +if exist "%TEMP%\control-center-main\package.json" xcopy /e /i /y /q "%TEMP%\control-center-main\*" "%INSTALL_DIR%\" >nul +if not exist "%INSTALL_DIR%\package.json" goto FAIL + +:SOURCE_OK +if not exist "%DATA_DIR%" mkdir "%DATA_DIR%" +if exist "%INSTALL_DIR%\.env.example" if not exist "%INSTALL_DIR%\.env.local" copy /y "%INSTALL_DIR%\.env.example" "%INSTALL_DIR%\.env.local" >nul +if exist "%SCRIPT_DIR%\start.bat" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy /y "%SCRIPT_DIR%\start.bat" "%INSTALL_DIR%\start.bat" >nul +if exist "%SCRIPT_DIR%\REQUIREMENTS.md" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy /y "%SCRIPT_DIR%\REQUIREMENTS.md" "%INSTALL_DIR%\REQUIREMENTS.md" >nul +echo Source ready. + +set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" +where ollama >nul 2>&1 +if errorlevel 1 ( + echo Installing Ollama... + where winget >nul 2>&1 + if not errorlevel 1 winget install --id Ollama.Ollama -e --accept-package-agreements --accept-source-agreements + set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" +) +where ollama >nul 2>&1 +if errorlevel 1 ( + echo Downloading OllamaSetup.exe... + curl.exe -L --fail -o "%TEMP%\OllamaSetup.exe" "https://ollama.com/download/OllamaSetup.exe" + if not errorlevel 1 "%TEMP%\OllamaSetup.exe" /VERYSILENT /NORESTART /SUPPRESSMSGBOXES + set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" +) +where ollama >nul 2>&1 +if errorlevel 1 ( + echo Ollama could not be installed. Dashboard will still run. + goto APP +) + +curl.exe -s -m 2 "%OLLAMA_URL%/api/tags" >nul 2>&1 +if errorlevel 1 start "Ollama" /MIN cmd /c "ollama serve" +timeout /t 3 /nobreak >nul + +set "RAM_GB=16" +set "PS=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" +if exist "%PS%" ( + for /f "delims=" %%M in ('"%PS%" -NoProfile -Command "[int]((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory/1GB)"') do set "RAM_GB=%%M" +) +set "RECOMMENDED=qwen2.5:7b" +if %RAM_GB% LSS 10 set "RECOMMENDED=gemma3:4b" +if %RAM_GB% GEQ 20 set "RECOMMENDED=qwen2.5:14b" +echo Detected about %RAM_GB% GB RAM +echo Recommended model: %RECOMMENDED% + +if not "%PULL_MODEL%"=="" ( + set "MODEL=%PULL_MODEL%" +) else ( + set "MODEL=%RECOMMENDED%" +) + +echo Local Ollama models: +ollama list +ollama list 2>nul | findstr /I /C:"%MODEL%" >nul +if errorlevel 1 ( + echo Downloading %MODEL% ... + ollama pull %MODEL% + if errorlevel 1 ( + echo Could not download %MODEL%. Dashboard will still run. + goto APP + ) +) else ( + echo %MODEL% is already installed. Skipping download. +) + +echo Using model %MODEL% +curl.exe -s -m 180 "%OLLAMA_URL%/api/generate" -H "Content-Type: application/json" -d "{\"model\":\"%MODEL%\",\"prompt\":\"ok\",\"stream\":false,\"keep_alive\":-1}" >nul 2>&1 +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),path=require('path');const p=path.join(process.env.LOCALAPPDATA,'Control Center','settings.json');let s={};try{s=JSON.parse(fs.readFileSync(p,'utf8').replace(/^\uFEFF/,''))}catch(e){} s.ai=s.ai||{};s.ai.provider='ollama';s.ai.model=process.env.MODEL;s.ai.localBaseUrls=Object.assign({lmstudio:'http://127.0.0.1:1234',ollama:'http://127.0.0.1:11434'},s.ai.localBaseUrls||{});fs.mkdirSync(path.dirname(p),{recursive:true});fs.writeFileSync(p,JSON.stringify(s,null,2)+'\n');" + +:APP +cd /d "%INSTALL_DIR%" +if exist "%DATA_DIR%\launcher.lock" del /f /q "%DATA_DIR%\launcher.lock" >nul 2>&1 +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p);if(b[0]===0xEF&&b[1]===0xBB&&b[2]===0xBF)fs.writeFileSync(p,b.subarray(3));" + +echo Installing app packages... +call "%NODE_HOME%\npm.cmd" run setup +if errorlevel 1 call "%NODE_HOME%\npm.cmd" ci +if not exist "node_modules\next\dist\bin\next" goto FAIL +if not exist ".next\BUILD_ID" ( + echo Building dashboard... + call "%NODE_HOME%\npm.cmd" run build + if errorlevel 1 goto FAIL +) + +echo. +echo Starting server. Leave this window open. +echo Dashboard: http://127.0.0.1:3000 +echo. +start "" "http://127.0.0.1:3000" +"%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 +echo. +echo Server stopped. +pause +exit /b 0 + +:node_new_enough +"%~1\node.exe" -e "const p=process.versions.node.split('.').map(Number);process.exit((p[0]>24||(p[0]===24&&p[1]>=19))?0:1)" +exit /b %ERRORLEVEL% + +:FAIL +echo. +echo Setup could not finish. Check the message above. +pause +exit /b 1 diff --git a/start (1).bat b/start (1).bat new file mode 100644 index 0000000..f376303 --- /dev/null +++ b/start (1).bat @@ -0,0 +1,55 @@ +@echo off +setlocal EnableExtensions +title Control Center +cd /d "%~dp0" + +if not defined CC_KEEPOPEN ( + set "CC_KEEPOPEN=1" + cmd /k "%~f0" %* + exit /b +) + +set "NODE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" +if not exist "%NODE_HOME%\node.exe" set "NODE_HOME=%ProgramFiles%\nodejs" +set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\WindowsPowerShell\v1.0" +set "DATA_DIR=%LOCALAPPDATA%\Control Center" + +if not exist "%~dp0package.json" ( + echo Put start.bat in the control-center folder. + pause + exit /b 1 +) +if not exist "%NODE_HOME%\node.exe" ( + echo Node.js not found. Run setup.bat first. + pause + exit /b 1 +) + +if exist "%DATA_DIR%\launcher.lock" del /f /q "%DATA_DIR%\launcher.lock" >nul 2>&1 +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p);if(b[0]===0xEF&&b[1]===0xBB&&b[2]===0xBF)fs.writeFileSync(p,b.subarray(3));" + +where ollama >nul 2>&1 +if not errorlevel 1 ( + curl.exe -s -m 2 http://127.0.0.1:11434/api/tags >nul 2>&1 + if errorlevel 1 start "Ollama" /MIN cmd /c "ollama serve" +) + +if not exist "node_modules\next\dist\bin\next" ( + echo App packages missing. Run setup.bat once. + pause + exit /b 1 +) +if not exist ".next\BUILD_ID" ( + echo Building dashboard... + call "%NODE_HOME%\npm.cmd" run build +) + +echo Starting Control Center +echo Leave this window open +echo http://127.0.0.1:3000 +echo. +start "" "http://127.0.0.1:3000" +"%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 +echo. +echo Server stopped. +pause From 90c511291ae20f293a482cc3730288469f337c01 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:31:52 -0230 Subject: [PATCH 05/12] Delete start.bat --- start.bat | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 start.bat diff --git a/start.bat b/start.bat deleted file mode 100644 index 795d8ed..0000000 --- a/start.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off -if not defined CC_KEEPOPEN ( - set "CC_KEEPOPEN=1" - title Control Center - cmd /k "%~f0" %* - exit /b -) -title Control Center -cd /d "F:\AI\apps\mattwolfe\control-center" -set "NODE_HOME=C:\Users\SODKGB\AppData\Local\ControlCenter-Runtime\node" -if not exist "%NODE_HOME%\node.exe" set "NODE_HOME=%ProgramFiles%\nodejs" -set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%" -echo Starting Control Center... -echo This window IS the server. Do not close it. -echo Dashboard: http://127.0.0.1:3000 -echo Leave the Ollama app running for local AI. -echo. -if exist "%LOCALAPPDATA%\Control Center\launcher.lock" del /f /q "%LOCALAPPDATA%\Control Center\launcher.lock" >nul 2>&1 -where ollama >nul 2>&1 -if not errorlevel 1 ( - curl.exe -s -m 2 http://127.0.0.1:11434/api/tags >nul 2>&1 - if errorlevel 1 start "Ollama Serve" /MIN cmd /c "ollama serve" -) -"%NODE_HOME%\node.exe" -v -"%NODE_HOME%\node.exe" "scripts\launch.mjs" -if errorlevel 1 "%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 -echo. -echo Control Center stopped. This window will stay open. -pause From 96743c224f025e51415e9b314133b39923c82e39 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:33:36 -0230 Subject: [PATCH 06/12] Rename start (1).bat to start.bat --- start.bat | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 start.bat diff --git a/start.bat b/start.bat new file mode 100644 index 0000000..c32a3dd --- /dev/null +++ b/start.bat @@ -0,0 +1,55 @@ +@echo off +setlocal EnableExtensions +title Control Center +cd /d "%~dp0" + +if not defined CC_KEEPOPEN ( + set "CC_KEEPOPEN=1" + cmd /k "%~f0" %* + exit /b +) + +set "NODE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" +if not exist "%NODE_HOME%\node.exe" set "NODE_HOME=%ProgramFiles%\nodejs" +set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\WindowsPowerShell\v1.0" +set "DATA_DIR=%LOCALAPPDATA%\Control Center" + +if not exist "%~dp0package.json" ( + echo Put start.bat in the control-center folder. + pause + exit /b 1 +) +if not exist "%NODE_HOME%\node.exe" ( + echo Node.js not found. Run setup.bat first. + pause + exit /b 1 +) + +if exist "%DATA_DIR%\launcher.lock" del /f /q "%DATA_DIR%\launcher.lock" >nul 2>&1 +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p);if(b[...] + +where ollama >nul 2>&1 +if not errorlevel 1 ( + curl.exe -s -m 2 http://127.0.0.1:11434/api/tags >nul 2>&1 + if errorlevel 1 start "Ollama" /MIN cmd /c "ollama serve" +) + +if not exist "node_modules\next\dist\bin\next" ( + echo App packages missing. Run setup.bat once. + pause + exit /b 1 +) +if not exist ".next\BUILD_ID" ( + echo Building dashboard... + call "%NODE_HOME%\npm.cmd" run build +) + +echo Starting Control Center +echo Leave this window open +echo http://127.0.0.1:3000 +echo. +start "" "http://127.0.0.1:3000" +"%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 +echo. +echo Server stopped. +pause From 3d3d09869b7582050b821695b4d27ff02f251100 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:34:08 -0230 Subject: [PATCH 07/12] Delete start (1).bat --- start (1).bat | 55 --------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 start (1).bat diff --git a/start (1).bat b/start (1).bat deleted file mode 100644 index f376303..0000000 --- a/start (1).bat +++ /dev/null @@ -1,55 +0,0 @@ -@echo off -setlocal EnableExtensions -title Control Center -cd /d "%~dp0" - -if not defined CC_KEEPOPEN ( - set "CC_KEEPOPEN=1" - cmd /k "%~f0" %* - exit /b -) - -set "NODE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" -if not exist "%NODE_HOME%\node.exe" set "NODE_HOME=%ProgramFiles%\nodejs" -set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\WindowsPowerShell\v1.0" -set "DATA_DIR=%LOCALAPPDATA%\Control Center" - -if not exist "%~dp0package.json" ( - echo Put start.bat in the control-center folder. - pause - exit /b 1 -) -if not exist "%NODE_HOME%\node.exe" ( - echo Node.js not found. Run setup.bat first. - pause - exit /b 1 -) - -if exist "%DATA_DIR%\launcher.lock" del /f /q "%DATA_DIR%\launcher.lock" >nul 2>&1 -"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p);if(b[0]===0xEF&&b[1]===0xBB&&b[2]===0xBF)fs.writeFileSync(p,b.subarray(3));" - -where ollama >nul 2>&1 -if not errorlevel 1 ( - curl.exe -s -m 2 http://127.0.0.1:11434/api/tags >nul 2>&1 - if errorlevel 1 start "Ollama" /MIN cmd /c "ollama serve" -) - -if not exist "node_modules\next\dist\bin\next" ( - echo App packages missing. Run setup.bat once. - pause - exit /b 1 -) -if not exist ".next\BUILD_ID" ( - echo Building dashboard... - call "%NODE_HOME%\npm.cmd" run build -) - -echo Starting Control Center -echo Leave this window open -echo http://127.0.0.1:3000 -echo. -start "" "http://127.0.0.1:3000" -"%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 -echo. -echo Server stopped. -pause From e787c821f10e049dad4478d0113fb9f3d4ab182e Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:35:57 -0230 Subject: [PATCH 08/12] Replace setup.bat with contents of setup (7).bat --- setup.bat | 89 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 69 insertions(+), 20 deletions(-) diff --git a/setup.bat b/setup.bat index 34e4430..9627fb9 100644 --- a/setup.bat +++ b/setup.bat @@ -45,9 +45,26 @@ echo Control Center setup echo Project: %INSTALL_DIR% echo. -if exist "%NODE_HOME%\node.exe" goto NODE_OK -if exist "%ProgramFiles%\nodejs\node.exe" set "NODE_HOME=%ProgramFiles%\nodejs" & goto NODE_OK +set "PORTABLE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" +set "NODE_HOME=%PORTABLE_HOME%" +if exist "%PORTABLE_HOME%\node.exe" ( + call :node_new_enough "%PORTABLE_HOME%" + if not errorlevel 1 goto NODE_OK + echo Portable Node is older than 24.19.0. Replacing it... +) + +if exist "%ProgramFiles%\nodejs\node.exe" ( + call :node_new_enough "%ProgramFiles%\nodejs" + if not errorlevel 1 ( + set "NODE_HOME=%ProgramFiles%\nodejs" + goto NODE_OK + ) + echo System Node is older than 24.19.0. Installing portable %NODE_VER%... +) + +rem Incompatible binary may live under Program Files. Always install into the portable folder. +set "NODE_HOME=%PORTABLE_HOME%" echo Downloading portable Node.js %NODE_VER%... set "ARCH=x64" if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64" @@ -91,42 +108,70 @@ if exist "%SCRIPT_DIR%\start.bat" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy if exist "%SCRIPT_DIR%\REQUIREMENTS.md" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy /y "%SCRIPT_DIR%\REQUIREMENTS.md" "%INSTALL_DIR%\REQUIREMENTS.md" >nul echo Source ready. -if exist "%LOCALAPPDATA%\Programs\Ollama\ollama.exe" set "PATH=%LOCALAPPDATA%\Programs\Ollama;%PATH%" +set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" +where ollama >nul 2>&1 +if errorlevel 1 ( + echo Installing Ollama... + where winget >nul 2>&1 + if not errorlevel 1 winget install --id Ollama.Ollama -e --accept-package-agreements --accept-source-agreements + set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" +) +where ollama >nul 2>&1 +if errorlevel 1 ( + echo Downloading OllamaSetup.exe... + curl.exe -L --fail -o "%TEMP%\OllamaSetup.exe" "https://ollama.com/download/OllamaSetup.exe" + if not errorlevel 1 "%TEMP%\OllamaSetup.exe" /VERYSILENT /NORESTART /SUPPRESSMSGBOXES + set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" +) where ollama >nul 2>&1 if errorlevel 1 ( - echo Ollama not found. Dashboard will still run. + echo Ollama could not be installed. Dashboard will still run. goto APP ) + curl.exe -s -m 2 "%OLLAMA_URL%/api/tags" >nul 2>&1 if errorlevel 1 start "Ollama" /MIN cmd /c "ollama serve" +timeout /t 3 /nobreak >nul + +set "RAM_GB=16" +set "PS=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" +if exist "%PS%" ( + for /f "delims=" %%M in ('"%PS%" -NoProfile -Command "[int]((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory/1GB)"') do set "RAM_GB=%%M" +) +set "RECOMMENDED=qwen2.5:7b" +if %RAM_GB% LSS 10 set "RECOMMENDED=gemma3:4b" +if %RAM_GB% GEQ 20 set "RECOMMENDED=qwen2.5:14b" +echo Detected about %RAM_GB% GB RAM +echo Recommended model: %RECOMMENDED% -set "MODEL=" if not "%PULL_MODEL%"=="" ( - echo Downloading requested model %PULL_MODEL%... - ollama pull %PULL_MODEL% set "MODEL=%PULL_MODEL%" ) else ( - echo Local Ollama models: - ollama list - for /f "skip=1 tokens=1" %%M in ('ollama ps 2^>nul') do if not defined MODEL set "MODEL=%%M" - if not defined MODEL for /f "skip=1 tokens=1" %%M in ('ollama list 2^>nul') do if not defined MODEL set "MODEL=%%M" + set "MODEL=%RECOMMENDED%" ) -if "%MODEL%"=="" ( - echo No local model selected. Nothing will be downloaded. - echo Optional later: ollama pull qwen2.5:7b - echo Or: setup.bat /model=qwen2.5:7b - goto APP +echo Local Ollama models: +ollama list +ollama list 2>nul | findstr /I /C:"%MODEL%" >nul +if errorlevel 1 ( + echo Downloading %MODEL% ... + ollama pull %MODEL% + if errorlevel 1 ( + echo Could not download %MODEL%. Dashboard will still run. + goto APP + ) +) else ( + echo %MODEL% is already installed. Skipping download. ) -echo Using existing model %MODEL% -curl.exe -s -m 60 "%OLLAMA_URL%/api/generate" -H "Content-Type: application/json" -d "{\"model\":\"%MODEL%\",\"prompt\":\"ok\",\"stream\":false,\"keep_alive\":-1}" >nul 2>&1 -"%NODE_HOME%\node.exe" -e "const fs=require('fs'),path=require('path');const p=path.join(process.env.LOCALAPPDATA,'Control Center','settings.json');let s={};try{s=JSON.parse(fs.readFileSync(p,'utf8').replace(/^\uFEFF/,''))}catch(e){} s.ai=s.ai||{};s.ai.provider='ollama';s.ai.model=process.env.MODEL;s.ai.localBaseUrls=Object.assign({lmstudio:'http://127.0.0.1:1234',ollama:'http://127.0.0.1:11434'},s.ai.localBaseUrls||{});fs.mkdirSync(path.dirname(p),{recursive:true});fs.writeFileSync(p,JSON.stringify(s,null,2)+'\n');" +echo Using model %MODEL% +curl.exe -s -m 180 "%OLLAMA_URL%/api/generate" -H "Content-Type: application/json" -d "{\"model\":\"%MODEL%\",\"prompt\":\"ok\",\"stream\":false,\"keep_alive\":-1}" >nul 2>&1 +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),path=require('path');const p=path.join(process.env.LOCALAPPDATA,'Control Center','settings.json');let s={};try{s=JSON.parse(fs.readFileSync(p,'utf8').[...] :APP cd /d "%INSTALL_DIR%" if exist "%DATA_DIR%\launcher.lock" del /f /q "%DATA_DIR%\launcher.lock" >nul 2>&1 -"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p);if(b[0]===0xEF&&b[1]===0xBB&&b[2]===0xBF)fs.writeFileSync(p,b.subarray(3));" +"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p)[...] echo Installing app packages... call "%NODE_HOME%\npm.cmd" run setup @@ -149,6 +194,10 @@ echo Server stopped. pause exit /b 0 +:node_new_enough +"%~1\node.exe" -e "const p=process.versions.node.split('.').map(Number);process.exit((p[0]>24||(p[0]===24&&p[1]>=19))?0:1)" +exit /b %ERRORLEVEL% + :FAIL echo. echo Setup could not finish. Check the message above. From 9e4032387ad23cf99e638ddc7dea30c12bcdd399 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:36:48 -0230 Subject: [PATCH 09/12] Delete setup (7).bat --- setup (7).bat | 205 -------------------------------------------------- 1 file changed, 205 deletions(-) delete mode 100644 setup (7).bat diff --git a/setup (7).bat b/setup (7).bat deleted file mode 100644 index a60d303..0000000 --- a/setup (7).bat +++ /dev/null @@ -1,205 +0,0 @@ -@echo off -setlocal EnableExtensions EnableDelayedExpansion -title Control Center -cd /d "%~dp0" - -if not defined CC_KEEPOPEN ( - set "CC_KEEPOPEN=1" - cmd /k "%~f0" %* - exit /b -) - -set "PULL_MODEL=" -for %%A in (%*) do ( - set "ARG=%%~A" - if /i "!ARG:~0,7!"=="/model=" set "PULL_MODEL=!ARG:~7!" -) - -set "REPO_URL=https://github.com/mreflow/control-center.git" -set "REPO_ZIP=https://github.com/mreflow/control-center/archive/refs/heads/main.zip" -set "NODE_VER=24.20.0" -set "NODE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" -set "DATA_DIR=%LOCALAPPDATA%\Control Center" -set "OLLAMA_URL=http://127.0.0.1:11434" -set "SCRIPT_DIR=%~dp0" -if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%" - -rem In-repo: setup.bat sits next to package.json. -rem Outside-repo: setup.bat sits beside a control-center folder. -if exist "%SCRIPT_DIR%\package.json" ( - findstr /C:"self-hosted-control-center" "%SCRIPT_DIR%\package.json" >nul 2>&1 - if not errorlevel 1 ( - set "INSTALL_DIR=%SCRIPT_DIR%" - goto HAVE_DIR - ) -) -if exist "%SCRIPT_DIR%\control-center\package.json" ( - set "INSTALL_DIR=%SCRIPT_DIR%\control-center" - goto HAVE_DIR -) -set "INSTALL_DIR=%SCRIPT_DIR%\control-center" - -:HAVE_DIR -echo. -echo Control Center setup -echo Project: %INSTALL_DIR% -echo. - -set "PORTABLE_HOME=%LOCALAPPDATA%\ControlCenter-Runtime\node" -set "NODE_HOME=%PORTABLE_HOME%" - -if exist "%PORTABLE_HOME%\node.exe" ( - call :node_new_enough "%PORTABLE_HOME%" - if not errorlevel 1 goto NODE_OK - echo Portable Node is older than 24.19.0. Replacing it... -) - -if exist "%ProgramFiles%\nodejs\node.exe" ( - call :node_new_enough "%ProgramFiles%\nodejs" - if not errorlevel 1 ( - set "NODE_HOME=%ProgramFiles%\nodejs" - goto NODE_OK - ) - echo System Node is older than 24.19.0. Installing portable %NODE_VER%... -) - -rem Incompatible binary may live under Program Files. Always install into the portable folder. -set "NODE_HOME=%PORTABLE_HOME%" -echo Downloading portable Node.js %NODE_VER%... -set "ARCH=x64" -if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64" -set "ZIP=%TEMP%\node-v%NODE_VER%-win-%ARCH%.zip" -if not exist "%ZIP%" curl.exe -L --fail -o "%ZIP%" "https://nodejs.org/dist/v%NODE_VER%/node-v%NODE_VER%-win-%ARCH%.zip" -if not exist "%ZIP%" goto FAIL -set "EXTRACT=%TEMP%\cc-node-unpack" -if exist "%EXTRACT%" rmdir /s /q "%EXTRACT%" -mkdir "%EXTRACT%" -tar.exe --force-local -xf "%ZIP%" -C "%EXTRACT%" 2>nul -if not exist "%EXTRACT%\node-v%NODE_VER%-win-%ARCH%\node.exe" ( - "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -Command "Expand-Archive -LiteralPath '%ZIP%' -DestinationPath '%EXTRACT%' -Force" -) -if not exist "%NODE_HOME%" mkdir "%NODE_HOME%" -robocopy "%EXTRACT%\node-v%NODE_VER%-win-%ARCH%" "%NODE_HOME%" /E /NFL /NDL /NJH /NJS /NP >nul -if not exist "%NODE_HOME%\node.exe" goto FAIL - -:NODE_OK -set "PATH=%NODE_HOME%;%LOCALAPPDATA%\Programs\Ollama;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\WindowsPowerShell\v1.0" -echo Node: -"%NODE_HOME%\node.exe" -v - -if exist "%INSTALL_DIR%\package.json" goto SOURCE_OK -echo Downloading Control Center... -if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%" -where git >nul 2>&1 -if not errorlevel 1 ( - git clone --depth 1 "%REPO_URL%" "%INSTALL_DIR%" - if not errorlevel 1 goto SOURCE_OK -) -set "APPZIP=%TEMP%\control-center-main.zip" -curl.exe -L --fail -o "%APPZIP%" "%REPO_ZIP%" -tar.exe --force-local -xf "%APPZIP%" -C "%TEMP%" 2>nul -if exist "%TEMP%\control-center-main\package.json" xcopy /e /i /y /q "%TEMP%\control-center-main\*" "%INSTALL_DIR%\" >nul -if not exist "%INSTALL_DIR%\package.json" goto FAIL - -:SOURCE_OK -if not exist "%DATA_DIR%" mkdir "%DATA_DIR%" -if exist "%INSTALL_DIR%\.env.example" if not exist "%INSTALL_DIR%\.env.local" copy /y "%INSTALL_DIR%\.env.example" "%INSTALL_DIR%\.env.local" >nul -if exist "%SCRIPT_DIR%\start.bat" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy /y "%SCRIPT_DIR%\start.bat" "%INSTALL_DIR%\start.bat" >nul -if exist "%SCRIPT_DIR%\REQUIREMENTS.md" if /i not "%SCRIPT_DIR%"=="%INSTALL_DIR%" copy /y "%SCRIPT_DIR%\REQUIREMENTS.md" "%INSTALL_DIR%\REQUIREMENTS.md" >nul -echo Source ready. - -set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" -where ollama >nul 2>&1 -if errorlevel 1 ( - echo Installing Ollama... - where winget >nul 2>&1 - if not errorlevel 1 winget install --id Ollama.Ollama -e --accept-package-agreements --accept-source-agreements - set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" -) -where ollama >nul 2>&1 -if errorlevel 1 ( - echo Downloading OllamaSetup.exe... - curl.exe -L --fail -o "%TEMP%\OllamaSetup.exe" "https://ollama.com/download/OllamaSetup.exe" - if not errorlevel 1 "%TEMP%\OllamaSetup.exe" /VERYSILENT /NORESTART /SUPPRESSMSGBOXES - set "PATH=%LOCALAPPDATA%\Programs\Ollama;%ProgramFiles%\Ollama;%PATH%" -) -where ollama >nul 2>&1 -if errorlevel 1 ( - echo Ollama could not be installed. Dashboard will still run. - goto APP -) - -curl.exe -s -m 2 "%OLLAMA_URL%/api/tags" >nul 2>&1 -if errorlevel 1 start "Ollama" /MIN cmd /c "ollama serve" -timeout /t 3 /nobreak >nul - -set "RAM_GB=16" -set "PS=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -if exist "%PS%" ( - for /f "delims=" %%M in ('"%PS%" -NoProfile -Command "[int]((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory/1GB)"') do set "RAM_GB=%%M" -) -set "RECOMMENDED=qwen2.5:7b" -if %RAM_GB% LSS 10 set "RECOMMENDED=gemma3:4b" -if %RAM_GB% GEQ 20 set "RECOMMENDED=qwen2.5:14b" -echo Detected about %RAM_GB% GB RAM -echo Recommended model: %RECOMMENDED% - -if not "%PULL_MODEL%"=="" ( - set "MODEL=%PULL_MODEL%" -) else ( - set "MODEL=%RECOMMENDED%" -) - -echo Local Ollama models: -ollama list -ollama list 2>nul | findstr /I /C:"%MODEL%" >nul -if errorlevel 1 ( - echo Downloading %MODEL% ... - ollama pull %MODEL% - if errorlevel 1 ( - echo Could not download %MODEL%. Dashboard will still run. - goto APP - ) -) else ( - echo %MODEL% is already installed. Skipping download. -) - -echo Using model %MODEL% -curl.exe -s -m 180 "%OLLAMA_URL%/api/generate" -H "Content-Type: application/json" -d "{\"model\":\"%MODEL%\",\"prompt\":\"ok\",\"stream\":false,\"keep_alive\":-1}" >nul 2>&1 -"%NODE_HOME%\node.exe" -e "const fs=require('fs'),path=require('path');const p=path.join(process.env.LOCALAPPDATA,'Control Center','settings.json');let s={};try{s=JSON.parse(fs.readFileSync(p,'utf8').replace(/^\uFEFF/,''))}catch(e){} s.ai=s.ai||{};s.ai.provider='ollama';s.ai.model=process.env.MODEL;s.ai.localBaseUrls=Object.assign({lmstudio:'http://127.0.0.1:1234',ollama:'http://127.0.0.1:11434'},s.ai.localBaseUrls||{});fs.mkdirSync(path.dirname(p),{recursive:true});fs.writeFileSync(p,JSON.stringify(s,null,2)+'\n');" - -:APP -cd /d "%INSTALL_DIR%" -if exist "%DATA_DIR%\launcher.lock" del /f /q "%DATA_DIR%\launcher.lock" >nul 2>&1 -"%NODE_HOME%\node.exe" -e "const fs=require('fs'),p=require('path').join(process.env.LOCALAPPDATA,'Control Center','settings.json');if(!fs.existsSync(p))process.exit(0);const b=fs.readFileSync(p);if(b[0]===0xEF&&b[1]===0xBB&&b[2]===0xBF)fs.writeFileSync(p,b.subarray(3));" - -echo Installing app packages... -call "%NODE_HOME%\npm.cmd" run setup -if errorlevel 1 call "%NODE_HOME%\npm.cmd" ci -if not exist "node_modules\next\dist\bin\next" goto FAIL -if not exist ".next\BUILD_ID" ( - echo Building dashboard... - call "%NODE_HOME%\npm.cmd" run build - if errorlevel 1 goto FAIL -) - -echo. -echo Starting server. Leave this window open. -echo Dashboard: http://127.0.0.1:3000 -echo. -start "" "http://127.0.0.1:3000" -"%NODE_HOME%\node.exe" "node_modules\next\dist\bin\next" start --hostname 127.0.0.1 --port 3000 -echo. -echo Server stopped. -pause -exit /b 0 - -:node_new_enough -"%~1\node.exe" -e "const p=process.versions.node.split('.').map(Number);process.exit((p[0]>24||(p[0]===24&&p[1]>=19))?0:1)" -exit /b %ERRORLEVEL% - -:FAIL -echo. -echo Setup could not finish. Check the message above. -pause -exit /b 1 From 8b4975e22faa9fe397e9b5799c7e5d23d13803d6 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:37:13 -0230 Subject: [PATCH 10/12] Delete REQUIREMENTS (1).md --- REQUIREMENTS (1).md | 66 --------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 REQUIREMENTS (1).md diff --git a/REQUIREMENTS (1).md b/REQUIREMENTS (1).md deleted file mode 100644 index c8173a6..0000000 --- a/REQUIREMENTS (1).md +++ /dev/null @@ -1,66 +0,0 @@ -# Control Center — Windows requirements - -App: https://github.com/mreflow/control-center - -These three files live in the repo root: - -- REQUIREMENTS.md -- setup.bat -- start.bat - -## Required - -- Windows 10 22H2 or Windows 11 -- Internet for the first install -- A desktop browser -- About 500 MB disk for the app -- 4 GB RAM free for the dashboard - -setup.bat installs Node.js 24.20 if it is missing. Git is optional. - -## Optional local AI (Ollama) - -setup.bat will: - -- Install Ollama if it is missing (winget, then OllamaSetup.exe) -- Read installed RAM -- Pick a default model: - - under 10 GB RAM: gemma3:4b - - 10-19 GB RAM: qwen2.5:7b - - 20 GB+ RAM: qwen2.5:14b -- Download that model if it is not already installed -- Point Settings at Ollama on http://127.0.0.1:11434 - -Override the model: - - setup.bat /model=qwen2.5:7b - -If the chosen model is already on disk, it is not downloaded again. -Keep the Ollama tray app running while you use the dashboard. -In the app: Settings -> AI curation -> Ollama -> Reload models. - -## Ports - -- http://127.0.0.1:3000 Control Center -- http://127.0.0.1:11434 Ollama - -## Folders - -- App: this repo folder -- Data: %LOCALAPPDATA%\Control Center -- Portable Node: %LOCALAPPDATA%\ControlCenter-Runtime\node - -## How to use - -From the repo root: - - setup.bat - -Later launches: - - start.bat - -Leave the Command Prompt open. That window is the server. -Open http://127.0.0.1:3000 if the browser does not open. - -Ctrl+C stops the server. From 52d8c4afd8ae90166322eb3028e13e1fda438a83 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:37:50 -0230 Subject: [PATCH 11/12] Delete REQUIREMENTS.md --- REQUIREMENTS.md | 182 ------------------------------------------------ 1 file changed, 182 deletions(-) delete mode 100644 REQUIREMENTS.md diff --git a/REQUIREMENTS.md b/REQUIREMENTS.md deleted file mode 100644 index 147837a..0000000 --- a/REQUIREMENTS.md +++ /dev/null @@ -1,182 +0,0 @@ -# Control Center — Requirements - -Local-first business dashboard from -https://github.com/mreflow/control-center - -This file lists what you need to install and run Control Center on Windows -with the included `setup.bat`. The official app does **not** ship its own -REQUIREMENTS.md; npm packages are locked in `package-lock.json`. - ---- - -## 1. Required - -| Item | Version / detail | Why | -|---|---|---| -| Windows | 10 22H2 or Windows 11 | `setup.bat`, portable Node, Ollama | -| Node.js | **24.19.0 or newer** | Official engine. `setup.bat` installs portable **24.20.0 LTS** if needed | -| npm | Comes with Node (project pins npm 11.x) | Installs app packages from `package-lock.json` | -| Modern desktop browser | Chrome, Edge, Firefox, Brave | UI is `http://127.0.0.1:3000` | -| Disk (app only) | ~500 MB | Repo + `node_modules` + Next.js build | -| RAM (app only) | 4 GB free | Dashboard, collectors, SQLite | - -Git is optional. If Git is installed, `setup.bat` clones the repo. If not, it downloads the GitHub ZIP instead. - -Admin rights are **not** required. Portable Node lands in: - -`%LOCALAPPDATA%\ControlCenter-Runtime\node` - ---- - -## 2. Network and ports - -| Port | Bind | Used by | -|---|---|---| -| **3000** | `127.0.0.1` only | Control Center | -| **11434** | `127.0.0.1` only | Ollama local AI | - -The app rejects non-loopback Host/Origin headers. Do not expose it on your LAN without your own auth proxy. - -First run needs internet for: - -- GitHub clone or ZIP -- `npm ci` (locked dependencies) -- Optional Node / Ollama / model downloads - -After that, the dashboard itself is local-first. Collectors still need internet to fetch public news, sites, and audience pages. - ---- - -## 3. Application packages (installed by `npm run launch`) - -From the official `package.json` (v0.3.1). You do not install these by hand. - -**Runtime** - -- next -- react -- react-dom -- lucide-react -- fast-xml-parser - -**Dev / build** - -- typescript -- tsx -- eslint -- eslint-config-next -- @types/node -- @types/react -- @types/react-dom - -`npm run launch` runs `npm ci` against `package-lock.json` when needed, then builds and starts the server. - ---- - -## 4. Optional — local AI (Ollama) - -No cloud key is required. Newsletter intelligence **does** need some model, local or cloud. - -| Item | Detail | -|---|---| -| Ollama | Windows app from https://ollama.com/download/windows or `winget install Ollama.Ollama` | -| API | `http://127.0.0.1:11434` (Control Center accepts loopback only) | -| Loaded model | Control Center lists **currently loaded** text models, not every model on disk | - -`setup.bat` picks a recommended model from RAM: - -| Installed RAM | Model | Download | Role | -|---|---|---|---| -| Under ~10 GB | `gemma3:4b` | ~3.3 GB | Fits smaller laptops | -| Typical PC (default) | `qwen2.5:7b` | ~4.7 GB | Summaries, ranking, newsletters | -| ~20 GB or more | `qwen2.5:14b` | ~9 GB | Higher quality, same tasks | - -Override with: - -```bat -setup.bat /model=qwen2.5:7b -setup.bat /skip-ollama -``` - -Keep the Ollama tray app running while the dashboard is open. After a reboot, start Ollama first or run `start.bat` (it will try to start `ollama serve`). - -In the app: **Settings → AI curation → Ollama · local → Reload models**. - ---- - -## 5. Optional — cloud AI keys - -Only needed if you do not use Ollama / LM Studio. Keys can go in Settings or in `.env.local`: - -``` -OPENAI_API_KEY= -ANTHROPIC_API_KEY= -GEMINI_API_KEY= -XAI_API_KEY= -``` - -A key does nothing until that provider is selected in Settings. Local Ollama does not use `OLLAMA_API_KEY` (that name is reserved for Ollama Cloud). - -LM Studio alternative endpoint: `http://127.0.0.1:1234`. - ---- - -## 6. Optional — Gmail newsletters - -- Google Cloud project -- Gmail API enabled -- OAuth client ID + secret (read-only) -- Any Gmail account - -Configured later under **Settings → Newsletters**. Not installed by `setup.bat`. - ---- - -## 7. Folders created by setup - -| Path | Contents | -|---|---| -| `F:\AI\apps\mattwolfe\control-center` | App source (or whatever folder you chose) | -| `%LOCALAPPDATA%\Control Center` | `settings.json`, SQLite, snapshots | -| `%LOCALAPPDATA%\ControlCenter-Runtime\node` | Portable Node 24.20 if winget was unavailable | -| `control-center\.env.local` | Copied from `.env.example` on first run | -| `control-center\start.bat` | Later launches | - -Optional override in `.env.local`: - -``` -CONTROL_CENTER_DATA_DIR= -``` - -Must be an absolute path if set. - ---- - -## 8. What `setup.bat` does automatically - -1. Finds or installs Node.js 24.19+ -2. `git clone` (or ZIP) of `mreflow/control-center` -3. Creates the data folder and `.env.local` -4. Installs Ollama, pulls the recommended model, keeps it loaded -5. Points Settings at Ollama -6. Runs `npm run launch` (install + build + server + browser) - -Useful commands after install, from the project folder: - -```bat -npm run launch -npm run launch -- --no-open -npm run launch -- --port=3001 -npm run doctor -npm run backup -``` - ---- - -## 9. Quick check that it is running - -- Command Prompt window titled **Control Center** is still open -- Browser opens `http://127.0.0.1:3000` -- Optional: `http://127.0.0.1:11434/api/tags` returns JSON if Ollama is up - -If the Command Prompt closes, the dashboard stops. Use `start.bat` to bring it back. From 0034fe92e17283f5e9578e1a3b3cddf1358b7c40 Mon Sep 17 00:00:00 2001 From: Kevin Brake Date: Thu, 27 Aug 2026 20:38:12 -0230 Subject: [PATCH 12/12] Add files via upload --- REQUIREMENTS (1).md | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 REQUIREMENTS (1).md diff --git a/REQUIREMENTS (1).md b/REQUIREMENTS (1).md new file mode 100644 index 0000000..c8173a6 --- /dev/null +++ b/REQUIREMENTS (1).md @@ -0,0 +1,66 @@ +# Control Center — Windows requirements + +App: https://github.com/mreflow/control-center + +These three files live in the repo root: + +- REQUIREMENTS.md +- setup.bat +- start.bat + +## Required + +- Windows 10 22H2 or Windows 11 +- Internet for the first install +- A desktop browser +- About 500 MB disk for the app +- 4 GB RAM free for the dashboard + +setup.bat installs Node.js 24.20 if it is missing. Git is optional. + +## Optional local AI (Ollama) + +setup.bat will: + +- Install Ollama if it is missing (winget, then OllamaSetup.exe) +- Read installed RAM +- Pick a default model: + - under 10 GB RAM: gemma3:4b + - 10-19 GB RAM: qwen2.5:7b + - 20 GB+ RAM: qwen2.5:14b +- Download that model if it is not already installed +- Point Settings at Ollama on http://127.0.0.1:11434 + +Override the model: + + setup.bat /model=qwen2.5:7b + +If the chosen model is already on disk, it is not downloaded again. +Keep the Ollama tray app running while you use the dashboard. +In the app: Settings -> AI curation -> Ollama -> Reload models. + +## Ports + +- http://127.0.0.1:3000 Control Center +- http://127.0.0.1:11434 Ollama + +## Folders + +- App: this repo folder +- Data: %LOCALAPPDATA%\Control Center +- Portable Node: %LOCALAPPDATA%\ControlCenter-Runtime\node + +## How to use + +From the repo root: + + setup.bat + +Later launches: + + start.bat + +Leave the Command Prompt open. That window is the server. +Open http://127.0.0.1:3000 if the browser does not open. + +Ctrl+C stops the server.