Skip to content

Commit 75956e8

Browse files
committed
architecture diagrams for messaging system
1 parent 3a43ee7 commit 75956e8

10 files changed

Lines changed: 1557 additions & 2 deletions

File tree

docs/ops/doc-sync-workflow.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Use explicit prompts when needed:
4141

4242
Prompt override is temporary for that run; state should still be updated afterward.
4343

44+
## Static HTML mirrors (diagrams)
45+
46+
Some repositories ship interactive diagrams as HTML under `docs/diagrams/`. During maintenance for those repos, copy updated files into `static/repos/<repo-short-name>/diagrams/` (for example `static/repos/nxt-backend/diagrams/`) so Docusaurus can serve them. Embed from MDX with the `EmbeddedHtmlDiagram` component and a `path` relative to `static/` (for example `repos/nxt-backend/diagrams/foo.html`).
47+
4448
## Minimal required state fields
4549

4650
- `repo`

docs/ops/repo-doc-sync-state.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ nxt-backend:
1313
standard: monorepo
1414
doc_mode: maintenance
1515
status: standard-compliant
16-
last_synced_sha: b7ca5faa06752865172acb614b0839ed9ffd07af
17-
last_synced_at: 2026-05-06
16+
last_synced_sha: 68cc07cf6428256b68dcd153b38192f03adbd9c3
17+
last_synced_at: 2026-05-12
1818

1919
nxt-control-room:
2020
repo: nxtgrid/nxt-control-room

docs/repositories/nxt-backend.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Out of scope:
2222
- Frontend product UX orchestration and app-side routing.
2323
- Component-level endpoint payload definitions beyond source app docs and code contracts.
2424

25+
## Architecture diagrams
26+
27+
Interactive HTML diagrams (meter communications, device messaging, after-effects) are published on the dedicated [Architecture diagrams](./nxt-backend/diagrams) page. Source files live under `docs/diagrams` in the backend repository.
28+
2529
## Key components
2630

2731
- Apps:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Architecture diagrams
3+
---
4+
5+
import EmbeddedHtmlDiagram from '@site/src/components/EmbeddedHtmlDiagram';
6+
7+
# Architecture diagrams
8+
9+
These interactive diagrams are maintained in [`nxt-backend/docs/diagrams`](https://github.com/nxtgrid/nxt-backend/tree/main/docs/diagrams) and mirrored here as static assets so they render inside NXT Docs.
10+
11+
## Meter communications flow
12+
13+
End-to-end meter communication paths and integration touchpoints.
14+
15+
<EmbeddedHtmlDiagram
16+
title="Meter communications flow"
17+
path="repos/nxt-backend/diagrams/meter-communications-flow.html"
18+
height={700}
19+
/>
20+
21+
## Device message lifecycle
22+
23+
High-level flow for device-related messaging through the stack.
24+
25+
<EmbeddedHtmlDiagram
26+
title="Device message lifecycle"
27+
path="repos/nxt-backend/diagrams/device-message-lifecycle.html"
28+
height={700}
29+
/>
30+
31+
## After-effects cascade
32+
33+
How downstream actions and side effects chain after primary operations.
34+
35+
<EmbeddedHtmlDiagram
36+
title="After-effects cascade"
37+
path="repos/nxt-backend/diagrams/after-effects-cascade.html"
38+
height={700}
39+
/>

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const sidebars: SidebarsConfig = {
2626
'repositories/nxt-backend/yeti',
2727
'repositories/nxt-backend/shared-libs',
2828
'repositories/nxt-backend/data-layer',
29+
'repositories/nxt-backend/diagrams',
2930
],
3031
},
3132
'repositories/nxt-control-room',
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from 'react';
2+
import useBaseUrl from '@docusaurus/useBaseUrl';
3+
4+
export type EmbeddedHtmlDiagramProps = {
5+
title: string;
6+
/**
7+
* Path under `static/` (POSIX slashes). Example:
8+
* `repos/nxt-backend/diagrams/meter-communications-flow.html`
9+
*/
10+
path: string;
11+
/** Iframe height in CSS pixels. */
12+
height?: number;
13+
};
14+
15+
function normalizeStaticPath(path: string): string {
16+
const trimmed = path.trim();
17+
return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
18+
}
19+
20+
/**
21+
* Embeds mirrored HTML diagrams or similar full-page assets from `static/`.
22+
*/
23+
export default function EmbeddedHtmlDiagram({
24+
title,
25+
path,
26+
height = 720,
27+
}: EmbeddedHtmlDiagramProps): React.ReactNode {
28+
const url = useBaseUrl(normalizeStaticPath(path));
29+
30+
return (
31+
<figure className="embedded-html-diagram">
32+
<iframe
33+
title={title}
34+
src={url}
35+
width="100%"
36+
height={height}
37+
loading="lazy"
38+
/>
39+
<figcaption className="embedded-html-diagram__caption">
40+
<a href={url} target="_blank" rel="noopener noreferrer">
41+
Open diagram in new tab
42+
</a>
43+
</figcaption>
44+
</figure>
45+
);
46+
}

src/css/custom.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
}
1919

2020
/* For readability concerns, you should choose a lighter palette in dark mode. */
21+
.embedded-html-diagram iframe {
22+
border: 1px solid var(--ifm-color-emphasis-300);
23+
border-radius: var(--ifm-global-radius);
24+
display: block;
25+
}
26+
27+
.embedded-html-diagram__caption {
28+
margin-top: 0.5rem;
29+
font-size: var(--ifm-font-size-secondary);
30+
}
31+
2132
[data-theme='dark'] {
2233
--ifm-color-primary: #2ba0bd;
2334
--ifm-color-primary-dark: #278fad;

0 commit comments

Comments
 (0)