# vrii14/land-registration-with-blockchain architecture

> Architecture diagram of the GitHub repository vrii14/land-registration-with-blockchain, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vrii14/land-registration-with-blockchain
- Repository: https://github.com/vrii14/land-registration-with-blockchain

## Overview

##### Main Components

a) Frontend Layer:
- React.js application (client folder)
- User Interfaces (Buyer, Seller, Land Inspector dashboards)
- Metamask Integration
- IPFS Integration for document storage

b) Smart Contract Layer:
- Ethereum Smart Contracts (contracts folder)
- Land Registration Logic
- Ownership Transfer Logic

c) Blockchain Layer:
- Ethereum Network (Ganache for development)
- Transaction Management
- State Management

##### Key Relationships to Highlight

- User → Frontend → Metamask → Smart Contracts → Blockchain
- Document Storage Flow: Frontend → IPFS → Smart Contracts
- Authentication Flow: User → Metamask → Smart Contracts
- Data Flow between different user roles (Buyer, Seller, Land Inspector)

##### Specific Implementation Details

**[Frontend Layer]**
- User Interface Components
- Registration (Buyer/Seller)
- Dashboards
- Land Management
- Profile Management
- Web3 Integration
- Metamask Connector
- IPFS Client
- State Management

**[Smart Contract Layer]**
- Land Contract
- Land Registration Logic
- Ownership Transfer
- Payment Processing
- Access Control
- Land Inspector Verification
- User Authentication

**[Blockchain Layer]**
- Ethereum Network
- Transaction Processing
- State Storage

##### Important Workflows to Highlight

a) Land Registration Flow:
**Seller → Frontend → Smart Contract → Land Inspector Approval → Blockchain**

b) Land Purchase Flow:
**Buyer Request → Seller Approval → Payment → Land Inspector Verification → Ownership Transfer**

##### Additional Elements

- Notes about the technology stack (Ethereum, React, Solidity)
- Security checkpoints and validation steps
- Error handling and fallback flows

Remember to include:
- User authentication flows
- Document verification processes
- Payment processing paths
- State changes in the blockchain
- External service integrations

This will provide a complete picture of how the land registration system operates while maintaining clarity about the role of blockchain in ensuring transparency and immutability of land records.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI[User Interface]
        UI --> RegComp[Registration Components]:::frontend
        UI --> Dash[Dashboards]:::frontend
        UI --> LandMgmt[Land Management]:::frontend
        UI --> Profile[Profile Management]:::frontend
        
        RegComp --> BuyerReg[Buyer Registration]:::frontend
        RegComp --> SellerReg[Seller Registration]:::frontend
        
        Dash --> BSDash[Buyer/Seller Dashboard]:::frontend
        Dash --> LIDash[Land Inspector Dashboard]:::frontend
        Dash --> SDash[Seller Dashboard]:::frontend
        
        LandMgmt --> AddLand[Add Land]:::frontend
        LandMgmt --> OwnedLands[Owned Lands]:::frontend
        LandMgmt --> LandTx[Land Transactions]:::frontend
        
        Profile --> UserProf[User Profile]:::frontend
        Profile --> BuyerProf[Buyer Profile]:::frontend
        Profile --> SellerProf[Seller Profile]:::frontend
    end
    
    subgraph Integration
        Web3[Web3 Connection]:::integration
        IPFS[IPFS Client]:::integration
        MetaMask[MetaMask]:::integration
    end
    
    subgraph SmartContracts
        LandContract[Land Contract]:::contract
        AccessControl[Access Control]:::contract
        
        LandContract --> RegLogic[Land Registration Logic]:::contract
        LandContract --> OwnershipLogic[Ownership Transfer]:::contract
        LandContract --> PaymentLogic[Payment Processing]:::contract
        
        AccessControl --> LIVerification[Land Inspector Verification]:::contract
        AccessControl --> UserAuth[User Authentication]:::contract
    end
    
    subgraph Blockchain
        ETH[Ethereum Network]:::blockchain
        TxProcess[Transaction Processing]:::blockchain
        StateStore[State Storage]:::blockchain
    end
    
    UI --> Web3
    UI --> IPFS
    Web3 --> MetaMask
    MetaMask --> LandContract
    LandContract --> ETH
    ETH --> TxProcess
    TxProcess --> StateStore
    
    %% Click Events
    click UI "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/App.js"
    click BuyerReg "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/RegisterBuyer.js"
    click SellerReg "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/RegisterSeller.js"
    click BSDash "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/Dashboard.js"
    click LIDash "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/LIDashboard.js"
    click SDash "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/SellerDashboard.js"
    click AddLand "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/AddLand.js"
    click OwnedLands "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/OwnedLands.js"
    click LandTx "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/TransactionInfo.js"
    click UserProf "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/UserProfile.js"
    click BuyerProf "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/buyerProfile.js"
    click SellerProf "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/sellerProfile.js"
    click Web3 "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/getWeb3.js"
    click IPFS "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/ipfs.js"
    click LandContract "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/artifacts/Land.json"
    click PaymentLogic "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/MakePayment.js"
    click LIVerification "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/ApproveTransaction.js"
    click UserAuth "https://github.com/vrii14/Land-Registration-with-Blockchain/blob/master/client/src/views/ApproveRequest.js"
    
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef integration fill:#9b59b6,stroke:#8e44ad,color:white
    classDef contract fill:#2ecc71,stroke:#27ae60,color:white
    classDef blockchain fill:#e67e22,stroke:#d35400,color:white
```
