A full-stack NFT marketplace and rental platform built with Next.js, Solidity, and IPFS integration. Users can mint, buy, sell, and rent NFTs with advanced features like royalties, platform fees, and decentralized metadata storage.
- π¨ NFT Minting: Create NFTs with metadata stored on IPFS
- π Buy/Sell: Traditional NFT marketplace functionality
- π NFT Rental: Unique rental system with time-based access
- π° Royalty System: Creator royalties on secondary sales
- π Platform Fees: Configurable marketplace fees
- π IPFS Integration: Decentralized metadata and image storage
- β‘ Modern Stack: Next.js 15 with App Router and React 19
- π¨ Beautiful UI: TailwindCSS with custom Sanchez font
- π 3D Graphics: Three.js and GSAP animations
- π Web3 Integration: Thirdweb SDK for blockchain interactions
- π± Responsive Design: Mobile-first with bottom navigation
- π Dark Mode: Theme switching support
- π Secure: OpenZeppelin contracts for security
nft-marketplace/
βββ marketplace-contracts/ # Smart contracts
β βββ contracts/
β β βββ MyContract.sol # NFT Marketplace contract
β βββ hardhat.config.js # Hardhat configuration
β βββ scripts/
β βββ verify/
β βββ my-contract.js # Contract verification
β
βββ nft-website/ # Frontend application
βββ src/
β βββ app/ # Next.js App Router
β β βββ create/ # NFT creation page
β β βββ home/ # Main app pages
β β β βββ buy/ # Buy NFTs
β β β βββ rent/ # Rent NFTs
β β β βββ wallet/ # User wallet
β β β βββ create/ # Mint NFTs
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Landing page
β βββ components/ # Reusable components
β β βββ ui/ # UI components
β β βββ infinite-hero.tsx # 3D hero section
β β βββ bottomNavBar.tsx # Navigation
β βββ lib/
β β βββ pinata.ts # IPFS utilities
β βββ constants.ts # Contract addresses
βββ package.json
- Node.js 18+
- npm or pnpm
- Wallet (MetaMask recommended)
- Pinata account for IPFS
git clone https://github.com/Vishal-770/nft-marketplace.git
cd nft-marketplacecd marketplace-contracts
npm install
# Deploy contract (using Thirdweb)
npm run deploycd ../nft-website
npm install
# Create environment file
cp .env.local.example .env.local# nft-website/.env.local
NEXT_PUBLIC_THIRD_WEB_CLIENT_ID=your_thirdweb_client_id
NEXT_PUBLIC_THIRD_WEB_KEY=your_thirdweb_secret_key
NEXT_PUBLIC_PINATA_JWT=your_pinata_jwt_token
NEXT_PUBLIC_PINATA_GATEWAY=gateway.pinata.cloud// src/constants.ts
export const contractAddress = "YOUR_DEPLOYED_CONTRACT_ADDRESS";npm run devVisit http://localhost:3000 to see the application.
- Image Upload: Drag-and-drop file upload with preview
- Metadata Form: Name, description, and attributes
- IPFS Storage: Automatic upload to Pinata
- Dynamic Traits: Add up to 5 custom attributes
- Real-time Validation: Form validation with error handling
- Buy Page: Browse and purchase NFTs
- Rent Page: Rent NFTs for specified durations
- Create Page: Mint new NFTs on blockchain
- Wallet Page: View owned and rented NFTs
- 3D Hero Section: WebGL shaders and animations
- Dark/Light Mode: System-aware theming
- Mobile Navigation: Bottom tab bar for mobile users
- Loading States: Smooth loading indicators
- Toast Notifications: Success/error feedback
Address: 0xf8947e481D2477349d157700b971d490766ce5B7
Network: Sepolia Testnet
Standard: ERC721 + ERC2981 (Royalties)
function mintNFT(string memory _hash, uint256 royaltyPercent) external- Creates new NFT with IPFS metadata hash
- Sets creator royalties (max 10%)
function listNFTForSale(uint256 tokenId, uint256 priceInWei) external
function listNFTForRent(uint256 tokenId, uint256 pricePerDayInWei, uint256 minDurationInHours, uint256 maxDurationInHours) external
function buyNFT(uint256 tokenId) external payable
function rentNFT(uint256 tokenId, uint256 durationInHours) external payable- Ownership Retention: Original owner keeps NFT during rental
- Time-based Access: Renter gets access for specified duration
- Automatic Expiry: Rental ends automatically
- Transfer Protection: Prevents transfers during rental period
- Platform Fee: 2.5% (configurable by owner)
- Creator Royalties: 0-10% (set by creator)
- Gas Optimization: Efficient batch operations
- Framework: Next.js 15.5.3 with App Router
- Language: TypeScript 5.0
- Styling: TailwindCSS 4.0
- UI Components: Radix UI primitives
- 3D Graphics: Three.js + React Three Fiber
- Animations: GSAP with SplitText
- Forms: React Hook Form
- Web3: Thirdweb SDK 5.106.0
- IPFS: Pinata SDK 2.5.0
- Language: Solidity 0.8.20
- Framework: Hardhat
- Standards: ERC721, ERC2981, Ownable
- Security: OpenZeppelin contracts
- Deployment: Thirdweb deployment tools
- Network: zkSync Sepolia Testnet
- Package Manager: npm/pnpm
- Linting: ESLint
- Bundler: Turbopack (Next.js)
- Version Control: Git
- OpenZeppelin: Battle-tested contract implementations
- Reentrancy Protection: Built-in guards
- Access Control: Owner-only administrative functions
- Transfer Locks: Prevents transfers during rental
- Overflow Protection: SafeMath equivalent in Solidity 0.8+
- Environment Variables: Secure API key management
- Input Validation: Client and server-side validation
- File Type Validation: Image upload restrictions
- Size Limits: 10MB max file size for uploads
- Platform Fees: 2.5% on all sales and rentals
- Premium Features: Enhanced listing options
- Creator Tools: Advanced analytics and promotion
Sale Price: 100 ETH
βββ Creator Royalty: 5 ETH (5%)
βββ Platform Fee: 2.5 ETH (2.5%)
βββ Seller Receives: 92.5 ETH (92.5%)
- Smart contract development
- Basic marketplace functionality
- NFT rental system
- IPFS integration
- Frontend development
- Advanced search and filtering
- Collection management
- Bulk operations
- Analytics dashboard
- Mobile app
- Cross-chain support
- DAO governance
- Creator verification
- Advanced rental features
- Marketplace API
We welcome contributions! Please see our Contributing Guidelines for details.
# Fork the repository
git clone https://github.com/YOUR_USERNAME/nft-marketplace.git
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes and commit
git commit -m "Add amazing feature"
# Push to branch
git push origin feature/amazing-feature
# Open a Pull RequestThis project is licensed under the MIT License - see the LICENSE file for details.
- Smart Contracts: Contract Documentation
- Frontend: Frontend Documentation
- API Reference: API Documentation
- Discord: Join our community
- Twitter: @NFTMarketplace
- Telegram: NFT Marketplace Chat
Found a bug? Have a feature request? Please create an issue.
- OpenZeppelin: For secure smart contract templates
- Thirdweb: For Web3 development tools
- Pinata: For IPFS infrastructure
- Vercel: For deployment platform
- Next.js Team: For the amazing framework
Made with β€οΈ by Vishal
Building the future of digital asset ownership and accessibility.