# kristian-onyango/nexus_fabric architecture

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

- Interactive diagram: https://gitdiagram.com/kristian-onyango/nexus_fabric
- Repository: https://github.com/kristian-onyango/nexus_fabric

## Overview

NexusFabric is a local-first mesh networking system: a node starts the integrated runtime, discovers peers, updates its network view, and can route messages over the mesh; when mesh resolution is unavailable, an Internet egress gateway provides a fallback. The repository also contains Kademlia lookup/RPC, role-based routing, service registration, and versioned storage. The README is empty, so capability descriptions rely on source comments and excerpts; connections to unsampled subsystems are omitted where their call paths are not shown.

Main entry points: [`NexusFabric/innercore-network /integration/integration.go`](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/integration/integration.go) (System Integrator), [`NexusFabric/innercore-network /message/message.go`](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/message/message.go) (Message Transport), [`NexusFabric/innercore-network /network/network.go`](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/network/network.go) (Peer Network Table), [`NexusFabric/innercore-network /resolver/role-routing.go`](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/resolver/role-routing.go) (Role Routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Integration"]
  node_main["Program Entry<br/>[main.go]"]
  node_integration["System Integrator<br/>[integration.go]"]
  node_all_runtime["Consolidated Runtime<br/>[all.go]"]
end

subgraph group_peer["Peer Networking"]
  node_discovery["Peer Discovery<br/>[discovery.go]"]
  node_network_table[("Peer Network Table<br/>[network.go]")]
  node_gateway["Internet Egress"]
end

subgraph group_routing["Routing And Messaging"]
  node_message["Message Transport<br/>[message.go]"]
  node_innercore["Kademlia Overlay<br/>[innercore.go]"]
  node_rpc["Kademlia RPC<br/>[rpc.go]"]
  node_lookup["Iterative Lookup<br/>[lookup.go]"]
  node_kbucket["Routing Buckets<br/>[kbucket.go]"]
  node_role_routing["Role Routing<br/>[role-routing.go]"]
end

subgraph group_services["Services And Storage"]
  node_resolver["Service Resolver<br/>[resolver.go]"]
  node_service_registry[("Service Registry<br/>[service.go]")]
  node_storage_engine[("Versioned Storage<br/>[storage_engine.go]")]
end

node_operator(("Node Operator"))
node_internet(("Public Internet"))

node_operator -->|"starts"| node_main
node_main -->|"initializes"| node_integration
node_integration -->|"initializes"| node_discovery
node_integration -->|"configures"| node_innercore
node_integration -->|"registers handler"| node_message
node_integration -->|"updates peers"| node_network_table
node_integration -->|"starts"| node_gateway
node_discovery -->|"invokes callback"| node_integration
node_message -->|"records success"| node_network_table
node_role_routing -->|"reads peers"| node_network_table
node_role_routing -->|"sends messages"| node_message
node_service_registry -->|"checks peer"| node_network_table
node_rpc -.->|"sends packets"| node_message
node_gateway -->|"forwards traffic"| node_internet

click node_main "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/main/main.go"
click node_integration "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/integration/integration.go"
click node_all_runtime "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/all.go"
click node_discovery "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/discovery/discovery.go"
click node_network_table "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/network/network.go"
click node_message "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/message/message.go"
click node_innercore "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/innercore.go"
click node_rpc "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/rpc.go"
click node_lookup "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/lookup.go"
click node_kbucket "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/kbucket.go"
click node_role_routing "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/resolver/role-routing.go"
click node_resolver "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/resolver/resolver.go"
click node_service_registry "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/service/service.go"
click node_storage_engine "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/storage/storage_engine.go"
click node_gateway "https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/fallback/internet_fallback_egress.go"

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_main,node_integration,node_all_runtime toneBlue
class node_discovery,node_network_table,node_gateway toneAmber
class node_message,node_innercore,node_rpc,node_lookup,node_kbucket,node_role_routing toneMint
class node_resolver,node_service_registry,node_storage_engine toneRose
class node_operator,node_internet toneIndigo
```

## Components

### Runtime Integration

- [Program Entry](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/main/main.go): `NexusFabric/innercore-network /main/main.go`
- [System Integrator](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/integration/integration.go): `NexusFabric/innercore-network /integration/integration.go`
- [Consolidated Runtime](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/all.go): `NexusFabric/all.go`

### Peer Networking

- [Peer Discovery](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/discovery/discovery.go): `NexusFabric/innercore-network /discovery/discovery.go`
- [Peer Network Table](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/network/network.go): `NexusFabric/innercore-network /network/network.go`
- [Internet Egress](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/fallback/internet_fallback_egress.go): `NexusFabric/innercore-network /fallback/internet_fallback_egress.go`

### Routing And Messaging

- [Message Transport](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/message/message.go): `NexusFabric/innercore-network /message/message.go`
- [Kademlia Overlay](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/innercore.go): `NexusFabric/innercore-network /innercore/innercore.go`
- [Kademlia RPC](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/rpc.go): `NexusFabric/innercore-network /innercore/rpc.go`
- [Iterative Lookup](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/lookup.go): `NexusFabric/innercore-network /innercore/lookup.go`
- [Routing Buckets](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/innercore/kbucket.go): `NexusFabric/innercore-network /innercore/kbucket.go`
- [Role Routing](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/resolver/role-routing.go): `NexusFabric/innercore-network /resolver/role-routing.go`

### Services And Storage

- [Service Resolver](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/resolver/resolver.go): `NexusFabric/innercore-network /resolver/resolver.go`
- [Service Registry](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/service/service.go): `NexusFabric/innercore-network /service/service.go`
- [Versioned Storage](https://github.com/kristian-onyango/nexus_fabric/blob/main/NexusFabric/innercore-network%20/storage/storage_engine.go): `NexusFabric/innercore-network /storage/storage_engine.go`

### Other components

- **Node Operator**
- **Public Internet**

## Connections

- Node Operator → Program Entry: starts (evidence: `NexusFabric/innercore-network /main/main.go`)
- Program Entry → System Integrator: initializes (evidence: `NexusFabric/innercore-network /main/main.go`)
- System Integrator → Peer Discovery: initializes (evidence: `NexusFabric/innercore-network /integration/integration.go`)
- System Integrator → Kademlia Overlay: configures (evidence: `NexusFabric/innercore-network /integration/integration.go`)
- System Integrator → Message Transport: registers handler (evidence: `NexusFabric/innercore-network /integration/integration.go`)
- System Integrator → Peer Network Table: updates peers (evidence: `NexusFabric/innercore-network /integration/integration.go`)
- System Integrator → Internet Egress: starts (evidence: `NexusFabric/innercore-network /integration/integration.go`)
- Peer Discovery → System Integrator: invokes callback (evidence: `NexusFabric/innercore-network /discovery/discovery.go`)
- Message Transport → Peer Network Table: records success (evidence: `NexusFabric/innercore-network /message/message.go`)
- Role Routing → Peer Network Table: reads peers (evidence: `NexusFabric/innercore-network /resolver/role-routing.go`)
- Role Routing → Message Transport: sends messages (evidence: `NexusFabric/innercore-network /resolver/role-routing.go`)
- Service Registry → Peer Network Table: checks peer (evidence: `NexusFabric/innercore-network /service/service.go`)
- Kademlia RPC → Message Transport: sends packets
- Internet Egress → Public Internet: forwards traffic (evidence: `NexusFabric/innercore-network /fallback/internet_fallback_egress.go`)
