A decentralized real estate marketplace built on Ethereum blockchain, enabling transparent and secure property transactions with smart contracts. PropChain revolutionizes property buying, selling, and ownership tracking through blockchain technology.
- Smart Contract Based: Ethereum smart contracts for trustless transactions
- Property NFTs: Each property as a unique blockchain asset
- Transparent Ownership: Complete ownership history on blockchain
- Direct P2P Transactions: No intermediaries, direct buyer-seller transactions
- Immutable Records: Tamper-proof property records
- Price Discovery: On-chain property pricing and updates
- Property Listing: List properties with details and pricing
- Property Activation: Seller-controlled listing activation/deactivation
- Direct Purchase: Instant property purchase with crypto payments
- Ownership Tracking: Full ownership history for each property
- Real-time Updates: Live blockchain event tracking
- Wallet Integration: MetaMask & Web3 wallet support
- Modern UI/UX: Built with Next.js 14 & Tailwind CSS
- Responsive Design: Mobile-first approach
- Real-time Notifications: Toast notifications for transactions
- Dark Mode: Eye-friendly dark theme support
- Interactive Charts: Property analytics with Recharts
PropChain/
├── contracts/ # Ethereum Smart Contracts
│ └── RealEstate.sol # Main marketplace contract
├── FE/PropChain/ # Next.js Frontend
│ ├── src/
│ │ ├── app/ # Next.js 14 App Router
│ │ ├── components/ # Reusable UI components
│ │ ├── services/ # API & blockchain services
│ │ ├── context/ # React Context providers
│ │ └── utils/ # Helper functions
│ └── package.json
├── BE/real-estate-backend/ # NestJS Backend API
│ ├── src/
│ │ ├── modules/ # Feature modules
│ │ ├── config/ # Configuration
│ │ └── main.ts # Entry point
│ └── package.json
├── migrations/ # Truffle migration scripts
├── truffle-config.js # Truffle configuration
└── README.md
- Solidity 0.8.13 - Smart contract development
- Truffle Suite - Smart contract compilation & deployment
- Ganache - Local blockchain for development
- Web3.js/Ethers.js - Blockchain interaction
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Shadcn/ui - Modern component library
- Ethers.js 6 - Ethereum library
- Redux Toolkit - State management
- React Query - Server state management
- Formik & Yup - Form handling & validation
- Socket.io Client - Real-time communication
- NestJS 11 - Progressive Node.js framework
- MongoDB + Mongoose - Database & ODM
- Passport JWT - Authentication
- Swagger - API documentation
- Nodemailer - Email service
- Class Validator - DTO validation
Before running PropChain, ensure you have:
- Node.js (v18 or higher)
- npm or yarn
- Ganache (for local blockchain)
- Truffle (
npm install -g truffle) - MetaMask browser extension
- MongoDB (local or Atlas)
git clone https://github.com/yourusername/PropChain.git
cd PropChain# Install Truffle globally if not installed
npm install -g truffle
# Start Ganache (in a separate terminal)
ganache-cli
# Compile smart contracts
truffle compile
# Deploy to local blockchain
truffle migrate --network development
# Copy contract ABI and address for frontendcd BE/real-estate-backend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Configure environment variables
# Add MongoDB URI, JWT secret, etc.
# Start development server
npm run start:dev
# Backend runs on http://localhost:3000cd FE/PropChain
# Install dependencies
npm install
# Create .env.local file
cp .env.example .env.local
# Configure environment variables
# Add contract address, RPC URL, etc.
# Start development server
npm run dev
# Frontend runs on http://localhost:3000# Database
MONGODB_URI=mongodb://localhost:27017/propchain
DATABASE_NAME=propchain
# JWT
JWT_SECRET=your_super_secret_jwt_key
JWT_EXPIRATION=7d
# Email (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_app_password
# Server
PORT=4000
NODE_ENV=development# API
NEXT_PUBLIC_API_URL=http://localhost:4000/api
# Blockchain
NEXT_PUBLIC_RPC_URL=http://127.0.0.1:8545
NEXT_PUBLIC_CONTRACT_ADDRESS=0x... # Your deployed contract address
NEXT_PUBLIC_CHAIN_ID=1337
# Environment
NEXT_PUBLIC_ENV=developmentfunction listProperty(
string calldata _propertyId,
uint256 _price,
string calldata _location
) externalfunction activateListing(string calldata _propertyId) externalfunction buyProperty(string calldata _propertyId) external payablefunction updatePropertyPrice(
string calldata _propertyId,
uint256 _newPrice
) externalfunction getAllPropertyIds() public view returns (string[] memory)
function getOwnershipHistory(string calldata _propertyId) public view returns (address[] memory)- Connect wallet (MetaMask)
- List property with details and price
- Property created on blockchain (pending state)
- Activate listing to make it available
- Receive payment when property is sold
- Ownership automatically transferred
- Connect wallet (MetaMask)
- Browse active property listings
- View property details & ownership history
- Purchase property with crypto payment
- Receive property ownership on blockchain
- Transaction recorded immutably
- Monitor all property transactions
- View analytics and statistics
- Manage platform settings
# Run Truffle tests
truffle test
# Test specific file
truffle test ./test/RealEstate.test.js
# Test with detailed output
truffle test --show-events- ✅ Ownership Verification: Only owners can activate/deactivate listings
- ✅ Payment Validation: Exact payment amount required
- ✅ Reentrancy Protection: Safe transfer patterns
- ✅ Access Control: Function-level permissions
- ✅ Input Validation: Smart contract & backend validation
- ✅ JWT Authentication: Secure API endpoints
- ✅ Rate Limiting: API protection (optional)
{
_id: ObjectId,
walletAddress: String (unique, indexed),
email: String,
name: String,
role: Enum ['buyer', 'seller', 'admin'],
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
propertyId: String (blockchain ID),
title: String,
description: String,
images: [String],
documents: [String],
seller: ObjectId (ref: User),
status: Enum ['pending', 'active', 'sold'],
transactionHash: String,
createdAt: Date,
updatedAt: Date
}POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/verify-otp- Verify OTP
GET /api/properties- Get all propertiesGET /api/properties/:id- Get property detailsPOST /api/properties- Create property listingPATCH /api/properties/:id- Update propertyDELETE /api/properties/:id- Delete property
GET /api/blockchain/properties- Get blockchain propertiesGET /api/blockchain/ownership/:propertyId- Get ownership historyPOST /api/blockchain/sync- Sync blockchain data
- Smart contract deployment
- Basic frontend UI
- Backend API integration
- Wallet connection
- Property listing & purchase
- Bidding system implementation
- Property fractional ownership (NFT-based)
- IPFS integration for property documents
- Multi-chain support (Polygon, BSC)
- Mobile app (React Native)
- Property inspection scheduling
- Rental marketplace
- DAO governance for platform decisions
- Integration with real-world property registries
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
- Follow ESLint & Prettier configurations
- Write tests for new features
- Update documentation
- Follow Git commit conventions
This project is licensed under the MIT License - see the LICENSE file for details.
- Ehtasham Azhar - Full Stack & Blockchain Developer - @Ehtasham24
- Truffle Suite for development tools
- Ethereum community for documentation
- Next.js team for the amazing framework
- NestJS team for the backend framework
Built with ❤️ using Blockchain Technology
⭐ Star me on GitHub — it helps!