You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9f8672e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: web/README.md
+43-3Lines changed: 43 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,22 @@ npm run dev
36
36
37
37
The application will be available at `http://localhost:3000`. API requests will be proxied to the backend at `http://localhost:8080`.
38
38
39
+
### Demo Mode
40
+
41
+
For development or demonstration purposes without a backend server, you can run the application in demo mode. This mode uses realistic mock data that simulates all backend functionality:
42
+
43
+
```bash
44
+
npm run dev:demo
45
+
```
46
+
47
+
In demo mode:
48
+
- No backend connection is required
49
+
- Realistic simulated data updates every 10 seconds
50
+
- Solar power, battery, grid, and device data reflect realistic daily patterns
51
+
- Electricity prices vary based on time of day
52
+
- MPC decisions are generated for the next 24 hours
53
+
- All UI components work exactly as they would with a real backend
54
+
39
55
## Production Build
40
56
41
57
Build the application for production:
@@ -46,6 +62,27 @@ npm run build
46
62
47
63
The built files will be in the `dist` directory, which the Go backend serves at the root path.
48
64
65
+
### Demo Build
66
+
67
+
Build a standalone demo version that doesn't require a backend:
68
+
69
+
```bash
70
+
npm run build:demo
71
+
```
72
+
73
+
The demo build will be in the `dist-demo` directory. You can preview it with:
74
+
75
+
```bash
76
+
npm run preview:demo
77
+
```
78
+
79
+
The demo build is useful for:
80
+
- Demonstrations and presentations
81
+
- UI/UX testing without backend setup
82
+
- Showcasing the application to stakeholders
83
+
- Development when backend is unavailable
84
+
- Static hosting scenarios
85
+
49
86
## Project Structure
50
87
51
88
```
@@ -115,10 +152,11 @@ The web application consumes the following API endpoints:
115
152
The Vite configuration includes:
116
153
117
154
- Development server on port 3000
118
-
- API proxy to backend on port 8080
119
-
- WebSocket proxy for real-time updates
120
-
- Production build output to `dist/`
155
+
- API proxy to backend on port 8080 (disabled in demo mode)
156
+
- WebSocket proxy for real-time updates (mock data in demo mode)
157
+
- Production build output to `dist/` (or `dist-demo/` for demo builds)
121
158
- Source maps enabled
159
+
- Conditional compilation for demo mode via `__DEMO_MODE__` flag
122
160
123
161
## Customization
124
162
@@ -211,6 +249,8 @@ Historical data can be visualized with charts showing:
211
249
- Enable React DevTools for component inspection
212
250
- Check console for WebSocket connection status
213
251
- Use network tab to debug API issues
252
+
- Use demo mode for frontend-only development
253
+
- Mock data generator can be customized in `src/utils/mockData.ts`
0 commit comments