# rohitguddin/carbonchain-decarbon-byquantumnodes architecture

> Architecture diagram of the GitHub repository rohitguddin/carbonchain-decarbon-byquantumnodes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohitguddin/carbonchain-decarbon-byquantumnodes
- Repository: https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes

## Overview

DeCarbon lets cultivators submit plantation evidence for plant identification and approval, then earn and price credits; companies browse and purchase credits. Transactions, wallet balances, invoices, and public carbon-impact views support that lifecycle. The graph includes the documented web and mobile clients, backend domain modules, and persistent state. Backend routing and several screens are only documented or partially sampled, so uncertain call-level links are omitted; optional Gemini and Razorpay integrations are dashed.

Main entry points: [`nccr-backend/app.py`](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/app.py) (Backend API), [`frontend/src/utils/api.js`](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/utils/api.js) (Web API client), [`frontend/src/App.jsx`](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/App.jsx) (Web application), [`nccr-backend/models.py`](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/models.py) (Domain records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_web["Web application<br/>[App.jsx]"]
  node_mobile["Mobile application"]
  node_webapi["Web API client<br/>[api.js]"]
  node_mobileapi["Mobile API client<br/>[api.js]"]
end

subgraph group_plantation["Plantation verification"]
  node_submission["Plantation submission<br/>[Cultivator.jsx]"]
  node_mobileupload["Mobile upload<br/>[UploadScreen.js]"]
  node_plantanalysis["Plant analysis<br/>[ai.py]"]
  node_approval["Plantation approval<br/>[app.py]"]
end

subgraph group_trading["Credit trading"]
  node_marketplace["Credit marketplace<br/>[Marketplace.jsx]"]
  node_payment["Credit payment<br/>[app.py]"]
end

subgraph group_ledger["Records and impact"]
  node_ledgerapi["Backend API<br/>[app.py]"]
  node_models["Domain records<br/>[models.py]"]
  node_database[("Application database<br/>[config.py]")]
  node_wallet["Wallet and history<br/>[WalletScreen.js]"]
  node_explorer["Transaction explorer<br/>[Explorer.jsx]"]
  node_co2["CO2 profile<br/>[Explorer.jsx]"]
  node_invoice["Invoice generation<br/>[invoice.py]"]
end

node_cultivators(("Cultivators"))
node_companies(("Companies"))
node_razorpay["Razorpay"]

node_cultivators -->|"use"| node_web
node_companies -->|"use"| node_web
node_cultivators -->|"use"| node_mobile
node_web -->|"route to"| node_submission
node_submission -->|"submit via"| node_webapi
node_mobile -->|"route to"| node_mobileupload
node_mobileupload -->|"submit via"| node_mobileapi
node_webapi -->|"request"| node_ledgerapi
node_mobileapi -->|"request"| node_ledgerapi
node_ledgerapi -->|"analyze image"| node_plantanalysis
node_plantanalysis -.-> node_razorpay
node_ledgerapi -->|"process request"| node_approval
node_ledgerapi -->|"read and write"| node_models
node_approval -->|"create credits"| node_models
node_marketplace -->|"request data"| node_webapi
node_companies -->|"browse and buy"| node_marketplace
node_marketplace -->|"purchase request"| node_ledgerapi
node_ledgerapi -->|"handle purchase"| node_payment
node_payment -.->|"create and verify"| node_razorpay
node_payment -->|"record transfer"| node_models
node_models -->|"persist"| node_database
node_mobile -->|"show balances"| node_wallet
node_wallet -->|"fetch credits"| node_mobileapi
node_web -->|"route to"| node_explorer
node_explorer -->|"fetch transactions"| node_webapi
node_webapi -->|"request profile"| node_co2
node_ledgerapi -->|"generate PDF"| node_invoice

click node_web "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/App.jsx"
click node_mobile "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/tree/main/mobile/src/screens"
click node_webapi "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/utils/api.js"
click node_mobileapi "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/mobile/src/utils/api.js"
click node_submission "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Cultivator.jsx"
click node_mobileupload "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/mobile/src/screens/UploadScreen.js"
click node_plantanalysis "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/ai.py"
click node_approval "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/app.py"
click node_marketplace "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Marketplace.jsx"
click node_payment "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/app.py"
click node_ledgerapi "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/app.py"
click node_models "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/models.py"
click node_database "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/config.py"
click node_wallet "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/mobile/src/screens/WalletScreen.js"
click node_explorer "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Explorer.jsx"
click node_co2 "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Explorer.jsx"
click node_invoice "https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/invoice.py"

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_web,node_mobile,node_webapi,node_mobileapi toneBlue
class node_submission,node_mobileupload,node_plantanalysis,node_approval toneAmber
class node_marketplace,node_payment toneMint
class node_ledgerapi,node_models,node_database,node_wallet,node_explorer,node_co2,node_invoice toneRose
class node_cultivators,node_companies,node_razorpay toneIndigo
```

## Components

### User clients

- [Web application](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Mobile application](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/tree/main/mobile/src/screens): `mobile/src/screens`
- [Web API client](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`
- [Mobile API client](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/mobile/src/utils/api.js): `mobile/src/utils/api.js`

### Plantation verification

- [Plantation submission](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Cultivator.jsx): `frontend/src/pages/Cultivator.jsx`
- [Mobile upload](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/mobile/src/screens/UploadScreen.js): `mobile/src/screens/UploadScreen.js`
- [Plant analysis](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/ai.py): `nccr-backend/ai.py`
- [Plantation approval](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/app.py): `nccr-backend/app.py`

### Credit trading

- [Credit marketplace](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Marketplace.jsx): `frontend/src/pages/Marketplace.jsx`
- [Credit payment](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/app.py): `nccr-backend/app.py`

### Records and impact

- [Backend API](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/app.py): `nccr-backend/app.py`
- [Domain records](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/models.py): `nccr-backend/models.py`
- [Application database](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/config.py): `nccr-backend/config.py`
- [Wallet and history](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/mobile/src/screens/WalletScreen.js): `mobile/src/screens/WalletScreen.js`
- [Transaction explorer](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Explorer.jsx): `frontend/src/pages/Explorer.jsx`
- [CO2 profile](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/frontend/src/pages/Explorer.jsx): `frontend/src/pages/Explorer.jsx`
- [Invoice generation](https://github.com/rohitguddin/carbonchain-decarbon-byquantumnodes/blob/main/nccr-backend/invoice.py): `nccr-backend/invoice.py`

### Other components

- **Cultivators**
- **Companies**
- **Razorpay**

## Connections

- Cultivators → Web application: use
- Companies → Web application: use
- Cultivators → Mobile application: use
- Web application → Plantation submission: route to
- Plantation submission → Web API client: submit via
- Mobile application → Mobile upload: route to
- Mobile upload → Mobile API client: submit via
- Web API client → Backend API: request
- Mobile API client → Backend API: request
- Backend API → Plant analysis: analyze image
- Plant analysis → Razorpay
- Backend API → Plantation approval: process request
- Backend API → Domain records: read and write
- Plantation approval → Domain records: create credits
- Credit marketplace → Web API client: request data
- Companies → Credit marketplace: browse and buy
- Credit marketplace → Backend API: purchase request
- Backend API → Credit payment: handle purchase
- Credit payment → Razorpay: create and verify
- Credit payment → Domain records: record transfer
- Domain records → Application database: persist
- Mobile application → Wallet and history: show balances
- Wallet and history → Mobile API client: fetch credits
- Web application → Transaction explorer: route to
- Transaction explorer → Web API client: fetch transactions
- Web API client → CO2 profile: request profile
- Backend API → Invoice generation: generate PDF
