Skip to content

Commit b42ca3a

Browse files
authored
Added the sequence diagram created by @ErezBinyamin
Added a sequence diagram that describes how LetMeIn works to README.md
1 parent c9e6e40 commit b42ca3a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,36 @@ LetMeIn2 is a completely new re-write of LetMeIn that focuses on scalability and
1717

1818
A user, let's say Alice, visits the website, she selects a floor. Her phone POSTs to the server specifying where she is. The server will send an MQTT message on the letmein2/req topic with Alice's location. This will cause all letmein devices on floor to light up and make noise, indicating Alice's location. There will also be a message with an action button sent in Slack, listening for any updates to the request. Alice's phone will redirect her to a waiting screen (/anybody_home) that does another POST request (could be a GET) that waits for the server to give her a 200 response. On the backend, two things could happen: One is that someone on floor could hit one of the buttons (or respond by pressing the button in Slack) and go get her. That causes another MQTT message on the letmein2/ack topic, which answer's Alice's phone with a 200 message, and she's notified that someone is coming for her. The other is that nobody is there to answer the box (or maybe they don't like Alice), and after a set amount of time, the server sends Alice's phone a 408 message, and will send out a timeout message on the letmein2/ack topic.
1919

20+
```mermaid
21+
sequenceDiagram
22+
actor Alice
23+
participant Phone
24+
participant Server
25+
participant MQTT as "MQTT Broker"
26+
participant Devices as "Letmein Devices"
27+
participant Slack
28+
29+
Alice ->> Phone: Visits website, selects floor
30+
Phone ->> Server: POST location (Alice's location)
31+
32+
Server ->> MQTT: Publish letmein2/req (Alice's location)
33+
MQTT ->> Devices: Light up & make noise
34+
MQTT ->> Slack: Send message + action button
35+
36+
Phone ->> Server: Redirect to /anybody_home (POST/GET)
37+
38+
alt Someone responds (floor device or Slack)
39+
Devices ->> Server: Button pressed
40+
Slack ->> Server: Action button clicked
41+
Server ->> MQTT: Publish letmein2/ack
42+
Server -->> Phone: 200 OK ("someone coming")
43+
else Timeout / no response
44+
Server -->> Phone: 408 Timeout
45+
Server ->> MQTT: Publish letmein2/ack (timeout)
46+
end
47+
```
48+
49+
2050
## Developing
2151

2252
### Terminology

0 commit comments

Comments
 (0)