docs: refine Web UI usage path
[e-mobility-charging-stations-simulator.git] / ui / web / README.md
CommitLineData
32de5a57
LM
1# Web UI
2
603f3fdd
JB
3The Web UI code and configuration is in the repository directory [ui/web](./ui/web). Commands execution is relative to that directory.
4
32de5a57
LM
5## Project setup
6
d6b76da3 7```shell
603f1011 8corepack enable
1a662d29 9corepack prepare pnpm@latest --activate
603f1011 10pnpm install
32de5a57
LM
11```
12
8228f972
JB
13The simulator UI server must be enabled, use WebSocket and disable authentication. The simulator main configuration file should have a `uiServer` section like this:
14
15```json
16 "uiServer": {
17 "enabled": true,
18 "type": "ws",
19 "authentication": {
20 "enabled": false,
21 "type": "basic-auth",
22 "username": "admin",
23 "password": "admin"
24 }
25 },
26```
27
15124b9a 28See [here](../../README.md#charging-stations-simulator-configuration) for more details.
8228f972 29
32de5a57
LM
30### Run
31
efdd1922 32#### Compiles and run for production
32de5a57 33
d6b76da3 34```shell
603f1011 35pnpm start
32de5a57
LM
36```
37
efdd1922 38#### Compiles and run for development
32de5a57 39
d6b76da3 40```shell
c7f157db 41pnpm serve
32de5a57 42```
bbe10d5f 43
d07e35d2
MK
44#### Try it out
45
46For both options above you can then follow the link displayed in the terminal at the end of compilation. The Web UI looks like the following
47
48![webui](./assets/webui.png)
49
501. With the top 2 buttons you can now stop and afterwards start the simulator and inspect the server console for the number of charging stations, e.g. with the default configuration: `Charging stations simulator ... started with 10 charging station(s)`
512. Each charging station is a row in the table below, try "Stop Charging Station" and refresh with the large blue button and see the status Started turns from Yes into No.
32de5a57
LM
52
53### Compiles and minifies for production
54
d6b76da3 55```shell
c7f157db 56pnpm build
32de5a57
LM
57```
58
59### Lints files
60
d6b76da3 61```shell
c7f157db 62pnpm lint
32de5a57 63```