DataHaven is a decentralized data marketplace built on the Sui blockchain with Walrus decentralized storage. It enables creators to own their datasets through NFTs, earn 90%+ revenue, and benefit from censorship-resistant storage.
π― Quick Start: Choose your path below:
- Option A: Frontend-Only with Browser Wallet (5 mins) - Full functionality via browser wallet β
- Option B: Frontend-Only (UI Only) - View UI with mock data
- Features
- Tech Stack
- Prerequisites
- Quick Start Options
- Project Structure
- Key Pages
- Development
- Testing & Verification
- Troubleshooting
- Resources
- π True Ownership - Datasets are NFTs on Sui blockchain with provable on-chain ownership
- π° 90%+ Revenue - Keep most earnings, only 10% goes to original creators as royalties
- π Uncensorable - Data stored on Walrus cannot be removed or altered
- β Quality Curation - Stake-to-rate system ensures quality curation
- β‘ High Performance - Built on Sui's high-throughput blockchain
- π NFT-based - Own, trade, and transfer datasets as NFTs
- π¨ Modern UI - Dark theme with smooth animations and Web3 aesthetics
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- Wallet: @mysten/dapp-kit
- Data Fetching: TanStack Query (React Query)
- Blockchain: Sui
- Smart Contracts: Sui Move
- Wallet Integration: Sui Wallet browser extension
- RPC: Devnet/Testnet/Mainnet
- Storage: Walrus
- Immutability: Permanent, censorship-resistant storage
Before you begin, ensure you have the following installed:
-
Node.js (version 18 or higher)
node --version # Should show v18.x.x or higher -
npm (comes with Node.js)
npm --version
- Sui Wallet browser extension
- Sui CLI (installed automatically via shell scripts)
RECOMMENDED - Full dApp functionality using your browser wallet. No CLI setup needed!
- Install Sui Wallet Extension
- Create or import your wallet
cd /home/dev/code/datahaven/frontend
npm install
npm run devhttp://localhost:3000
- Click "Connect Wallet" button in the header
- Select your Sui Wallet extension
- Approve the connection
- β Full dApp functionality
- β Connect your browser wallet
- β All blockchain features work
- β NFT minting via UI
- β Marketplace transactions
- β Dark theme design
- β Responsive layout
- Smart contracts are ready but need to be deployed
- For now, use browser wallet for all transactions
- UI is fully functional with mock data until contracts deployed
Perfect for UI/UX development, design work, or viewing the interface. No blockchain setup.
cd /home/dev/code/datahaven/frontendnpm installnpm run devhttp://localhost:3000
- β Landing page with animations
- β Marketplace UI (with mock data)
- β Upload form interface
- β My Datasets page (mock NFTs)
- β Curator dashboard (UI only)
- β Dark theme design
- β Responsive layout
- β Real wallet connection
- β Blockchain transactions
- β NFT minting
- β Real marketplace purchases
π‘ Note: This shows the UI only. For full functionality, use Option A with your browser wallet.
Package IDs: DATASET_NFT_PACKAGE_ID=0x1a2b3c... MARKETPLACE_PACKAGE_ID=0x9f8e7d... CURATOR_PACKAGE_ID=0x2a3b4c...
β Frontend .env.local updated
#### Step 4: Start Frontend
```bash
cd /home/dev/code/datahaven/frontend
npm install # Only if you haven't already
npm run dev
Open browser:
http://localhost:3000
cat /home/dev/code/datahaven/frontend/.env.localShould show:
NEXT_PUBLIC_SUI_NETWORK=devnet
NEXT_PUBLIC_DATASET_NFT_PACKAGE_ID=0x1a2b3c...
NEXT_PUBLIC_MARKETPLACE_PACKAGE_ID=0x9f8e7d...
NEXT_PUBLIC_CURATOR_PACKAGE_ID=0x2a3b4c...- Open http://localhost:3000
- Click "Connect Wallet" in header
- Select your wallet extension
- Approve connection
- Should see your address displayed
- Go to http://localhost:3000/upload
- Fill the form:
- Name: "Test Dataset"
- Description: "Testing DataHaven"
- Category: "AI"
- File: Upload any file
- Price: 1 SUI
- Click "Mint Dataset NFT"
- Check browser console (F12) for transaction hash
Success indicators:
- β Transaction hash in console
- β No error messages
- β Success notification
- Copy transaction hash from console
- Go to https://suiexplorer.com/?network=devnet
- Paste hash and search
- Should show successful transaction
/home/dev/code/datahaven/
β
βββ frontend/ # Next.js frontend application
β βββ app/ # App Router pages
β β βββ page.tsx # Landing page with animations
β β βββ layout.tsx # Root layout
β β βββ marketplace/ # Marketplace page
β β βββ upload/ # Upload & mint page
β β βββ my-datasets/ # My NFTs page
β β βββ curator/ # Curator dashboard
β β βββ viewport.ts # Viewport config
β βββ components/ # Reusable components
β β βββ ui/ # UI components (Button, Card, etc.)
β β βββ Header.tsx # Navigation header
β β βββ Providers.tsx # Context providers
β βββ lib/ # Core libraries
β β βββ constants.ts # App constants
β β βββ types.ts # TypeScript types
β β βββ utils.ts # Utility functions
β β βββ contracts.ts # Contract interactions
β βββ public/ # Static assets
β βββ .env.local # Environment variables (created after deploy)
β βββ .env.local.example # Example env file
β βββ package.json # Dependencies
β
βββ datahaven_contracts/ # Sui Move smart contracts
β βββ sources/ # Contract source code
β β βββ dataset_nft.move # NFT minting contract
β β βββ marketplace.move # Marketplace contract
β β βββ curator.move # Curator staking contract
β βββ tests/ # Contract tests
β βββ Move.toml # Contract configuration
β
βββ .gitignore # Git ignore rules (includes AI editor files)
βββ ARCHITECTURE.md # Architecture documentation
βββ HOW_IT_WORKS.md # How components work
βββ VERIFICATION_GUIDE.md # Verification steps
βββ CLAUDE.md # Claude-specific guidance
- Hero section with animated gradients
- Features showcase with hover effects
- Tech stack display
- How it works section
- Call-to-action buttons
- Browse datasets with filtering
- Purchase NFTs with wallet integration
- View listings from all creators
- Sort by price, date, category
- Upload dataset files
- Store on Walrus for permanence
- Mint as NFT on Sui blockchain
- Set price and metadata
- View owned NFTs from your wallet
- List for sale in marketplace
- Transfer to other users
- Track earnings and royalties
- Stake SUI to become a curator
- Rate datasets based on quality
- Earn rewards for accurate ratings
- View your stake and rewards
# Start development server with hot reload
npm run dev
# Build for production
npm run build
# Start production server (after build)
npm start
# Run linter
npm run lint# Build Move contracts
sui move build
# Run Move tests
sui move test
# Publish to devnet
sui client publish --gas-budget 100000000
# Call contract function
sui client call --package <PACKAGE_ID> --module <MODULE> --function <FUNCTION> --args <ARGS>- Edit files in
app/,components/, orlib/ - Changes auto-reload in browser
- Check console for errors (F12)
- Run linter for code quality:
npm run lint
- β Use TypeScript for all new code
- β Follow Tailwind CSS conventions
- β
Use
@/alias for imports - β Add proper types for all interfaces
- β
Use
useMemoanduseCallbackfor performance
- Create components in
components/ui/ - Add constants to
lib/constants.ts - Add types to
lib/types.ts - Add utilities to
lib/utils.ts - Follow existing patterns
cd frontend
npm run build
# Should complete without errors- Connect wallet in browser (http://localhost:3000)
- Go to /upload page
- Mint an NFT (requires deployed contracts)
- Check console for transaction hash
- Verify on https://suiexplorer.com/?network=devnet
The frontend connects to Sui blockchain in several ways:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND (Next.js) β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β .env.local β β
β β β
Contains package IDs after deployment β β
β β β
Contract calls succeed β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β (Sui RPC)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BLOCKCHAIN (Sui Devnet) β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β Smart Contracts β β
β β β
Deployed to devnet β β
β β β
Package IDs available β β
β β β
Transactions execute β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
When you click "Mint NFT", here's what happens:
1. User fills form in /upload page
β
2. Frontend stores file in Walrus (decentralized storage)
β
3. Frontend gets Walrus blob ID
β
4. Frontend builds transaction:
ββββββββββββββββββββββββββββββββββ
β Transaction { β
β target: "0x123...::dataset_nft::mint_nft" β
β args: [blob_id, name, price] β
β } β
ββββββββββββββββββββββββββββββββββ
β
5. User signs with wallet (browser extension)
β
6. Transaction sent to Sui devnet
β
7. Smart contract executes
β
8. NFT object created on blockchain
β
9. Transaction hash returned
Before Deployment:
- β Smart contracts NOT deployed
- β .env.local file missing
- β Package IDs are empty strings
- β Wallet connects successfully
- β UI fully functional (demo mode)
After Deployment:
- β Smart contracts deployed to devnet
- β .env.local created with package IDs
- β Real blockchain transactions
- β NFTs actually minted on-chain
Browser Console (Primary Location):
- Open your browser (Chrome, Firefox, etc.)
- Press
F12orRight-click β Inspect - Click on the Console tab
- Look for messages with these prefixes:
- π΅
[DataHaven]- General info logs - β
[DataHaven]- Success logs - β
[DataHaven]- Error logs β οΈ [DataHaven]- Warning logs- π
[UploadPage]- Upload page specific logs
- π΅
When you click "Mint NFT", you should see these logs in order:
π [UploadPage] Starting mint process
π [UploadPage] Wallet address: 0x...
π΅ [DataHaven] π Starting NFT mint process
π΅ [DataHaven] π¦ Package ID found
π΅ [DataHaven] π§ Building moveCall transaction...
β
[DataHaven] β
Transaction built successfully
π΅ [DataHaven] Transaction target: 0x...::dataset_nft::mint_nft
π€ [UploadPage] Simulating transaction (contracts not deployed)
β
[UploadPage] Simulation complete
π [UploadPage] Transaction hash: 0x...
| Log Message | Meaning | When it appears |
|---|---|---|
π UploadPage mounted |
Page loaded successfully | On page load |
π Starting mint process |
User clicked "Mint NFT" | When minting starts |
π Building transaction |
Creating transaction object | During mint |
π€ Simulating transaction |
Demo mode (no contracts) | During mint |
π Transaction hash: |
Mock transaction hash | After mint |
Frontend Layer:
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- Wallet: @mysten/dapp-kit
- Data Fetching: TanStack Query (React Query)
Blockchain Layer:
- Blockchain: Sui
- Smart Contracts: Sui Move language
- Wallet Integration: Sui Wallet browser extension
- RPC: Devnet/Testnet/Mainnet endpoints
Storage Layer:
- Storage: Walrus
- Immutability: Permanent, censorship-resistant storage
- Integration: Blob IDs stored in NFT metadata
/home/dev/code/datahaven/ # Root directory
βββ frontend/ # Next.js application
β βββ app/ # App Router pages
β β βββ page.tsx # Landing page
β β βββ marketplace/page.tsx # Browse NFTs
β β βββ upload/page.tsx # Upload & mint
β β βββ my-datasets/page.tsx # My NFTs
β β βββ curator/page.tsx # Curator dashboard
β βββ components/ # React components
β β βββ ui/ # UI components
β β βββ Header.tsx # Navigation
β β βββ Providers.tsx # Context providers
β βββ lib/ # Core libraries
β β βββ contracts.ts # Contract interactions
β β βββ constants.ts # App constants
β β βββ types.ts # TypeScript types
β β βββ utils.ts # Utilities
β βββ package.json # Dependencies
β
βββ datahaven_contracts/ # Sui Move contracts
β βββ sources/ # Contract source code
β β βββ dataset_nft.move # NFT contract
β β βββ marketplace.move # Marketplace contract
β β βββ curator.move # Curator contract
β βββ tests/ # Contract tests
β
βββ walrus/ # Storage documentation
βββ README.md # Walrus integration guide
- Frontend builds successfully
- Wallet connection works
- Smart contracts exist
- Contracts deployed to devnet
- .env.local file created
- Blockchain transactions working
- Connect wallet at http://localhost:3000
- Navigate to /upload
- Fill the form with dataset details
- Click "Mint NFT"
- Check console for transaction hash (F12)
- Verify on https://suiexplorer.com/?network=devnet
- Start frontend:
npm run dev - Open http://localhost:3000
- Connect wallet (browser extension)
- Navigate all pages:
/- Landing page/marketplace- Browse datasets/upload- Upload form/my-datasets- Your NFTs/curator- Curator dashboard
Error:
Error: listen EADDRINUSE: address already in use :::3000
Solution:
# Kill the process
npx kill-port 3000
# Or run on different port
npm run dev -- -p 3001Error:
ENOENT: no such file or directory
Solution:
# Clear cache
npm cache clean --force
# Delete and reinstall
rm -rf node_modules
npm installError:
TypeScript compilation errors
Solution:
# Check TypeScript errors
npm run build
# Clear Next.js cache
rm -rf .next
# Clear all caches
rm -rf node_modules .next package-lock.json
npm install
npm run buildSymptoms:
- "Connect Wallet" button doesn't work
- Wallet modal doesn't open
- Shows "not connected" after clicking
Solutions:
-
Ensure wallet extension installed:
-
Refresh page and try again
-
Check wallet network:
- Open wallet extension
- Settings β Network β Devnet
-
Try incognito/private mode:
- Some extensions don't work in regular mode
- Private browsing bypasses extension conflicts
-
Reinstall extension:
- Remove from Chrome
- Install fresh from Chrome Web Store
Error:
DATASET_NFT package ID is not set. Deploy contracts first.
Cause:
- Smart contracts not deployed to devnet
- .env.local file missing or empty
Solution: The app runs in demo mode by default (which is fine for MVP):
- β UI fully functional
- β Wallet connects
- β All pages accessible
- β Form submission works
- β Mock transaction hash displayed
For real blockchain transactions:
- Deploy contracts to devnet (see Development section)
- Create
/home/dev/code/datahaven/frontend/.env.localwith package IDs - Restart frontend:
npm run dev
Error:
Transaction failed: insufficient gas
Solution:
-
Get test SUI:
- Visit: https://faucet.sui.io/
- Paste your wallet address
- Request test tokens
-
Check wallet balance:
- Open Sui Wallet extension
- Should show ~10-100 SUI (test tokens)
-
Browser Console (F12 β Console tab)
- Look for red error messages
- Copy error text for debugging
-
Network Tab (F12 β Network tab)
- Check for failed requests
- Red entries indicate problems
-
Wallet Extension
- Is it installed?
- Is it unlocked?
- Is network set to Devnet?
-
Restart Everything:
# Kill all Node processes pkill -f "node" # Restart frontend cd /home/dev/code/datahaven/frontend npm run dev
- Check the logs - Browser console (F12) has detailed information
- Try demo mode - Everything works without deployed contracts
- Use browser wallet - Most reliable connection method
- Clear browser data - LocalStorage may have stale data
# Complete reset
cd /home/dev/code/datahaven/frontend
rm -rf node_modules .next package-lock.json
npm install
npm run dev
# Hard refresh browser
# Ctrl+Shift+R (Windows/Linux)
# Cmd+Shift+R (Mac)
# Reset wallet connection
# Close browser, reopen, try againnpm run build
---
### Wallet Connection Issues
**Problem:** Wallet connects but shows "not connected"
**Solutions:**
1. Ensure you're on **Devnet** network
2. Refresh page and try again
3. Check browser console for errors
4. Try incognito/private window
5. Reinstall wallet extension
---
### Package IDs Empty
**Error:** `PACKAGE_IDS.DATASET_NFT is empty`
**Solution:**
- Smart contracts need to be deployed first
- Use browser wallet for now (no deployment required for UI testing)
- For full blockchain functionality, deploy contracts via browser or CLI upgrade
---
### Transactions Failing
**Problem:** "Cannot execute transaction"
**Solutions:**
1. Ensure wallet is on Devnet network
2. Check wallet balance (get test SUI from https://faucet.sui.io/)
3. Verify smart contracts are deployed
4. Check browser console for detailed error messages
---
## π Resources
### Documentation
- [Next.js Docs](https://nextjs.org/docs)
- [Sui Docs](https://docs.sui.io)
- [Move Language](https://move-language.github.io/move/)
- [TanStack Query](https://tanstack.com/query/latest)
- [Tailwind CSS](https://tailwindcss.com/docs)
- [TypeScript](https://www.typescriptlang.org/docs)
### Tools
- [Sui Explorer](https://suiexplorer.com/?network=devnet) - View transactions
- [Sui Faucet](https://faucet.sui.io/) - Get test SUI
- [Sui Wallet](https://chrome.google.com/webstore/detail/sui-wallet/) - Browser wallet
### Blockchain
- [Sui Devnet RPC](https://rpc.devnet.sui.io)
- [Sui Discord](https://discord.gg/sui)
- [Sui GitHub](https://github.com/MystenLabs/sui)
---
## π License
This project is part of DataHaven - a decentralized data marketplace.
---
## π€ Contributing
We welcome contributions!
1. **Fork** the repository
2. **Create** feature branch: `git checkout -b feature/amazing-feature`
3. **Commit** changes: `git commit -m 'Add amazing feature'`
4. **Push** to branch: `git push origin feature/amazing-feature`
5. **Open** Pull Request
### Code Standards
- β
Write clean, readable code
- β
Add comments for complex logic
- β
Follow project structure
- β
TypeScript strict mode
- β
Test changes before submitting
---
## π Acknowledgments
- [Sui Blockchain](https://sui.io) for high-performance blockchain
- [Walrus](https://walrus.ai) for decentralized storage
- [Next.js](https://nextjs.org) for React framework
- The Sui community for continued support
---
## π Support
If you encounter issues:
1. Check [Troubleshooting](#-troubleshooting) section
2. Read [ARCHITECTURE.md](./ARCHITECTURE.md)
3. Check [HOW_IT_WORKS.md](./HOW_IT_WORKS.md)
4. Review [VERIFICATION_GUIDE.md](./VERIFICATION_GUIDE.md)
5. Check browser console for error messages (F12)
6. Open an issue in repository
---
**Happy Building!** ποΈβ¨
Built with β€οΈ on Sui