Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 2b72197

Browse files
committed
center align diagrams and add more examples.
1 parent 5f0d1db commit 2b72197

File tree

7 files changed

+75
-0
lines changed

7 files changed

+75
-0
lines changed

docs/messaging.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ A topic is a named resource where events can be published. They can be thought o
1414

1515
Topics are often the first choice for communication between services, since they offer stateless, scalable and highly decoupled communication.
1616

17+
### Architecture
18+
19+
```mermaid
20+
graph LR;
21+
classDef default line-height:1.2;
22+
classDef edgeLabel line-height:1.2;
23+
24+
A(Topic)-- on message -->B(Message Service);
25+
C(Publisher Service) -- publish message --> A;
26+
D(Publisher Batch Service) -- publish message --> A;
27+
```
28+
29+
`Services` can both publish and subscribe to topics. `Batch Services` may only publish messages.
30+
1731
### Subscriptions
1832

1933
A subscription is a binding between a topic and a service. You can think of it as a channel that notifies your services when something new arrives on the topic.

docs/schedules.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ The `schedule` resource lets you define named schedules, including their frequen
1010

1111
If you're looking for a way to perform once-off work at some point in the future, use [delayed messaging](./messaging#delayed-messaging) instead of schedules.
1212

13+
## Architecture
14+
15+
```mermaid
16+
graph LR;
17+
classDef default line-height:1.2;
18+
19+
A(Weekly Schedule)-->B(Service A);
20+
```
21+
22+
> Schedules can be used to trigger a single service at a set cadence
23+
1324
## Creating schedules
1425

1526
There are two ways to define schedules. Using `every` allows simple rate definitions to trigger the callback or `cron` can be used for more complex scenarios.

docs/secrets.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ Nitric Secrets simplifies the secure storage, updating, and retrieval of sensiti
88

99
Alternatively, you can choose to store these values as environment variables. Learn more about it [here](/reference/env).
1010

11+
### Architecture
12+
13+
```mermaid
14+
graph LR;
15+
classDef default line-height:1.2;
16+
classDef edgeLabel line-height:1.2;
17+
18+
B(Service)-- access/put secret -->A(Secret);
19+
C(Batch Service) -- access/put secret --> A;
20+
```
21+
22+
Both `Services` and `Batch Services` can access and put secrets values.
23+
1124
## Definitions
1225

1326
### Secrets

docs/storage.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ description: 'Working with files and storage in Nitric'
66

77
Nitric provides storage support for securely storing and retrieving large files in the cloud.
88

9+
## Architecture
10+
11+
```mermaid
12+
graph LR;
13+
classDef default line-height:1.2;
14+
classDef edgeLabel line-height:1.2;
15+
16+
A(Bucket)-- on write -->B(Bucket Handler Service);
17+
C(Bucket File Service) -- read/write/delete files --> A;
18+
D(Image Processing Batch Service) -- read/write/delete files --> A;
19+
```
20+
21+
A `Service` can both interact file files in a `Bucket` and receive notifications when files are written or deleted. A `Batch Service` can only interact with files on a bucket but cannot subscribe to file changes.
22+
923
## Definitions
1024

1125
### Files

docs/websockets.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ Nitric provides support for serverless websockets. This feature allows you to co
1212
https://github.com/nitrictech/nitric/issues
1313
</Note>
1414

15+
## Architecture
16+
17+
```mermaid
18+
graph LR;
19+
classDef default line-height:1.2;
20+
classDef edgeLabel line-height:1.2;
21+
22+
A(Websocket Gateway)-- on connect -->B(Connection Handler Service);
23+
A -- on disconnect --> B;
24+
A -- on message --> C(Message Handler Service);
25+
C -- send message --> A;
26+
D(Batch Service) -- send message --> A;
27+
```
28+
29+
A `Service` can both receive and send messages to a `Websocket`, `Batch Services` may only send message to a `Websocket`.
30+
1531
## Listening for events
1632

1733
There are three events that must be defined to deploy a valid websocket implementation. These are `connect`, `disconnect` and `message`.

src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Inter, Sora, JetBrains_Mono } from 'next/font/google'
33

44
import { Providers } from '@/app/providers'
55

6+
import '@/styles/mermaid.css'
67
import '@/styles/tailwind.css'
78
import clsx from 'clsx'
89
import Fathom from './Fathom'

src/styles/mermaid.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
svg[id^='mermaid-svg-'] {
2+
display: block;
3+
/* width: 100%; */
4+
margin: auto;
5+
/* padding: 0; */
6+
}

0 commit comments

Comments
 (0)