Skip to content

jnationj/LandQ-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LandQ

A Next.js + Web3 frontend for LandNFT, LandVerifier, and LandLending β€” enabling tokenization, verification, and DeFi lending of real-world land assets, with Firebase integration for off-chain storage.


πŸ“‘ Table of Contents

  1. Features
  2. Tech Stack
  3. Prerequisites
  4. Installation
  5. Configuration
  6. Running the Project
  7. Testing
  8. Folder Structure
  9. Usage
  10. Troubleshooting
  11. Contributing
  12. License
  13. Contact

πŸš€ Features

  • NFT Minting: Tokenize land assets as ERC-1155 NFTs.
  • Verification System: Validate asset ownership via LandVerifier smart contract.
  • DeFi Lending: Use NFTs as collateral for loans with LandLending.
  • Firebase Integration: Store verification metadata and user requests off-chain.
  • Responsive UI: Tailored for desktop and mobile devices.
  • Wallet Connection: Supports MetaMask and WalletConnect.

πŸ›  Tech Stack

  • Frontend: Next.js 15, React 18, TypeScript
  • Styling: TailwindCSS
  • Blockchain: ethers.js / wagmi
  • Smart Contracts: LandNFT, LandVerifier, LandLending (Solidity)
  • Database: Firebase Firestore

πŸ“‹ Prerequisites

  • Node.js v18+
  • npm v9+ or yarn v1.22+
  • MetaMask or another Web3 wallet
  • Access to Ethereum or compatible testnet (core testnet2)
  • Firebase project with Firestore enabled

πŸ“¦ Installation

Frontend

# Clone repository
git clone https://github.com/jnationj/LandQ-v1.git
cd LandQ-Frontend

# Install dependencies
npm install
# or
yarn install

βš™οΈ Configuration

Create a .env.local file in the root directory:

NEXT_PUBLIC_LANDNFT_CONTRACT=your_contract_address
NEXT_PUBLIC_FIREBASE_API_KEY=your_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID
# === FIREBASE ADMIN SDK CONFIG ===
FIREBASE_PROJECT_ID=
FIREBASE_CLIENT_EMAIL=
FIREBASE_PRIVATE_KEY=

▢️ Running the Project

Development:

npm run dev
# or
yarn dev

Backend

# Change directory
cd LandQ-Backend

# Install dependencies
npm install
# or
yarn install

βš™οΈ Configuration

Create a .env.local file in the root directory:

PINATA_JWT=

▢️ Running the Project

Development:

npm run dev
# or
yarn dev

AI-Agent

# Change directory

cd LandQ-ai-agent

# Install dependencies
pnpm install

βš™οΈ Configuration

Create a .env.local file in the root directory:

API_BASE_URL=http://127.0.0.1:11434/api
MODEL_NAME_AT_ENDPOINT=qwen2.5:1.5b

▢️ Running the Project

Start ollama on local machine

ollama serve
ollama pull qwen2.5:1.5b
ollama run qwen2.5:1.5b

Development:

pnpm run dev

πŸ“‚ Frontend Folder Structure

β”œβ”€β”€ app/                   # Next.js App Router pages
β”œβ”€β”€ components/            # UI components (Chat, UploadForm, etc.)
β”œβ”€β”€ lib/                   # Firebase & blockchain helper functions
β”œβ”€β”€ public/                # Static assets
β”œβ”€β”€ styles/                # TailwindCSS styles
└── abi/                   # Smart contract ABIs
and more ...

πŸ’‘ Usage

  1. Connect your Web3 wallet.
  2. Mint a LandNFT by providing asset metadata.
  3. Verify ownership via LandVerifier.
  4. Use the NFT as collateral in LandLending.

LandNFT Detailed Usage Flow


Stage 1 – Become an Accredited Land Verifier

To ensure authenticity of land NFTs, verification is handled by approved agencies per state/region.

Steps:

  1. Apply as an Agency – /agency/apply

    • User fills form with:

      • State/Region
      • Why you want to be an agency in your region
      • Set verification fee - goes to agency address
      • Address auto populated
    • Application is reviewed by admin. if not review on time Contact

or

  • use this private key for Nigeria "Yobe Stat"e 9bcb1e72326e6179069ddb4c7ba0c91d6c0ec6a7bbb1c9b93a642ec0508cc9f1
  1. **Approval ** /agency/dashboard`

    • Once approved, the agency receives an right that grants them access to verify land NFTs in their jurisdiction.

Stage 2 – Mint Your Land NFT

Once a user owns land, they can tokenize it on the blockchain using LandNFT.

Steps:

  1. Go to /mint

  2. Fill in:

    • Land Details
    • Land coordinates (latitude & longitude)
    • price
    • Supporting documents (upload pdfs files/images) 3.Generates Metadata URL from Pinata
  3. No of plots which serves as the FT in erc1155

  4. Mint transaction is sent to the blockchain.

  5. The minted NFT is unverified initially.


Stage 3 – Request Land Verification

To make the NFT official and tradable, it must be verified by the state agency.

Steps:

  1. Owner sends /my-nfts request verify

  2. Agency reviews:

    • Blockchain NFT data
    • Uploaded documents
    • Government land registry records
  3. If approved:

    • isVerified flag on NFT metadata is set to true (on-chain + Firebase off-chain record updated).

Stage 4 – Collect Loan with verified Land NFT

After verification:

  • NFT can be used collect loan in USDT from the contract LandLending.

Stage 5 – Use Land as Collateral (DeFi Integration)

With LandLending, users can borrow against their verified land NFT.

Steps:

  1. Navigate to /my-nfts
  2. Choose:
    • Loan amount
    • Interest rate
    • Duration
  3. Smart contract locks NFT in escrow.
  4. Borrower receives stablecoins mUSDT.
  5. On repayment you can either pay with BTC at a discount or USDT, NFT is released.

Stage 6 – Firebase Off-chain Sync

Every action updates Firebase for:

  • Fast frontend queries
  • Off-chain analytics for AI-Agent
  • Backup verification trail

Stage 7 – Coming soon Dispute or Revocation

If disputes arise (e.g., fraudulent claim):

  • /verification/dispute can be filed.
  • Agency or admin can revoke verification and mark NFT as disputed.

πŸ›  Troubleshooting

  • "Module not found" error β†’ Check if all components exist in components/ and imports use correct case.
  • Firebase errors β†’ Verify .env.local matches Firebase project credentials.
  • Contract interaction failed β†’ Ensure correct network and contract addresses.

πŸ“„ License

MIT License β€” see LICENSE for details.


πŸ“¬ Contact

Maintainer: Your Name Email: 0xlandq@gmail.com Twitter: @xLandQ

About

Tokenised Land Ownership for real world finance BTCFi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published