# rahul-bangar/fyp architecture

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

- Interactive diagram: https://gitdiagram.com/rahul-bangar/fyp
- Repository: https://github.com/rahul-bangar/fyp

## Overview

This tree contains a partial Fabric Samples checkout: its visible product is a Go device-management API and asset-transfer chaincode, alongside a Fabric test-network sample. The workflow is an API request through the Fabric Gateway to a chaincode transaction that reads or updates ledger state. The README describes broader sample capabilities, but their directories are absent from this tree, so they are not mapped here. Relationships below are limited to the excerpts and README; unsampled network wiring is omitted.

Main entry points: [`asset-transfer-basic/app-go/app.go`](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/app-go/app.go) (Device API routes), [`asset-transfer-basic/test-chaincode-go/chaincode/smartcontract.go`](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/test-chaincode-go/chaincode/smartcontract.go) (Device transactions), [`test-network`](https://github.com/rahul-bangar/fyp/tree/main/test-network) (Test network), [`asset-transfer-basic/test-chaincode-go/assetTransfer.go`](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/test-chaincode-go/assetTransfer.go) (Chaincode startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Go client application"]
  node_api["Device API routes<br/>[app.go]"]
  node_gateway["Gateway connection<br/>[app.go]"]
  node_identity["Wallet identity<br/>[app.go]"]
end

subgraph group_contract["Asset chaincode"]
  node_chaincode_entry["Chaincode startup<br/>[assetTransfer.go]"]
  node_asset_contract["Device transactions<br/>[smartcontract.go]"]
end

subgraph group_network["Fabric network"]
  node_ledger[("World state")]
  node_test_network["Test network"]
  node_peers["Organization peers"]
  node_orderer["Ordering service"]
end

node_user(("API caller"))
node_external_service["Provisioning service"]

node_user -->|"calls routes"| node_api
node_api -->|"submits transactions"| node_gateway
node_gateway -->|"uses identity"| node_identity
node_api -->|"sends credentials"| node_external_service
node_chaincode_entry -->|"starts contract"| node_asset_contract
node_asset_contract -->|"reads and writes"| node_ledger
node_test_network -->|"provides infrastructure"| node_peers
node_test_network -->|"provides infrastructure"| node_orderer
node_gateway -.->|"connects to network"| node_test_network
node_asset_contract -.->|"runs on"| node_peers

click node_api "https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/app-go/app.go"
click node_gateway "https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/app-go/app.go"
click node_identity "https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/app-go/app.go"
click node_chaincode_entry "https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/test-chaincode-go/assetTransfer.go"
click node_asset_contract "https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/test-chaincode-go/chaincode/smartcontract.go"
click node_test_network "https://github.com/rahul-bangar/fyp/tree/main/test-network"

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_api,node_gateway,node_identity toneBlue
class node_chaincode_entry,node_asset_contract toneAmber
class node_ledger,node_test_network,node_peers,node_orderer,node_user toneMint
class node_external_service toneIndigo
```

## Components

### Go client application

- [Device API routes](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/app-go/app.go): `asset-transfer-basic/app-go/app.go`
- [Gateway connection](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/app-go/app.go): `asset-transfer-basic/app-go/app.go`
- [Wallet identity](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/app-go/app.go): `asset-transfer-basic/app-go/app.go`

### Asset chaincode

- [Chaincode startup](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/test-chaincode-go/assetTransfer.go): `asset-transfer-basic/test-chaincode-go/assetTransfer.go`
- [Device transactions](https://github.com/rahul-bangar/fyp/blob/main/asset-transfer-basic/test-chaincode-go/chaincode/smartcontract.go): `asset-transfer-basic/test-chaincode-go/chaincode/smartcontract.go`

### Fabric network

- **World state**
- [Test network](https://github.com/rahul-bangar/fyp/tree/main/test-network): `test-network`
- **Organization peers**
- **Ordering service**

### Other components

- **API caller**
- **Provisioning service**

## Connections

- API caller → Device API routes: calls routes (evidence: `asset-transfer-basic/app-go/app.go`)
- Device API routes → Gateway connection: submits transactions (evidence: `asset-transfer-basic/app-go/app.go`)
- Gateway connection → Wallet identity: uses identity (evidence: `asset-transfer-basic/app-go/app.go`)
- Device API routes → Provisioning service: sends credentials (evidence: `asset-transfer-basic/app-go/app.go`)
- Chaincode startup → Device transactions: starts contract (evidence: `asset-transfer-basic/test-chaincode-go/assetTransfer.go`)
- Device transactions → World state: reads and writes (evidence: `asset-transfer-basic/test-chaincode-go/chaincode/smartcontract.go`)
- Test network → Organization peers: provides infrastructure (evidence: `README.md`)
- Test network → Ordering service: provides infrastructure (evidence: `README.md`)
- Gateway connection → Test network: connects to network
- Device transactions → Organization peers: runs on
