Skip to content

Commit cfc166e

Browse files
update: dashboard_setup.md
1 parent 03b2c36 commit cfc166e

1 file changed

Lines changed: 262 additions & 37 deletions

File tree

docs/setup/dashboard_setup.md

Lines changed: 262 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,319 @@
11
# SentraCore Dashboard Setup
22

3-
The SentraCore dashboard is a Flutter Windows desktop application that connects to the Python engine via WebSocket and REST API to display real-time system intelligence.
3+
The SentraCore dashboard is a Flutter desktop application that connects to the local Python engine through REST APIs and WebSockets to display real-time system intelligence, alerts, historical monitoring data, and diagnostic insights.
4+
5+
The dashboard supports:
6+
- Windows
7+
- Linux
8+
- macOS
9+
10+
Windows currently provides the most complete production packaging support.
11+
12+
---
13+
14+
# Prerequisites
15+
16+
## Flutter SDK
17+
18+
- Flutter SDK (stable channel, version 3.x or higher)
19+
20+
Verify installation:
21+
22+
```bash
23+
flutter doctor
24+
```
25+
26+
All desktop-related checks should pass before development begins.
427

528
---
629

7-
## Prerequisites
30+
# Platform Requirements
31+
32+
## Windows
833

9-
- Flutter SDK (stable channel, 3.x or higher)
10-
- Visual Studio 2022 Community or higher
11-
- **Required Workload:** Desktop development with C++
12-
- **Required Components:** MSVC v142 build tools, C++ CMake tools for Windows, Windows 10/11 SDK
34+
### Required Software
35+
- Visual Studio 2022 Community Edition or higher
36+
37+
### Required Workload
38+
- Desktop development with C++
39+
40+
### Required Components
41+
- MSVC build tools
42+
- C++ CMake tools for Windows
43+
- Windows 10/11 SDK
44+
45+
### Additional Requirement
1346
- Windows Developer Mode enabled
1447

15-
Run `flutter doctor` to verify your environment is fully configured. All items relevant to Windows desktop development should show a green checkmark.
48+
---
49+
50+
## Linux
51+
52+
Install required Flutter desktop dependencies.
53+
54+
Example (Ubuntu/Debian):
55+
56+
```bash
57+
sudo apt install clang cmake ninja-build pkg-config libgtk-3-dev
58+
```
1659

1760
---
1861

19-
## Enable Windows Developer Mode
62+
## macOS
63+
64+
### Required Software
65+
- Xcode Command Line Tools
66+
- CocoaPods
2067

21-
Flutter requires Windows Developer Mode to create symlinks during the build process.
68+
Install Xcode tools:
69+
70+
```bash
71+
xcode-select --install
72+
```
2273

23-
1. Open **Windows Settings**.
24-
2. Search for **Developer Mode**.
25-
3. Toggle **Developer Mode** to **On**.
74+
Install CocoaPods:
75+
76+
```bash
77+
sudo gem install cocoapods
78+
```
2679

2780
---
2881

29-
## Installation and Running
82+
# Enable Desktop Support
3083

31-
### 1. Install Flutter Dependencies
84+
If desktop support is not enabled in Flutter:
3285

33-
```powershell
86+
```bash
87+
flutter config --enable-windows-desktop
88+
flutter config --enable-linux-desktop
89+
flutter config --enable-macos-desktop
90+
```
91+
92+
Verify again:
93+
94+
```bash
95+
flutter doctor
96+
```
97+
98+
---
99+
100+
# Installation
101+
102+
Navigate to the dashboard directory:
103+
104+
```bash
34105
cd dashboard
106+
```
107+
108+
Install Flutter dependencies:
109+
110+
```bash
35111
flutter pub get
36112
```
37113

38-
### 2. Start the Python Engine First
114+
---
115+
116+
# Starting the Engine
117+
118+
The dashboard requires the SentraCore engine to be running before live data can be displayed.
119+
120+
From the repository root:
39121

40-
The dashboard requires the engine to be running before it can display data. In a separate terminal from the repository root:
122+
### Windows
41123

42124
```powershell
43125
.venv\Scripts\python -m engine.main
44126
```
45127

46-
### 3. Run the Dashboard in Debug Mode
128+
### Linux / macOS
129+
130+
```bash
131+
python -m engine.main
132+
```
133+
134+
---
135+
136+
# Running the Dashboard
137+
138+
## Windows
47139

48140
```powershell
49141
flutter run -d windows
50142
```
51143

52-
The dashboard will automatically connect to `ws://localhost:8740/ws/live` and begin displaying live system data.
144+
---
145+
146+
## Linux
147+
148+
```bash
149+
flutter run -d linux
150+
```
151+
152+
---
153+
154+
## macOS
155+
156+
```bash
157+
flutter run -d macos
158+
```
159+
160+
---
161+
162+
# Connection Behavior
163+
164+
The dashboard automatically:
165+
166+
- discovers the active engine runtime port
167+
- connects to the local WebSocket stream
168+
- retrieves REST API data
169+
- reconnects automatically if the engine restarts
170+
171+
Default engine endpoints:
172+
173+
```text
174+
REST API:
175+
http://localhost:8740/api/v1/
176+
177+
WebSocket:
178+
ws://localhost:8740/ws/live
179+
```
180+
181+
If port `8740` is unavailable, the engine dynamically selects another free port and exposes it through runtime discovery.
53182

54183
---
55184

56-
## Dashboard Panels
185+
# Dashboard Features
57186

58-
| Panel | Description |
187+
| Feature | Description |
59188
|---|---|
60-
| Stability Indicator | System Stability Index (1–100) with penalty breakdown |
61-
| Resource Gauges | Smoothed CPU, Memory, and Disk I/O values with spike indicators |
62-
| Prediction Panel | Degradation Risk Score and Time-to-Exhaustion countdowns |
63-
| Root Cause Analysis Panel | Primary bottleneck, suspect process, and trigger event from last alert |
64-
| Metric Charts | 60-second rolling history for CPU, Memory, and Stability Index |
65-
| Process Table | Top processes ranked by sustained system impact |
66-
| Event Timeline | Chronological list of recent system events |
189+
| System Stability Index | Unified system health scoring |
190+
| Resource Monitoring | CPU, memory, and disk pressure tracking |
191+
| Historical Logbook | Long-term system history visualization |
192+
| Predictive Analysis | Degradation risk and forecasting |
193+
| Root Cause Analysis | Correlated slowdown explanations |
194+
| Process Intelligence | Sustained process impact ranking |
195+
| Alerts & Diagnostics | Real-time alerts and RCA history |
196+
| Theme System | Light and dark mode support |
197+
| Responsive Layout | Adaptive desktop layout behavior |
67198

68199
---
69200

70-
## Verifying the Build
201+
# Development Validation
71202

72-
```powershell
203+
Run Flutter analysis and tests before submitting changes.
204+
205+
```bash
73206
flutter analyze
74207
flutter test
75208
```
76209

77-
Both should complete with no errors before any pull request is submitted.
78-
79210
---
80211

81-
## Building for Production
212+
# Building for Production
213+
214+
Generate a release build:
82215

83-
To compile a release build:
216+
## Windows
84217

85218
```powershell
86219
flutter build windows --release
87220
```
88221

89-
The executable and all required DLL files will be located in:
222+
---
223+
224+
## Linux
225+
226+
```bash
227+
flutter build linux --release
228+
```
229+
230+
---
231+
232+
## macOS
233+
234+
```bash
235+
flutter build macos --release
236+
```
237+
238+
---
239+
240+
# Build Output Locations
241+
242+
## Windows
243+
244+
```text
245+
build/windows/x64/runner/Release/
246+
```
247+
248+
---
249+
250+
## Linux
251+
252+
```text
253+
build/linux/x64/release/bundle/
254+
```
255+
256+
---
257+
258+
## macOS
259+
260+
```text
261+
build/macos/Build/Products/Release/
90262
```
91-
dashboard\build\windows\x64\runner\Release\
263+
264+
---
265+
266+
# Packaging Notes
267+
268+
For Windows installer packaging, the full release output directory must be included during Inno Setup compilation.
269+
270+
See:
271+
272+
```text
273+
docs/architecture/building.md
92274
```
93275

94-
This entire folder must be provided to Inno Setup when compiling the installer. See [Building SentraCore](../architecture/building.md) for the full packaging guide.
276+
for complete packaging and distribution instructions.
277+
278+
---
279+
280+
# Troubleshooting
281+
282+
## Dashboard Cannot Connect
283+
284+
Verify:
285+
- the engine is running
286+
- firewall rules are not blocking local connections
287+
- engine and dashboard versions are compatible
288+
289+
---
290+
291+
## Flutter Build Fails
292+
293+
Run:
294+
295+
```bash
296+
flutter doctor
297+
```
298+
299+
and resolve any missing dependencies or SDK issues.
300+
301+
---
302+
303+
## Missing Desktop Targets
304+
305+
Enable desktop support using:
306+
307+
```bash
308+
flutter config --enable-windows-desktop
309+
flutter config --enable-linux-desktop
310+
flutter config --enable-macos-desktop
311+
```
312+
313+
---
314+
315+
# Notes
316+
317+
- The dashboard is designed to operate independently from the engine process lifecycle.
318+
- Automatic reconnection and runtime discovery are built into the connection layer.
319+
- Some telemetry behavior may vary slightly across operating systems depending on available system APIs.

0 commit comments

Comments
 (0)