How kuldeep23907/supply-chain-using-hyperledger-fabric-and-react works
Project’s Main Components
• Hyperledger Fabric Network:
– Represented by the artifacts directory (including docker-compose files, crypto-config.yaml, configtx.yaml, and base network definitions) and scripts for generating certificates, creating channels, updating anchor peers, and managing chaincode.
– This includes multiple organizations (Manufacturer, MiddleMen, Consumer), peers, orderer, certificate authorities (as laid out in the README) and the channel configuration.
• Chaincode:
– Found in the chaincode directory (supplychain.go). The chaincode implements all the critical supply chain business processes (e.g., createUser, createProduct, transfer operations, query functions).
• Middleware API Server:
– Located in the web-app/servers directory. This component (using Node.js) exposes REST APIs that interact with the blockchain network and execute chaincode functions. Notice folders for controllers (defining API endpoints), routes, models, utilities, and integration with Fabric (connection files in web-app/servers/fabric).
• Frontend Client:
– Found in web-app/client, this is a React.js application with a clear separation of components (such as create-order, create-product, and user management) that interacts with the backend API.
• Supporting Scripts:
– Shell scripts (startNetwork.sh, stopNetwork.sh, teardown.sh, generate.sh, operate.sh, etc.) in the project root and scripts folder offer automation for network operations and deployment tasks.
Relationships and Interactions
• The React.js front end communicates with the backend API server through HTTP calls. This server acts as an intermediary between the client and the blockchain network.
• The Node.js middleware (API server) interacts with the Hyperledger Fabric network using the Fabric SDK (via network connection profiles in the servers/fabric directory) to invoke chaincode functions and query the ledger.
• The chaincode (smart contracts) reside within the Fabric network and govern the business logic (product creation, updates, transfers, and audit queries) across the blockchain.
• The Fabric network’s configuration (setup using docker-compose files and generating certificates) underpins the chaincode execution with multiple peers, orderers, and CA services.
Architectural Patterns and Design Principles
• Separation of Concerns: The project clearly separates the blockchain network (Hyperledger Fabric and chaincode) from the application logic (Node.js backend) and UI presentation (React client).
• Microservice/API Layer: The backend exposes distinct REST endpoints to interact with the blockchain, which improves modularity.
• DevOps/Automation: A suite of shell scripts and Docker configurations facilitates continuous integration and deployment, as well as network orchestration.
• Security and Transparency: The use of blockchain (immutable ledger, secure identity management via Fabric CA) ensures data integrity and traceability.
Relevant Technologies, Frameworks, or Libraries
• Hyperledger Fabric (Blockchain Network)
• Chaincode in Go (supplychain.go)
• Node.js and Express (for the middleware API server)
• React.js (frontend client)
• Docker Compose (for orchestrating the blockchain network and potentially the API server)
• Shell scripting (for automating network set up and teardown)
• Fabric SDK for Node.js (integration of the API server with the Fabric network)
Overall Detailing
• Any configuration or deployment artifacts (shell scripts, YAML configuration files) can be noted as ancillary tools that support the primary components.