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
In development environments, additional containers such as Mongo Express may be present for easier inspection of the database.
32
31
33
32
Each module is allocated its own container, which provides:
34
33
35
-
-Isolated environment for backend logic
36
-
-Data acquisition and monitoring for connected devices
37
-
-REST APIs and WebSocket endpoints for communication with the core
34
+
- Isolated environment for backend logic
35
+
- Data acquisition and monitoring for connected devices
36
+
- REST APIs and WebSocket endpoints for communication with the core
38
37
39
38
## Panel Communication
40
39
@@ -44,17 +43,17 @@ Panels communicate only with the BUG Core API. Workers within module containers
44
43
45
44
### Key Points
46
45
47
-
-Workers handle device communication asynchronously.
48
-
-The frontend interacts only with BUG Core, not module containers.
49
-
-Central Mongo databases are per-panel and facilitate sharing data between workers.
50
-
-NodeCache or other local caches can be used within containers for temporary data.
46
+
- Workers handle device communication asynchronously.
47
+
- The frontend interacts only with BUG Core, not module containers.
48
+
- Central Mongo databases are per-panel and facilitate sharing data between workers.
49
+
- NodeCache or other local caches can be used within containers for temporary data.
51
50
52
51
## Module Configuration
53
52
54
53
Panel configuration is persistent and stored in BUG Core. Module containers receive their configuration when started or updated.
55
54
56
-
-Each module should provide a base config page accessible at `/config`.
57
-
-Config forms should use the `PanelConfig` component to ensure consistent behavior:
55
+
- Each module should provide a base config page accessible at `/config`.
56
+
- Config forms should use the `PanelConfig` component to ensure consistent behavior:
58
57
59
58
```
60
59
@@ -63,19 +62,19 @@ Panel configuration is persistent and stored in BUG Core. Module containers rece
63
62
</PanelConfig>
64
63
```
65
64
66
-
-The API route `/api/panel/config/${panelId}` accepts a PUT request with a config object.
67
-
-Valid fields are merged with existing configuration; invalid fields are ignored.
68
-
-Field validation is the responsibility of the module developer.
65
+
- The API route `/api/panel/config/${panelId}` accepts a PUT request with a config object.
66
+
- Valid fields are merged with existing configuration; invalid fields are ignored.
67
+
- Field validation is the responsibility of the module developer.
69
68
70
69
Persistent configuration includes things like IP addresses, credentials, or default module options. Temporary runtime data should be stored in the module’s container database or cache.
71
70
72
71
## Module Memory is Volatile
73
72
74
73
Anything stored in a module’s container during runtime should not be considered permanent. Containers can be restarted, rebuilt, or removed at any time.
75
74
76
-
-Design modules to function correctly even if runtime data is lost.
77
-
-Persistent config should always be stored in BUG Core and passed to the module container.
78
-
-Use the panel-specific Mongo database for temporary or frequently-updated data.
75
+
- Design modules to function correctly even if runtime data is lost.
76
+
- Persistent config should always be stored in BUG Core and passed to the module container.
77
+
- Use the panel-specific Mongo database for temporary or frequently-updated data.
Copy file name to clipboardExpand all lines: docs/pages/development/index.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
---
2
-
layout: page
3
2
title: Development
4
3
nav_order: 4
5
4
has_children: true
@@ -34,7 +33,7 @@ Microsoft's [Visual Studio Code](https://code.visualstudio.com/) has been used f
34
33
35
34
## Troubleshooting
36
35
37
-
-The `-d` in the command `docker compose -d` deataches the process from the terminal running the container in the background.
38
-
-If you're getting Docker related 'permission denied' errors, make sure you've run the Docker [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) on Linux.
39
-
-If you're developing on a linux OS you may see errors on the main bug container logs regarding file write permission. This can be solved by giving the docker group read write permissions on the repository directory.
40
-
-If using a linux machine for development it's suggested that [docker engine](https://docs.docker.com/engine/install/ubuntu/) is used rather than docker desktop.
36
+
- The `-d` in the command `docker compose -d` deataches the process from the terminal running the container in the background.
37
+
- If you're getting Docker related 'permission denied' errors, make sure you've run the Docker [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) on Linux.
38
+
- If you're developing on a linux OS you may see errors on the main bug container logs regarding file write permission. This can be solved by giving the docker group read write permissions on the repository directory.
39
+
- If using a linux machine for development it's suggested that [docker engine](https://docs.docker.com/engine/install/ubuntu/) is used rather than docker desktop.
0 commit comments