How bhanuprasadchesetti/land-registration-system-with-blockchain works
Project type and purpose
• This is a full-stack decentralized application (DApp) for land registration and transfer, combining:
• Two Flask-based web servers (one for government/revenue officers, one for end-users)
• A suite of Solidity smart contracts deployed on an Ethereum test network (Ganache)
• A MongoDB database for off-chain storage of user and document metadata
• Front-end UI assets (HTML/CSS/JS) served by Flask and Web3.js/MetaMask for transaction signing
File structure
• Top-level directories:
• Server_For_Revenue_Dept – Flask app for government officers
• Server_For_Users – Flask app for public users
• Smart_contracts – Truffle project containing Solidity contracts, migrations and build artifacts
• python_package_requirements.txt – Python dependencies
• Server_For_Revenue_Dept:
• app.py – main Flask entry point for the revenue portal
• config.json – runtime configuration (Ganache RPC URL, MongoDB URL, secret keys)
• /static + /templates – MVC web layers (HTML templates + CSS/JS)
• /utility – Python helper modules for mapping revenue data
• Server_For_Users:
• app.py – main Flask entry point for user portal
• /web/static + /web/templates – user-facing UI assets
• Property_Docs – folder to hold uploaded PDF proofs
• Smart_contracts:
• contracts/ – Solidity files defining LandRegistry, Property, TransferOwnership, Users
• migrations/ – deployment scripts
• build/contracts – compiled contract JSON (ABI + bytecode)
• truffle-config.js – specifies Ganache network for migrations
README for additional insights
• Two main workflows:
A. Decentralizing land registry data via user upload, government verification, then on-chain storage
B. Ownership transfer via listing, offer, payment in Ether, and on-chain transfer
• Tech stack: Flask, MongoDB, Solidity, Truffle, Ganache, MetaMask
• No complex microservices—just two monolithic Flask apps plus a blockchain network
a. Main components
1. User Browser + MetaMask extension
2. User Portal (Flask server)
3. Revenue Portal (Flask server)
4. Ethereum Test Network (Ganache) hosting Smart Contracts
5. MongoDB database
6. File storage for property documents (on-disk in Server_For_Users/Property_Docs)
b. Relationships and data flows
• Browser ↔ User Portal: HTTP(S) requests for page rendering, Web3.js calls for read/write operations
• Browser ↔ Ganache/Ethereum: direct RPC calls via MetaMask for transaction signing (add land, buy/sell)
• User Portal ↔ MongoDB: store user profiles, property metadata, purchase requests
• User Portal ↔ Ganache/Ethereum: JSON-RPC calls via Web3.py to deploy/read/write contracts
• Revenue Portal ↔ MongoDB: store verification status, admin logs
• Revenue Portal ↔ Ganache/Ethereum: call grantOwnership or rejectOwnership contract functions
• Smart Contracts ↔ Ethereum Ledger: on-chain state for property ownership, transfers
c. Architectural patterns and principles
• MVC pattern in both Flask apps (templates, static assets, controllers in app.py)
• Dual-portal separation of concerns (administration vs. public user flows)
• On-chain/off-chain hybrid: critical ownership logic resides on blockchain, bulky docs and metadata off-chain
• Event-driven updates (optional): Flask servers could listen for contract events to update MongoDB
d. Key technologies
• Python Flask (app servers)
• Web3.py / Web3.js (blockchain interaction)
• MongoDB (NoSQL database)
• Solidity + Truffle (smart contract development and migration)
• Ganache (local Ethereum blockchain)
• MetaMask (user wallet for transaction signing)