Skip to content

docs: redraw internal network connections diagram in Mermaid - #25983

Merged
antobinary merged 4 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:docs/internal-connections-mermaid
Oct 15, 2026
Merged

antobinary merged 4 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:docs/internal-connections-mermaid

Conversation

@antobinary

@antobinary antobinary commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Replaces the outdated 22-connections.png in the Internal network connections section of the architecture page (docs/development/architecture.md) with a Mermaid flowchart. The diagram now lives as text next to the prose, so it can be updated in the same PR as the code it describes.

The diagram started from a hand-drawn redesign. Every box and edge was then checked against the v4.0.x-develop code and packaging, plus the pinned bbb-webrtc-sfu v2.25.0-beta.2 and bbb-webrtc-recorder v0.14.0, and corrected where it didn't match. The first commit is the transcription and the second is the corrections, so they can be reviewed separately.

It also adds @mermaid-js/layout-elk to the docs dependencies. Docusaurus' theme-mermaid enables the ELK layout automatically when that package is installed. Without it, Mermaid falls back to its default dagre layout, which routes several edges through unrelated boxes.

static/img/22-connections.png is not deleted, because the 3.0 docs still reference it.

Screenshots

Rendered by the built 4.0 docs site (docusaurus build + serve):

Light mode

Internal network connections, light mode

Dark mode

Internal network connections, dark mode

Corrections made to the original drawing

  • graphql-actions was labelled "publishes to Redis" but had no edge to Redis. The edge is added.
  • Mutations were drawn as Hasura -> graphql-actions. In 4.0, graphql-middleware posts them to graphql-actions directly over HTTP; the Hasura fallback is disabled in bbb-graphql-middleware/internal/gql_actions/client.go.
  • The filesystem box said "shared by six processes" and listed /var/mediasoup. Nothing writes /var/mediasoup with the packaged recordingAdapter: bbb-webrtc-recorder, so that path is dropped. The diagram now shows which component writes each directory.
  • bbb-record-core: the inotify watch is on bbb-web's .done marker file, and the recording events and the resque queue come from Redis. WebRTC media is remuxed with ffmpeg, not rsynced, before the originals are deleted.
  • The single arrow sfu -> livekit "API · webhook :3040" is split into two: sfu -> LiveKit server API on :7880, and LiveKit -> sfu webhooks on :3040.
  • bbb-webrtc-sfu starts and stops bbb-webrtc-recorder via Redis; that edge was missing.
  • Dial-in now follows the real path: phone/SIP trunk -> FreeSWITCH (:5060, prompts for the PIN) -> livekit-sip (:5062) -> livekit-server.
  • FreeSWITCH, bbb-fsesl-akka and mediasoup are installed on every server, so the legend "dashed = only with FreeSWITCH audio" is now "dashed = alternative or opt-in path". mediasoup is drawn, matching the high-level diagram at the top of the page.
  • Smaller fixes:
    • HAProxy terminates TLS on :443 and forwards to nginx.
    • graphql-middleware reaches Hasura through nginx on 127.0.0.1:8185, not directly.
    • Hasura calls bbb-apps-akka's /userInfo auth hook; that edge was missing.
    • The notes route is /hocuspocus/collaboration.
    • shared-notes-server uses the blocknote_app database.
    • bbb-apps-akka is a single Pekko process, not a cluster singleton.
  • The Redis links from bbb-web, graphql-middleware, bbb-webrtc-sfu and shared-notes-server are listed in the text under the diagram rather than drawn, to keep it readable.

TODO

  • Add @mermaid-js/layout-elk to develop's docs/package.json as well. The deploy workflow runs npm ci on develop and only copies the markdown in from the release branches, so until then docs.bigbluebutton.org will render this diagram with the fallback dagre layout.
  • docs/development/recording.md ("Captured files") lists audio only under /var/freeswitch/meetings. With LiveKit audio, the 4.0 default, it lands in /var/lib/bbb-webrtc-recorder/audio.
  • The high-level diagram at the top of the same page routes the client and graphql-middleware through HAProxy. HAProxy only forwards TCP to nginx, and nginx does the routing.

How was this tested?

  • npm ci + npx docusaurus build in docs/: PASS
  • NODE_ENV=production npx docusaurus serve, then loaded /development/architecture/ in Playwright (light and dark mode): PASS. All 21 nodes and 33 edges render, ELK is in the bundle, and the console has no "layout algorithm not registered" fallback warning.
  • The existing high-level Mermaid diagram at the top of the page still renders: PASS

Replace the outdated 22-connections.png in the "Internal network
connections" section of the architecture page with a Mermaid flowchart,
so the diagram lives as text next to the prose and can be updated in
the same PR as the code it describes.

Add @mermaid-js/layout-elk to the docs dependencies. Docusaurus'
theme-mermaid enables the ELK layout automatically when the package is
installed; without it the diagram falls back to the default dagre
layout, which routes several edges through unrelated boxes.

22-connections.png stays in static/img because older doc versions
still reference it.
@antobinary antobinary added this to the Release 4.0 milestone Oct 7, 2026
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a6dc036-50bb-47f9-8995-0719cde15d45
📥 Commits

Reviewing files that changed from the base of the PR and between 36113b6 and 12c8fb8.

⛔ Files ignored due to path filters (1)
  • docs/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • docs/docs/development/architecture.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/docs/development/architecture.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The development architecture page updates its service-connection diagrams and adds a Mermaid diagram of socket flows on one Ubuntu host. It documents browser routes, GraphQL and meeting-state traffic, Redis connections, media paths, and recording data flow. The documentation package adds @mermaid-js/layout-elk.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: prlanzarin

Merge Risk: ⚪ Minimal · up to 12c8f

No actionable issue remains in the documented diagrams or docs installation path; the change is ready for normal merge checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the Mermaid diagram replacement, dependency update, validation steps, and related documentation changes.
Title check ✅ Passed The title clearly and concisely identifies the main change: redrawing the internal network connections diagram in Mermaid.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antobinary

Copy link
Copy Markdown
Member Author

With these updates the High-level architecture looks cooler too:

image

Check every box and edge of the transcribed diagram against the
v4.0.x-develop code and packaging, and fix what did not match:

- Mutations go from graphql-middleware to graphql-actions over HTTP,
  not from Hasura; graphql-actions then publishes to Redis.
- graphql-middleware reaches Hasura through the nginx load balancer
  on 127.0.0.1:8185; Hasura calls bbb-apps-akka's /userInfo auth hook.
- LiveKit webhooks flow from livekit-server to bbb-webrtc-sfu on :3040;
  the sfu calls the LiveKit server API on :7880.
- bbb-webrtc-sfu starts and stops bbb-webrtc-recorder via Redis.
- Dial-in reaches livekit-sip through FreeSWITCH, which answers the
  call and prompts for the PIN.
- FreeSWITCH, bbb-fsesl-akka and mediasoup are installed on every
  server; dashed now means "alternative or opt-in path". mediasoup is
  drawn, matching the high-level diagram at the top of the page.
- Drop /var/mediasoup from the recording sources (nothing writes it
  with the packaged recordingAdapter) and the "six processes" count;
  draw which component writes each directory instead.
- bbb-record-core watches the .done marker via inotify, reads events
  and its resque queue from Redis, and remuxes rather than rsyncs the
  WebRTC media before deleting the originals.
- HAProxy terminates TLS on :443 and forwards to nginx; the notes
  route is /hocuspocus/collaboration; shared-notes-server uses the
  blocknote_app database.

Lay the diagram out top-to-bottom so it fits the docs column, and
mention the Redis pub/sub links that are left out for readability.

@prlanzarin prlanzarin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Network diagram:

  • Missing link between bbb-wertc-recorder and mediasoup (WebRTC/UDP)
  • Missing link between bbb-webrtc-sfu and FreeSWITCH (SIP/5066, ESL/8021)
  • Missing link between graphql-middleware and bbb-web (HTTP, 8090, checkGraphqlAuth)
  • Missing link between graphql-middleware and akka-apps (HTTP, /userInfo, 8091)
  • Missing link between LiveKit (server and sip) and Redis (see nitpick below as well)
  • bbb-export-annotations is missing
  • AFAIK there's a hasura_app DB in Postgres as well. I might be misremembering this, so double check
  • Nitpick: either have everything tied to Redis be represented on the diagram, or nothing (all as a side note). Currently, there's a mix (actions, akka-apps, akka-fsesl in diagram, rest as a side note), which is confusing. I personally liked the previous' diagram representation of the bus, but I recognize how difficult it is to orchestrate this... assortment of components into a Mermaid diagram.

Arch diagram

  • Missing link between bbb-wertc-recorder and mediasoup
  • Missing link between FS and livekit-sip
  • Missing link between bbb-webrtc-sfu and FreeSWITCH
  • Missing link between gql-middleware and akka-apps/bbb-web
    (direct connections that go outside of Redis establish a hard coupling, so might as well be represented)
  • Missing link between livekit-server and Redis
  • Missing link between livekit-sip and Redis

Address the review on bigbluebutton#25983. Every link was checked against
v4.0.x-develop, bbb-webrtc-sfu v2.25.0-beta.2 and bbb-webrtc-recorder
v0.14.0.

Internal network connections:

- graphql-middleware calls bbb-web's checkGraphqlAuthorization on
  :8090 and bbb-apps-akka's /userInfo on :8901 for session variables
  (bbb-graphql-middleware/config/config.yml).
- bbb-webrtc-sfu reaches FreeSWITCH over SIP on ws :5066 and ESL on
  :8021 (freeswitch.port / esl_port in the sfu config).
- With the mediasoup bridge, mediasoup sends the recorded streams to
  bbb-webrtc-recorder over WebRTC; the packaging sets recordingAdapter
  to bbb-webrtc-recorder.
- livekit-server and livekit-sip both use Redis, which carries the
  psrpc bus between them (livekit.yaml, livekit-sip.yaml).
- Add bbb-export-annotations, which is part of the bigbluebutton meta
  package: it pops export jobs and annotations from Redis, publishes
  status back, and uploads the PDF to bbb-web.
- Hasura keeps its metadata in the hasura_app database
  (HASURA_GRAPHQL_DATABASE_URL), so list it on the PostgreSQL box.
- Draw every Redis link instead of a mix of drawn links and a side
  note, purple so they read as one bus. sfu and recorder now meet
  through Redis, which is how they talk. The note under the diagram now
  covers only the opt-in packages (bbb-webhooks,
  bbb-transcription-controller) that also use Redis.
- Invisible links from HAProxy keep graphql-middleware, bbb-web and
  shared-notes-server in the upper rows. Without them the new Redis
  edges pull those services toward the bottom and leave the top-left
  of the diagram empty.

High-level architecture: add graphql-middleware to akka-apps and Web
API, LiveKit server and LiveKit SIP to Redis, and the dashed
bbb-webrtc-sfu to FreeSWITCH, webrtc-recorder to mediasoup and
FreeSWITCH to LiveKit SIP links.
@Tainan404
Tainan404 requested a review from prlanzarin October 9, 2026 14:52
@antobinary antobinary mentioned this pull request Oct 15, 2026
26 of 39 tasks
@antobinary
antobinary merged commit a7382c7 into bigbluebutton:v4.0.x-develop Oct 15, 2026
6 checks passed
@antobinary
antobinary deleted the docs/internal-connections-mermaid branch October 15, 2026 01:03
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Oct 15, 2026
v4.0.x-develop's docs/ still declared Docusaurus ^3.3.2 with
docusaurus-search-local 0.40.1 and no overrides; npm audit reported 67
advisories (19 critical) against its lockfile. Take develop's
docs/package.json, package-lock.json and .nvmrc as they are today, which
carries these develop commits:

- 473ea74 docs: bump docusaurus to 3.10.1
- 5b52345 docs: pin serialize-javascript to ^7.0.5 to clear
  high-severity advisories
- 19d4592 docs: build with Node.js 24 (bigbluebutton#25982) - .nvmrc, engines
  node >=24 and the README note
- 218663a docs: update Docusaurus to 3.10.2
- 45bf274 resolve npm audit warnings in docs (mermaid override)

The files are copied rather than cherry-picked because the lockfile has
diverged here (dependabot bumps); develop's lockfile is consistent with
its package.json. @mermaid-js/layout-elk ^0.1.9 from bigbluebutton#25983 (not on
develop) is kept and resolved on top of develop's lockfile, which adds
only layout-elk 0.1.9 and elkjs 0.9.3. search-local 0.52 needs the Worker fix from the
previous commit.

develop's lockfile itself has new advisories since 2026-10-06 (48 left,
17 critical); the next commit deals with those.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants