A decentralized platform for property tokenization and valuation using NFTs on the Ethereum blockchain.
Visit our live demo at: https://property-nft.vercel.app
Note: The demo is deployed on the Sepolia testnet. Make sure you have:
- MetaMask installed with Sepolia network configured
- Some Sepolia testnet ETH for gas fees
- Testnet ETH can be obtained from Sepolia Faucet
- Submit new properties with detailed information
- Upload property images to IPFS
- View property details including location, type, and ownership
- Track property verification status
- Community-based property verification
- Voting mechanism for property approval
- Real-time tracking of verification votes
- Status indicators for verification progress
- Professional property valuation submission
- Multiple valuation criteria:
- Location score
- Size score
- Condition score
- Age score
- Renovation score
- Community voting on valuations
- Pending and verified valuation states
- Historical valuation tracking
- 3D visualization of properties using Cesium
- Property markers with status indicators
- Community boundary visualization
- Street view integration
- Building information display
- Modern, responsive design
- Real-time status updates
- Transaction progress indicators
- Loading states and error handling
- Mobile-friendly layout
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- Shadcn UI Components
- Cesium for 3D mapping
- Ethers.js for blockchain interaction
- Solidity
- OpenZeppelin contracts
- Hardhat for development and testing
- IPFS for property images
- Ethereum blockchain for property data
- Node.js 18+
- npm or yarn
- MetaMask or other Web3 wallet
- Git
- Clone the repository:
git clone https://github.com/yourusername/property-nft.git
cd property-nft- Install dependencies:
npm install
# or
yarn install- Configure Environment Variables
Create the following environment files in the root directory:
# Smart Contract Addresses
# The deployed PropertyNFT contract address on Sepolia
NEXT_PUBLIC_PROPERTY_NFT_ADDRESS=0x1234...5678
# The deployed PropertyValuation contract address on Sepolia
NEXT_PUBLIC_PROPERTY_VALUATION_ADDRESS=0x8765...4321
# API Keys
# Your Google Maps API key for maps and street view
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=AIzaSyA1B2C3D4E5F6G7H8I9J0K1L2M3N...
# Your Cesium ion access token for 3D mapping
NEXT_PUBLIC_CESIUM_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
# IPFS Configuration
# Your Infura IPFS project ID
NEXT_PUBLIC_INFURA_IPFS_PROJECT_ID=2aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV
# Your Infura IPFS project secret
NEXT_PUBLIC_INFURA_IPFS_PROJECT_SECRET=3bC4dE5fG6hI7jK8lM9nO0pQ1rS2tU3vW
# Blockchain Network
# Sepolia testnet network ID
NEXT_PUBLIC_NETWORK_ID=11155111
# Your Infura/Alchemy RPC URL for Sepolia
NEXT_PUBLIC_RPC_URL=https://sepolia.infura.io/v3/your-project-id
# Optional: Analytics
# Your analytics service ID (e.g., Google Analytics)
NEXT_PUBLIC_ANALYTICS_ID=G-XXXXXXXXXX# Private key for local development
PRIVATE_KEY=your_private_key_here
# Infura/Alchemy API key for local development
INFURA_API_KEY=your_infura_api_key
# Optional: Etherscan API key for contract verification
ETHERSCAN_API_KEY=your_etherscan_api_key# Private key for Sepolia deployment
PRIVATE_KEY=your_private_key_here
# Infura/Alchemy API key for Sepolia
INFURA_API_KEY=your_infura_api_key
# Etherscan API key for contract verification
ETHERSCAN_API_KEY=your_etherscan_api_key
# Optional: Gas reporter configuration
REPORT_GAS=trueNote:
- Replace all placeholder values with your actual credentials
- Never commit any
.envfiles to version control- Keep your private keys secure and never share them
- For local development, you can use a test account's private key
- For production deployment, use a secure wallet's private key
- Get your Google Maps API key:
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the following APIs:
- Maps JavaScript API
- Street View Static API
- Geocoding API
- Create credentials (API key)
- Restrict the API key to:
- HTTP referrers (your domain)
- The specific APIs you enabled
- Get your Cesium ion access token:
- Sign up at Cesium ion
- Go to your Access Tokens page
- Create a new token with the following scopes:
assets:readassets:writegeocodetilesets:read
- Set up IPFS with Infura:
- Create an account at Infura
- Create a new IPFS project
- Get your Project ID and Project Secret
- Add them to your
.env.localfile
-
Set up your network:
- For development: Use Sepolia testnet (Network ID: 11155111)
- Get an RPC URL from Infura or Alchemy
- Add the network to MetaMask:
- Network Name: Sepolia Test Network
- RPC URL: Your RPC URL
- Chain ID: 11155111
- Currency Symbol: ETH
- Block Explorer URL: https://sepolia.etherscan.io
-
Run the development server:
npm run dev
# or
yarn dev- Open http://localhost:3000 in your browser
- Install Hardhat:
npm install --save-dev hardhat- Compile contracts:
npx hardhat compile- Deploy contracts:
npx hardhat run scripts/deploy.ts --network your_network- Main contract for property tokenization
- ERC721 implementation for property NFTs
- Property verification system
- Owner management
- Property valuation management
- Valuation verification system
- Score tracking for multiple criteria
- Historical valuation records
property-nft/
├── app/ # Next.js app directory
│ ├── components/ # React components
│ ├── nft/ # NFT related pages
│ ├── submit/ # Property submission page
│ └── valuation/ # Valuation related pages
├── contracts/ # Smart contracts
│ ├── PropertyNFT.sol
│ └── PropertyValuation.sol
├── scripts/ # Deployment and utility scripts
├── public/ # Static files
│ └── static/ # Cesium static files
└── test/ # Test files
- Start local blockchain:
npx hardhat node- Deploy contracts locally:
npx hardhat run scripts/deploy.ts --network localhost- Start frontend development server:
npm run dev- Follow TypeScript best practices
- Use ESLint and Prettier for code formatting
- Follow the existing component structure
- Write meaningful commit messages
- Create a new branch for each feature/fix
- Write tests for new features
- Update documentation as needed
- Create a pull request with a clear description
# Run all tests
npx hardhat test
# Run specific test file
npx hardhat test test/PropertyNFT.test.ts
# Run tests with gas reporting
REPORT_GAS=true npx hardhat test# Run unit tests
npm run test
# Run e2e tests
npm run test:e2e- Deploy to Sepolia:
npx hardhat run scripts/deploy.ts --network sepolia- Verify contracts on Etherscan:
npx hardhat verify --network sepolia DEPLOYED_CONTRACT_ADDRESS- Build the project:
npm run build- Deploy to Vercel:
vercel deployQ: Why am I getting "insufficient funds" error during deployment? A: Make sure you have enough testnet ETH in your deployment wallet.
Q: Why is the map not loading? A: Check if you have:
- Valid Cesium token in
.env.local - Proper Cesium static files in
public/static/cesium - Correct network configuration
Q: Why are property images not showing? A: Verify:
- IPFS configuration in
.env.local - IPFS gateway is accessible
- Image upload was successful
Q: Why is my transaction failing? A: Common reasons:
- Insufficient gas
- Network congestion
- Contract state mismatch
- Invalid parameters
- Use proper caching strategies
- Optimize image loading
- Implement lazy loading for map components
- Use appropriate gas optimization techniques
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin for smart contract libraries
- Cesium for 3D mapping capabilities
- IPFS for decentralized storage
- Next.js team for the amazing framework
The platform uses New Zealand Dollar (NZD) as the primary currency for all property valuations and transactions. Here's how currency is handled throughout the platform:
- All property valuations are stored and displayed in NZD
- Values are stored on-chain in Wei (1 NZD = 1e18 Wei)
- The frontend automatically converts Wei to NZD for display
- No ETH conversion is performed - values are stored directly in NZD
- Currency values are formatted using the NZD locale
- Example: "NZD 1,234,567.89"
- All monetary values in the UI are shown in NZD
- No ETH or other cryptocurrency conversions are displayed
- When submitting valuations, enter amounts in NZD
- The system will automatically convert NZD to Wei for blockchain storage
- Historical valuations are stored and displayed in NZD
- Comparable property values are also in NZD