# lewan24/nodexmesh architecture

> Architecture diagram of the GitHub repository lewan24/nodexmesh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lewan24/nodexmesh
- Repository: https://github.com/lewan24/nodexmesh

## Overview

NodexMesh is a self-hosted collaborative visual workspace for creating and sharing multi-board projects built from typed canvas blocks. The primary workflow is a user editing a board in the React canvas, saving project changes through the workspace adapter and API, and persisting them in PostgreSQL. The backend also provides authentication, project permissions, collaboration, public sharing, media storage, administration, and audit capabilities. The README documents the product-level links; sampled source confirms workspace recovery/sync, board mutation, database modeling, and audit behavior, but does not expose every route-to-service call.

Main entry points: [`Backend/src/NodexMeshApi/Data/AppDbContext.cs`](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Data/AppDbContext.cs) (EF data model), [`Backend/src/NodexMeshApi/Program.cs`](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Program.cs) (Minimal API), [`Frontend/src/features/board/pages/BoardPage.tsx`](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/board/pages/BoardPage.tsx) (Board editor), [`Frontend/src/features/projects/services/workspaceController.ts`](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/services/workspaceController.ts) (Workspace sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Workspace frontend"]
  node_app["React application<br/>[App.tsx]"]
  node_boardpage["Board editor<br/>[BoardPage.tsx]"]
  node_canvas["Canvas interaction<br/>[Canvas.tsx]"]
  node_blockrenderer["Typed blocks<br/>[BlockRenderer.tsx]"]
  node_projecthooks["Project workflow<br/>[useProjects.ts]"]
  node_workspace["Workspace sync"]
  node_recovery["Recovery drafts<br/>[recoveryDrafts.ts]"]
  node_httpworkspace["HTTP workspace adapter<br/>[httpWorkspace.ts]"]
  node_authui["Account and admin UI<br/>[LoginPage.tsx]"]
  node_libraryui["Media library UI<br/>[LibraryDialog.tsx]"]
end

subgraph group_backend["API and domain"]
  node_api["Minimal API<br/>[Program.cs]"]
  node_boardroutes["Board endpoints<br/>[BoardEndpoints.cs]"]
  node_mutations["Board mutations"]
  node_authroutes["Authentication endpoints<br/>[AuthEndpoints.cs]"]
end

subgraph group_persistence["Persistence and files"]
  node_library["Media storage<br/>[LibraryStorage.cs]"]
  node_dbcontext["EF data model<br/>[AppDbContext.cs]"]
end

subgraph group_collaboration["Sharing and collaboration"]
  node_sharing["Project sharing"]
  node_hub["Live collaboration"]
end

subgraph group_operations["Administration and audit"]
  node_audit["Audit capture and writing<br/>[AuditCapture.cs]"]
  node_auditmaintenance["Audit maintenance"]
  node_adminroutes["Administration endpoints<br/>[AdminEndpoints.cs]"]
end

node_user(("Workspace user"))
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_app
node_app -->|"opens editor"| node_boardpage
node_boardpage -->|"edits boards"| node_canvas
node_canvas -->|"renders items"| node_blockrenderer
node_boardpage -->|"manages projects"| node_projecthooks
node_projecthooks -->|"coordinates sync"| node_workspace
node_workspace -->|"stores drafts"| node_recovery
node_workspace -.->|"uses adapter"| node_httpworkspace
node_httpworkspace -->|"sends requests"| node_api
node_api -->|"routes board calls"| node_boardroutes
node_boardroutes -->|"applies mutations"| node_mutations
node_mutations -->|"reads and writes"| node_dbcontext
node_dbcontext -->|"persists data"| node_postgres
node_user -->|"manages account"| node_authui
node_authui -->|"authenticates"| node_authroutes
node_user -->|"manages media"| node_libraryui
node_libraryui -->|"uploads media"| node_library
node_user -->|"shares projects"| node_sharing
node_sharing -->|"stores share links"| node_dbcontext
node_user -->|"collaborates live"| node_hub
node_api -->|"exposes collaboration"| node_hub
node_api -->|"captures events"| node_audit
node_audit -->|"writes audit events"| node_dbcontext
node_auditmaintenance -->|"detects and retains"| node_dbcontext
node_user -->|"administers system"| node_adminroutes
node_adminroutes -.->|"manages records"| node_dbcontext

click node_app "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/app/App.tsx"
click node_boardpage "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/board/pages/BoardPage.tsx"
click node_canvas "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/canvas/components/Canvas.tsx"
click node_blockrenderer "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/blocks/BlockRenderer.tsx"
click node_projecthooks "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/hooks/useProjects.ts"
click node_workspace "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/services/workspaceController.ts"
click node_recovery "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/services/recoveryDrafts.ts"
click node_httpworkspace "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/services/httpWorkspace.ts"
click node_authui "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/auth/pages/LoginPage.tsx"
click node_libraryui "https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/library/LibraryDialog.tsx"
click node_api "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Program.cs"
click node_boardroutes "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Endpoints/BoardEndpoints.cs"
click node_mutations "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/BoardMutationService.cs"
click node_authroutes "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Endpoints/AuthEndpoints.cs"
click node_sharing "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/ShareLinkService.cs"
click node_hub "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/CollaborationHub.cs"
click node_library "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/LibraryStorage.cs"
click node_dbcontext "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Data/AppDbContext.cs"
click node_audit "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Auditing/AuditCapture.cs"
click node_auditmaintenance "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Auditing/AuditMaintenanceService.cs"
click node_adminroutes "https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Endpoints/AdminEndpoints.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_boardpage,node_canvas,node_blockrenderer,node_projecthooks,node_workspace,node_recovery,node_httpworkspace,node_authui,node_libraryui,node_user toneBlue
class node_api,node_boardroutes,node_mutations,node_authroutes,node_postgres toneAmber
class node_library,node_dbcontext toneMint
class node_sharing,node_hub toneRose
class node_audit,node_auditmaintenance,node_adminroutes toneIndigo
```

## Components

### Workspace frontend

- [React application](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/app/App.tsx): `Frontend/src/app/App.tsx`
- [Board editor](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/board/pages/BoardPage.tsx): `Frontend/src/features/board/pages/BoardPage.tsx`
- [Canvas interaction](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/canvas/components/Canvas.tsx): `Frontend/src/features/canvas/components/Canvas.tsx`
- [Typed blocks](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/blocks/BlockRenderer.tsx): `Frontend/src/features/blocks/BlockRenderer.tsx`
- [Project workflow](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/hooks/useProjects.ts): `Frontend/src/features/projects/hooks/useProjects.ts`
- [Workspace sync](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/services/workspaceController.ts): `Frontend/src/features/projects/services/workspaceController.ts`
- [Recovery drafts](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/services/recoveryDrafts.ts): `Frontend/src/features/projects/services/recoveryDrafts.ts`
- [HTTP workspace adapter](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/projects/services/httpWorkspace.ts): `Frontend/src/features/projects/services/httpWorkspace.ts`
- [Account and admin UI](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/auth/pages/LoginPage.tsx): `Frontend/src/features/auth/pages/LoginPage.tsx`
- [Media library UI](https://github.com/lewan24/nodexmesh/blob/main/Frontend/src/features/library/LibraryDialog.tsx): `Frontend/src/features/library/LibraryDialog.tsx`

### API and domain

- [Minimal API](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Program.cs): `Backend/src/NodexMeshApi/Program.cs`
- [Board endpoints](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Endpoints/BoardEndpoints.cs): `Backend/src/NodexMeshApi/Endpoints/BoardEndpoints.cs`
- [Board mutations](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/BoardMutationService.cs): `Backend/src/NodexMeshApi/Services/BoardMutationService.cs`
- [Authentication endpoints](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Endpoints/AuthEndpoints.cs): `Backend/src/NodexMeshApi/Endpoints/AuthEndpoints.cs`

### Persistence and files

- [Media storage](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/LibraryStorage.cs): `Backend/src/NodexMeshApi/Services/LibraryStorage.cs`
- [EF data model](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Data/AppDbContext.cs): `Backend/src/NodexMeshApi/Data/AppDbContext.cs`

### Sharing and collaboration

- [Project sharing](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/ShareLinkService.cs): `Backend/src/NodexMeshApi/Services/ShareLinkService.cs`
- [Live collaboration](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Services/CollaborationHub.cs): `Backend/src/NodexMeshApi/Services/CollaborationHub.cs`

### Administration and audit

- [Audit capture and writing](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Auditing/AuditCapture.cs): `Backend/src/NodexMeshApi/Auditing/AuditCapture.cs`
- [Audit maintenance](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Auditing/AuditMaintenanceService.cs): `Backend/src/NodexMeshApi/Auditing/AuditMaintenanceService.cs`
- [Administration endpoints](https://github.com/lewan24/nodexmesh/blob/main/Backend/src/NodexMeshApi/Endpoints/AdminEndpoints.cs): `Backend/src/NodexMeshApi/Endpoints/AdminEndpoints.cs`

### Other components

- **Workspace user**
- **PostgreSQL**

## Connections

- Workspace user → React application: uses (evidence: `README.md`)
- React application → Board editor: opens editor (evidence: `README.md`)
- Board editor → Canvas interaction: edits boards (evidence: `README.md`)
- Canvas interaction → Typed blocks: renders items (evidence: `README.md`)
- Board editor → Project workflow: manages projects (evidence: `README.md`)
- Project workflow → Workspace sync: coordinates sync (evidence: `Frontend/src/features/projects/hooks/useProjects.ts`)
- Workspace sync → Recovery drafts: stores drafts (evidence: `Frontend/src/features/projects/services/workspaceController.ts`)
- Workspace sync → HTTP workspace adapter: uses adapter
- HTTP workspace adapter → Minimal API: sends requests (evidence: `README.md`)
- Minimal API → Board endpoints: routes board calls (evidence: `README.md`)
- Board endpoints → Board mutations: applies mutations (evidence: `README.md`)
- Board mutations → EF data model: reads and writes (evidence: `Backend/src/NodexMeshApi/Services/BoardMutationService.cs`)
- EF data model → PostgreSQL: persists data (evidence: `README.md`)
- Workspace user → Account and admin UI: manages account (evidence: `README.md`)
- Account and admin UI → Authentication endpoints: authenticates (evidence: `README.md`)
- Workspace user → Media library UI: manages media (evidence: `README.md`)
- Media library UI → Media storage: uploads media (evidence: `README.md`)
- Workspace user → Project sharing: shares projects (evidence: `README.md`)
- Project sharing → EF data model: stores share links (evidence: `Backend/src/NodexMeshApi/Services/ShareLinkService.cs`)
- Workspace user → Live collaboration: collaborates live (evidence: `README.md`)
- Minimal API → Live collaboration: exposes collaboration (evidence: `README.md`)
- Minimal API → Audit capture and writing: captures events (evidence: `Backend/src/NodexMeshApi/Endpoints/AuthEndpoints.cs`)
- Audit capture and writing → EF data model: writes audit events (evidence: `Backend/src/NodexMeshApi/Auditing/AuditCapture.cs`)
- Audit maintenance → EF data model: detects and retains (evidence: `Backend/src/NodexMeshApi/Auditing/AuditMaintenanceService.cs`)
- Workspace user → Administration endpoints: administers system (evidence: `README.md`)
- Administration endpoints → EF data model: manages records
