# ranjanadevi1802/agrochain architecture

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

- Interactive diagram: https://gitdiagram.com/ranjanadevi1802/agrochain
- Repository: https://github.com/ranjanadevi1802/agrochain

## Overview

AgroChain is a React prototype for farm-to-consumer produce traceability. Users enter through the routed app shell and use separate portals to manage farmers, FPO batches, distributor shipments and retailer packets; consumers can view a simulated QR verification, while dashboards, blockchain and notification pages expose transparency information. The README documents a dual-level QR journey, pricing analytics and SMS/IVR updates. Sampled code uses local dummy data; Hyperledger Fabric and messaging integrations are described as planned or architecture-ready, not demonstrated runtime services.

Main entry points: [`src/App.jsx`](https://github.com/ranjanadevi1802/agrochain/blob/main/src/App.jsx) (App Router), [`src/data/dummyData.js`](https://github.com/ranjanadevi1802/agrochain/blob/main/src/data/dummyData.js) (Sample Records), [`src/pages/Farmers.jsx`](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Farmers.jsx) (Farmer Directory), [`src/pages/FPO.jsx`](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/FPO.jsx) (FPO Produce Batches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_entry["App Router<br/>[App.jsx]"]
  node_shell["Navigation Shell<br/>[Layout.jsx]"]
  node_bootstrap["React Bootstrap<br/>[main.jsx]"]
end

subgraph group_supply["Supply Chain Portals"]
  node_farmers["Farmer Directory<br/>[Farmers.jsx]"]
  node_fpo["FPO Produce Batches<br/>[FPO.jsx]"]
  node_distributors["Distributor Tracking<br/>[Distributors.jsx]"]
  node_retailers["Retail QR Packs<br/>[Retailers.jsx]"]
end

subgraph group_transparency["Transparency Views"]
  node_dashboard["Dashboard Analytics<br/>[Dashboard.jsx]"]
  node_verify["Consumer Verification<br/>[ConsumerVerify.jsx]"]
  node_blockchain["Ledger Explorer<br/>[Blockchain.jsx]"]
  node_notifications["SMS IVR Logs<br/>[Notifications.jsx]"]
end

subgraph group_data["Prototype Data"]
  node_sampledata["Sample Records<br/>[dummyData.js]"]
end

node_user(("Platform User"))
node_farmer(("Farmer"))
node_consumer(("Consumer"))

node_bootstrap -->|"renders"| node_entry
node_entry -->|"routes through"| node_shell
node_entry -->|"routes to"| node_dashboard
node_entry -->|"routes to"| node_farmers
node_entry -->|"routes to"| node_fpo
node_entry -->|"routes to"| node_distributors
node_entry -->|"routes to"| node_retailers
node_entry -->|"routes to"| node_verify
node_entry -->|"routes to"| node_blockchain
node_entry -->|"routes to"| node_notifications
node_user -.->|"uses"| node_entry
node_farmer -->|"registers with"| node_farmers
node_farmers -->|"delivers produce"| node_fpo
node_fpo -->|"hands off"| node_distributors
node_distributors -->|"delivers produce"| node_retailers
node_retailers -->|"offers QR"| node_consumer
node_consumer -->|"scans QR"| node_verify
node_dashboard -->|"reads"| node_sampledata
node_farmers -->|"reads"| node_sampledata
node_fpo -->|"reads"| node_sampledata
node_distributors -->|"reads"| node_sampledata
node_retailers -->|"reads"| node_sampledata
node_verify -->|"reads"| node_sampledata
node_blockchain -->|"reads"| node_sampledata
node_notifications -->|"reads"| node_sampledata

click node_entry "https://github.com/ranjanadevi1802/agrochain/blob/main/src/App.jsx"
click node_shell "https://github.com/ranjanadevi1802/agrochain/blob/main/src/components/Layout.jsx"
click node_dashboard "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Dashboard.jsx"
click node_farmers "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Farmers.jsx"
click node_fpo "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/FPO.jsx"
click node_distributors "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Distributors.jsx"
click node_retailers "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Retailers.jsx"
click node_verify "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/ConsumerVerify.jsx"
click node_blockchain "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Blockchain.jsx"
click node_notifications "https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Notifications.jsx"
click node_sampledata "https://github.com/ranjanadevi1802/agrochain/blob/main/src/data/dummyData.js"
click node_bootstrap "https://github.com/ranjanadevi1802/agrochain/blob/main/src/main.jsx"

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_entry,node_shell,node_bootstrap,node_user toneBlue
class node_farmers,node_fpo,node_distributors,node_retailers toneAmber
class node_dashboard,node_verify,node_blockchain,node_notifications toneMint
class node_sampledata toneRose
class node_farmer,node_consumer toneIndigo
```

## Components

### Application Shell

- [App Router](https://github.com/ranjanadevi1802/agrochain/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation Shell](https://github.com/ranjanadevi1802/agrochain/blob/main/src/components/Layout.jsx): `src/components/Layout.jsx`
- [React Bootstrap](https://github.com/ranjanadevi1802/agrochain/blob/main/src/main.jsx): `src/main.jsx`

### Supply Chain Portals

- [Farmer Directory](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Farmers.jsx): `src/pages/Farmers.jsx`
- [FPO Produce Batches](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/FPO.jsx): `src/pages/FPO.jsx`
- [Distributor Tracking](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Distributors.jsx): `src/pages/Distributors.jsx`
- [Retail QR Packs](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Retailers.jsx): `src/pages/Retailers.jsx`

### Transparency Views

- [Dashboard Analytics](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Consumer Verification](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/ConsumerVerify.jsx): `src/pages/ConsumerVerify.jsx`
- [Ledger Explorer](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Blockchain.jsx): `src/pages/Blockchain.jsx`
- [SMS IVR Logs](https://github.com/ranjanadevi1802/agrochain/blob/main/src/pages/Notifications.jsx): `src/pages/Notifications.jsx`

### Prototype Data

- [Sample Records](https://github.com/ranjanadevi1802/agrochain/blob/main/src/data/dummyData.js): `src/data/dummyData.js`

### Other components

- **Platform User**
- **Farmer**
- **Consumer**

## Connections

- React Bootstrap → App Router: renders (evidence: `src/main.jsx`)
- App Router → Navigation Shell: routes through (evidence: `src/App.jsx`)
- App Router → Dashboard Analytics: routes to (evidence: `src/App.jsx`)
- App Router → Farmer Directory: routes to (evidence: `src/App.jsx`)
- App Router → FPO Produce Batches: routes to (evidence: `src/App.jsx`)
- App Router → Distributor Tracking: routes to (evidence: `src/App.jsx`)
- App Router → Retail QR Packs: routes to (evidence: `src/App.jsx`)
- App Router → Consumer Verification: routes to (evidence: `src/App.jsx`)
- App Router → Ledger Explorer: routes to (evidence: `src/App.jsx`)
- App Router → SMS IVR Logs: routes to (evidence: `src/App.jsx`)
- Platform User → App Router: uses
- Farmer → Farmer Directory: registers with (evidence: `README.md`)
- Farmer Directory → FPO Produce Batches: delivers produce (evidence: `README.md`)
- FPO Produce Batches → Distributor Tracking: hands off (evidence: `README.md`)
- Distributor Tracking → Retail QR Packs: delivers produce (evidence: `README.md`)
- Retail QR Packs → Consumer: offers QR (evidence: `README.md`)
- Consumer → Consumer Verification: scans QR (evidence: `README.md`)
- Dashboard Analytics → Sample Records: reads (evidence: `src/pages/Dashboard.jsx`)
- Farmer Directory → Sample Records: reads (evidence: `src/pages/Farmers.jsx`)
- FPO Produce Batches → Sample Records: reads (evidence: `src/pages/FPO.jsx`)
- Distributor Tracking → Sample Records: reads (evidence: `src/pages/Distributors.jsx`)
- Retail QR Packs → Sample Records: reads (evidence: `src/pages/Retailers.jsx`)
- Consumer Verification → Sample Records: reads (evidence: `src/pages/ConsumerVerify.jsx`)
- Ledger Explorer → Sample Records: reads (evidence: `src/pages/Blockchain.jsx`)
- SMS IVR Logs → Sample Records: reads (evidence: `src/pages/Notifications.jsx`)
