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

Commit d43ef99

Browse files
committed
wip: feedback
1 parent 3339705 commit d43ef99

File tree

1 file changed

+39
-10
lines changed

1 file changed

+39
-10
lines changed

docs/architecture/services.mdx

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,30 +81,52 @@ classDef edgeLabel line-height:2;
8181

8282
General-purpose workers that handle tasks like processing queues, topics, or schedules. Services abstract the runtime’s ability to route tasks and events to application-defined logic.
8383

84+
### API & Event-Driven Communication
85+
8486
```mermaid
8587
flowchart TD
8688
A[Service] -->|Manages API calls| B[APIs]
87-
A -->|Schedules tasks| C[Schedules]
88-
A -->|Handles key-value operations| D[KeyValue]
89-
A -->|Manages file storage| E[Storage]
9089
A -->|Queues messages| F[Queues]
9190
A -->|Broadcasts messages to subscribers| G[Topics]
92-
A -->|Manages secrets securely| H[Secrets]
93-
A -->|Interacts with relational databases| I[SQL Databases]
9491
A -->|Handles WebSocket connections| J[WebSockets]
9592
9693
B -->|Routes HTTP requests| K[Cloud API Gateway]
97-
C -->|Triggers periodic tasks| L[Cloud Scheduler]
98-
D -->|Stores/retrieves key-value pairs| M[Cloud KeyValue Store]
99-
E -->|Stores/retrieves files| N[Cloud Object Storage]
10094
F -->|Processes message queues| O[Cloud Queue Service]
10195
G -->|Distributes messages to subscribers| P[Cloud Pub/Sub]
96+
J -->|Facilitates real-time communication| S[WebSocket Gateway]
97+
98+
classDef default line-height:1;
99+
classDef edgeLabel line-height:2;
100+
```
101+
102+
### Data Storage & Management
103+
104+
```mermaid
105+
flowchart TD
106+
A[Service] -->|Handles key-value operations| D[KeyValue]
107+
A -->|Manages file storage| E[Storage]
108+
A -->|Manages secrets securely| H[Secrets]
109+
A -->|Interacts with relational databases| I[SQL Databases]
110+
111+
D -->|Stores/retrieves key-value pairs| M[Cloud KeyValue Store]
112+
E -->|Stores/retrieves files| N[Cloud Object Storage]
102113
H -->|Stores/retrieves secrets| Q[Cloud Secret Manager]
103114
I -->|Executes SQL queries| R[Relational Database]
104-
J -->|Facilitates real-time communication| S[WebSocket Gateway]
105115
106116
classDef default line-height:1;
107-
classDef edgeLabel line-height:2;
117+
classDef edgeLabel line-height:2;
118+
```
119+
120+
### Task Execution & Scheduling
121+
122+
```mermaid
123+
flowchart TD
124+
A[Service] -->|Schedules tasks| C[Schedules]
125+
126+
C -->|Triggers periodic tasks| L[Cloud Scheduler]
127+
128+
classDef default line-height:1;
129+
classDef edgeLabel line-height:2;
108130
```
109131

110132
## 3. Component
@@ -123,6 +145,9 @@ classDef edgeLabel line-height:2;
123145

124146
**Developers** write application code that implements handlers for the [api](/apis), [bucket](/buckets), [websocket](/websockets), [topic](/topics), [schedule](/schedule) resources. This code is written in files that matches the pattern(s) in the nitric.yaml file.
125147

148+
149+
### Nitric yaml - including service config
150+
126151
```json
127152
name: service-name
128153
services:
@@ -132,6 +157,8 @@ services:
132157
start: npm run dev:services $SERVICE_PATH
133158
```
134159

160+
### HTTP Route Handler
161+
135162
```typescript
136163
import { api } from '@nitric/sdk'
137164

@@ -144,6 +171,8 @@ customerRoute.get((ctx) => {
144171
})
145172
```
146173

174+
### Bucket On Read/Write/Delete Handler
175+
147176
```typescript
148177
import { bucket } from '@nitric/sdk'
149178

0 commit comments

Comments
 (0)