File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Web UI
2
+
3
+ This contains the web UI for espMH. The UI is written with the following stack:
4
+
5
+ * Typescript
6
+ * React
7
+ * Tailwind
8
+ * Shadcn/ui
9
+ * esbuild
10
+
11
+ It compiles everything into C++ header files which are copied to ` dist ` and included as a part of the platformio build process.
12
+
13
+ ## Development
14
+
15
+ It _ should_ be enough to install node v20+ and run:
16
+
17
+ ``` bash
18
+ npm run watch
19
+ ```
20
+
21
+ This will continuously run the build as files change. When I develop, I typically also use the nodejs server:
22
+
23
+ ``` bash
24
+ PROXY_URL=http://hostname-of-your-hub node server.js
25
+ ```
26
+
27
+ I do this only to proxy API requests to an actual ESP8266 running on my local network.
28
+
29
+ ### API Client
30
+
31
+ The API client in ` web2/api ` is generated from the openapi spec using ` openapi-zod-client ` . Run it with this command:
32
+
33
+ ``` bash
34
+ openapi-zod-client ../docs/openapi.yaml -o ./api/api-zod.ts --with-description
35
+ ```
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const path = require('path');
4
4
5
5
const app = express ( ) ;
6
6
const PORT = 3000 ; // You can change this to any port you prefer
7
- const PROXY_URL = 'http://10.133.8.88' ; // Replace with your proxy URL
7
+ const PROXY_URL = process . env . PROXY_URL || 'http://10.133.8.88' ; // Replace with your proxy URL
8
8
9
9
const proxyMiddleware = createProxyMiddleware ( {
10
10
target : PROXY_URL ,
You can’t perform that action at this time.
0 commit comments