-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmermaidSyntax.txt
More file actions
96 lines (72 loc) · 3.18 KB
/
mermaidSyntax.txt
File metadata and controls
96 lines (72 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
```mermaid
sequenceDiagram
participant user
participant browser
participant server
user->>browser: Write note and click Save
Note right of browser: Browser captures the user input and prepares to send it to the server
browser->>server: POST https://studies.cs.helsinki.fi/exampleapp/new_note with note data
activate server
Note right of server: Server receives the new note data and saves it
server-->>browser: HTTP 302 Redirect to /notes
deactivate server
Note right of browser: Browser follows the redirect and reloads the notes page
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/notes
activate server
server-->>browser: HTML document
deactivate server
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/main.css
activate server
server-->>browser: the css file
deactivate server
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/main.js
activate server
server-->>browser: the JavaScript file
deactivate server
Note right of browser: The browser starts executing the JavaScript code that fetches the JSON from the server
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/data.json
activate server
server-->>browser: [{ "content": "HTML is easy", "date": "2023-1-1" }, { "content": "new note", "date": "2024-5-30" }, ... ]
deactivate server
Note right of browser: The browser executes the callback function that renders the notes
```
```mermaid
sequenceDiagram
participant user
participant browser
participant server
user->>browser: Navigate to https://studies.cs.helsinki.fi/exampleapp/spa
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/spa
activate server
server-->>browser: HTML document (SPA shell)
deactivate server
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/main.css
activate server
server-->>browser: the css file
deactivate server
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/spa.js
activate server
server-->>browser: the JavaScript file
deactivate server
Note right of browser: The browser starts executing the JavaScript code of the SPA
browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/data.json
activate server
server-->>browser: [{ "content": "HTML is easy", "date": "2023-1-1" }, ... ]
deactivate server
Note right of browser: The browser executes the callback function that renders the notes in the SPA
```
```mermaid
sequenceDiagram
participant user
participant browser
participant server
user->>browser: Write note and click Save
Note right of browser: Browser captures the user input and prepares to send it to the server
browser->>server: POST https://studies.cs.helsinki.fi/exampleapp/new_note_spa with note data
activate server
Note right of server: Server receives the new note data and saves it
server-->>browser: { "content": "new note", "date": "2024-5-30" }
deactivate server
Note right of browser: The browser updates the note list dynamically without reloading the page
browser->>browser: Render the new note in the list
```