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.
- Features
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Running the Project
- Testing
- Folder Structure
- Usage
- Troubleshooting
- Contributing
- License
- Contact
- 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.
- Frontend: Next.js 15, React 18, TypeScript
- Styling: TailwindCSS
- Blockchain: ethers.js / wagmi
- Smart Contracts: LandNFT, LandVerifier, LandLending (Solidity)
- Database: Firebase Firestore
- 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
# Clone repository
git clone https://github.com/jnationj/LandQ-v1.git
cd LandQ-Frontend
# Install dependencies
npm install
# or
yarn install
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=
Development:
npm run dev
# or
yarn dev
# Change directory
cd LandQ-Backend
# Install dependencies
npm install
# or
yarn install
Create a .env.local
file in the root directory:
PINATA_JWT=
Development:
npm run dev
# or
yarn dev
# Change directory
cd LandQ-ai-agent
# Install dependencies
pnpm install
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
ollama serve
ollama pull qwen2.5:1.5b
ollama run qwen2.5:1.5b
Development:
pnpm run dev
βββ 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 ...
- Connect your Web3 wallet.
- Mint a LandNFT by providing asset metadata.
- Verify ownership via LandVerifier.
- Use the NFT as collateral in LandLending.
To ensure authenticity of land NFTs, verification is handled by approved agencies per state/region.
Steps:
-
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
-
- use this private key for Nigeria "Yobe Stat"e 9bcb1e72326e6179069ddb4c7ba0c91d6c0ec6a7bbb1c9b93a642ec0508cc9f1
-
**Approval ** /agency/dashboard`
- Once approved, the agency receives an right that grants them access to verify land NFTs in their jurisdiction.
Once a user owns land, they can tokenize it on the blockchain using LandNFT.
Steps:
-
Go to
/mint
-
Fill in:
- Land Details
- Land coordinates (latitude & longitude)
- price
- Supporting documents (upload pdfs files/images) 3.Generates Metadata URL from Pinata
-
No of plots which serves as the FT in erc1155
-
Mint transaction is sent to the blockchain.
-
The minted NFT is unverified initially.
To make the NFT official and tradable, it must be verified by the state agency.
Steps:
-
Owner sends
/my-nfts
request verify -
Agency reviews:
- Blockchain NFT data
- Uploaded documents
- Government land registry records
-
If approved:
isVerified
flag on NFT metadata is set to true (on-chain + Firebase off-chain record updated).
After verification:
- NFT can be used collect loan in USDT from the contract LandLending.
With LandLending, users can borrow against their verified land NFT.
Steps:
- Navigate to
/my-nfts
- Choose:
- Loan amount
- Interest rate
- Duration
- Smart contract locks NFT in escrow.
- Borrower receives stablecoins mUSDT.
- On repayment you can either pay with BTC at a discount or USDT, NFT is released.
Every action updates Firebase for:
- Fast frontend queries
- Off-chain analytics for AI-Agent
- Backup verification trail
If disputes arise (e.g., fraudulent claim):
/verification/dispute
can be filed.- Agency or admin can revoke verification and mark NFT as disputed.
- "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.
MIT License β see LICENSE for details.
Maintainer: Your Name Email: 0xlandq@gmail.com Twitter: @xLandQ