Skip to content

Commit b6c5e44

Browse files
docs: Add mermaid UML graph (#20)
1 parent 5db04be commit b6c5e44

File tree

1 file changed

+92
-1
lines changed

1 file changed

+92
-1
lines changed

README.md

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,96 @@ Create a `.config.json` file in the root directory with the following content:
4343
}
4444
```
4545

46+
### System Design
47+
48+
```mermaid
49+
---
50+
title: Smart Security System UML Diagram
51+
---
52+
53+
classDiagram
54+
55+
class IDetectorStrategy {
56+
<<interface>>
57+
+ detect_humans(ndarry) bool
58+
}
59+
60+
IDetectorStrategy <|-- EfficientDetStrategy
61+
IDetectorStrategy <|-- HOGDescriptorStrategy
62+
63+
class IEyeStrategy {
64+
<<interface>>
65+
+ set_detector(IDetectorStrategy): void
66+
+ get_detector() IDetectorStrategy
67+
+ get_frame() ndarray
68+
+ check_if_detected() bool
69+
- detect_humans() DetectorResults
70+
}
71+
72+
IEyeStrategy <|-- PiCameraStrategy
73+
IEyeStrategy <|-- USBCameraStrategy
74+
IEyeStrategy *-- IDetectorStrategy
75+
76+
class INotifierStrategy {
77+
<<interface>>
78+
- recievers
79+
+ add_receiver(NotifierReciever) void
80+
+ notify_all(String) void
81+
}
82+
83+
INotifierStrategy <|-- WhatsAppStrategy
84+
INotifierStrategy <|-- TelegramStrategy
85+
86+
class IWifiStrategy {
87+
<<interface>>
88+
- protectors
89+
+ add_protector(Protector) void
90+
+ remove_protector(Protector) void
91+
+ check_protectors() WiFiStrategyResult
92+
}
93+
94+
IWifiStrategy <|-- AdminPanelStrategy
95+
IWifiStrategy <|-- IpAddressStrategy
96+
IWifiStrategy <|-- MacAddressStrategy
97+
98+
99+
class ISubject {
100+
<<interface>>
101+
- observers: List[IObserver]
102+
- current_state: ObserverStates
103+
+ attach(IObserver) void
104+
+ detach(IObserver) void
105+
+ notify() void
106+
+ get_state() ObserverStates
107+
+ set_state(ObserverStates)
108+
+ get_default_state() ObserverStates
109+
+ run() void
110+
}
111+
112+
ISubject <|-- EyeSubject
113+
ISubject <|-- WifiSubject
114+
115+
EyeSubject *-- IEyeStrategy
116+
WifiSubject *-- IWifiStrategy
117+
118+
class IObserver {
119+
<<interface>>
120+
+ update(ISubject)
121+
}
122+
123+
class HSSObserver {
124+
+ wifi_state: ObserverStates
125+
+ eye_state: ObserverStates
126+
- notifier: INotifierStrategy
127+
+ update(ISubject) void
128+
+ set_notifier(INotifierStrategy) void
129+
}
130+
131+
IObserver <|-- HSSObserver
132+
HSSObserver *-- INotifierStrategy
133+
134+
ISubject "1" o--> "1..*" IObserver
135+
```
136+
46137
### Advice
47-
You can use service file provided to run the script with systemd. It would make it run on startup, and restart it if it crashes.
138+
You can use service file provided to run the script with systemd. It would make it run on startup, and restart it if it crashes.

0 commit comments

Comments
 (0)