Skip to content

Latest commit

Β 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TerraLink β€” Decentralized Real Estate Marketplace

TerraLink is a full-stack Web3 real-estate platform that enables secure property registration, listing, rentals, and fractional ownership using Ethereum smart contracts.

Built with React, Vite, Wagmi, RainbowKit, Solidity, and Foundry, TerraLink combines modern Web3 UX with decentralized ownership and transparent on-chain transactions.


✨ Features

🏠 Property NFT Registration

  • Mint real-estate properties as NFTs
  • Store metadata using IPFS
  • Immutable on-chain ownership records

πŸ›’ Marketplace System

  • List properties for sale
  • Update listing prices
  • Cancel listings
  • Buy properties securely using smart contracts

🏘 Rental Escrow

  • Open rental agreements
  • Tenant rent payments
  • Security deposit handling
  • Rental termination workflow
  • Deposit refunds and deductions

πŸ“ˆ Fractional Investment

  • Enable shared ownership of properties
  • Contributors invest into fractional pools
  • Rental income distribution to investors
  • Claimable payouts for contributors

πŸ” Wallet & Web3 Integration

  • MetaMask support
  • RainbowKit wallet connection
  • Wagmi + Viem integration
  • Sepolia testnet deployment

🎨 Modern Frontend

  • Responsive UI built with TailwindCSS
  • Framer Motion animations
  • React Router navigation
  • Toast notifications
  • Reusable component architecture

πŸ›  Tech Stack

Frontend

  • React
  • Vite
  • TailwindCSS
  • Framer Motion
  • React Router
  • Wagmi
  • Viem
  • RainbowKit
  • Recharts

Smart Contracts

  • Solidity
  • Foundry

Blockchain

  • Ethereum Sepolia Testnet

Storage

  • IPFS
  • Pinata

πŸ“ Project Structure

TerraLink-RealEstate-Using-Blockchain/
β”‚
β”œβ”€β”€ frontend/                  # React + Vite frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ pages/
β”‚   └── package.json
β”‚
β”œβ”€β”€ smart contracts/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ PropertyNFT.sol
β”‚   β”‚   β”œβ”€β”€ Marketplace.sol
β”‚   β”‚   β”œβ”€β”€ RentalEscrow.sol
β”‚   β”‚   β”œβ”€β”€ FractionalInvestment.sol
β”‚   β”‚   └── MockUSDT.sol
β”‚   β”‚
β”‚   β”œβ”€β”€ script/
β”‚   β”‚   └── Deploy.s.sol
β”‚   β”‚
β”‚   └── test/
β”‚       └── Terralink.t.sol
β”‚
└── README.md

βš™οΈ Smart Contracts

PropertyNFT.sol

Handles:

  • Property minting
  • Ownership records
  • Metadata storage
  • Property registration events

Marketplace.sol

Handles:

  • Property listings
  • Buying/selling
  • Listing updates
  • Listing cancellation

RentalEscrow.sol

Handles:

  • Rental agreements
  • Security deposits
  • Rent payment flows
  • Refunds and settlement

FractionalInvestment.sol

Handles:

  • Shared property investments
  • Investor contribution tracking
  • Rental income payouts
  • Claimable rewards

MockUSDT.sol

Mock ERC20 token used for testing transactions.


πŸš€ Getting Started

Prerequisites

Install the following before running the project:

  • Node.js
  • npm
  • Foundry
  • MetaMask
  • Git

πŸ”§ Frontend Setup

1. Clone Repository

git clone https://github.com/Chitrangath/TerraLink-RealEstate-Using-Blockchain.git
cd TerraLink-RealEstate-Using-Blockchain

2. Install Frontend Dependencies

cd frontend
npm install

3. Configure Environment Variables

Copy .env.example into .env

cp .env.example .env

Update the following variables:

VITE_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id
VITE_PINATA_JWT=your_pinata_jwt
VITE_SEPOLIA_RPC_URL=your_sepolia_rpc_url
VITE_DEPLOYMENT_BLOCK=deployment_block

VITE_MOCK_USDT_ADDRESS=0x...
VITE_PROPERTY_NFT_ADDRESS=0x...
VITE_MARKETPLACE_ADDRESS=0x...
VITE_RENTAL_ESCROW_ADDRESS=0x...
VITE_FRACTIONAL_ADDRESS=0x...

4. Start Frontend

npm run dev

Frontend runs on:

http://localhost:5173

β›“ Smart Contract Setup

Install Foundry Dependencies

cd "smart contracts"
forge install

Compile Contracts

forge build

Run Tests

forge test

Deploy Contracts

forge script script/Deploy.s.sol --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast

πŸ”„ Protocol Workflow

Property Registration

  1. User uploads property metadata
  2. Metadata stored on IPFS
  3. Property NFT minted
  4. Ownership stored on-chain

Marketplace Purchase

  1. Owner lists property
  2. Buyer approves token allowance
  3. Smart contract executes purchase
  4. Ownership transferred automatically

Rental System

  1. Owner opens rental listing
  2. Tenant accepts rental
  3. Deposit locked in escrow
  4. Monthly rent payments processed
  5. Deposit refunded after completion

Fractional Investment

  1. Owner creates investment pool
  2. Investors contribute funds
  3. Rental income deposited
  4. Contributors claim rewards proportionally

🌐 Deployed Network

The frontend is configured for:

  • Ethereum Sepolia Testnet

Contract writes are restricted to Sepolia deployments.


πŸ§ͺ Testing

Smart contract tests are located in:

smart contracts/test/Terralink.t.sol

Run tests:

forge test -vv

πŸ“Έ Screenshots

Add screenshots here.

Example:

/screenshots/homepage.png
/screenshots/property-details.png
/screenshots/marketplace.png
/screenshots/fractional-investment.png

πŸ”’ Security Notes

  • Smart contracts should be audited before production deployment
  • Never expose private keys publicly
  • Store sensitive credentials securely
  • Prefer backend proxying for Pinata JWT in production
  • Validate ownership before executing transactions

πŸ“Œ Future Improvements

  • Multi-chain deployment
  • DAO governance for properties
  • Real government land registry integration
  • AI property valuation
  • Mobile application
  • Fiat payment gateway integration
  • NFT mortgage system

🀝 Contributing

Contributions are welcome.

Steps

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature/new-feature
  1. Commit changes
git commit -m "Added new feature"
  1. Push changes
git push origin feature/new-feature
  1. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Chitrangath

GitHub Repository: https://github.com/Chitrangath/TerraLink-RealEstate-Using-Blockchain


⭐ Acknowledgements

  • Ethereum
  • Foundry
  • Wagmi
  • RainbowKit
  • React
  • TailwindCSS
  • IPFS
  • Pinata

Releases

Packages

Contributors

Languages