A blockchain-powered treasure hunting mobile application that combines real-world exploration with NFT rewards on the Sui blockchain.
- QR Code & NFC Scanning: Discover treasures by scanning QR codes or NFC tags at physical locations
- Blockchain Integration: Native Sui wallet creation and NFT minting for treasure discoveries
- Proof-of-Physical Presence (PoPP): Location verification ensures users are physically present at treasure locations
- Gamification: Ranking system from Beginner to Master Hunter with streak tracking
- Real-time Discovery: Instant NFT minting upon successful treasure discovery
- Hunter Ranks: Beginner → Explorer → Hunter → Master
- Treasure Rarity: Common, Rare, Legendary treasures with different point values
- Streak System: Daily hunt streaks with bonus rewards
- Leaderboards: Global and friends leaderboards
- Achievements: Unlock badges and milestones
- Sui Wallet Integration: Automatic wallet creation with secure key management
- NFT Collection: Each discovered treasure becomes a unique NFT
- Faucet Support: Request testnet SUI tokens for gas fees
- Transaction History: View all blockchain interactions
- Explorer Integration: View NFTs and transactions on Sui Explorer
- Cross-platform: iOS and Android support
- Responsive UI: Optimized for different screen sizes
- Dark Theme: Modern dark interface with gradient accents
- Smooth Animations: Engaging user experience with transitions
- Offline Support: Cache data for limited offline functionality
- React Native 0.75+ with TypeScript
- Expo Router for navigation
- Expo Camera for QR code scanning
- React Native NFC Manager for NFC tag reading
- AsyncStorage for local data persistence
- Google Sign-In for authentication
- Linear Gradient for UI effects
- Node.js/Express backend API
- MongoDB for treasure and user data
- Sui Blockchain for NFT minting and smart contracts
- JWT Authentication for secure API access
- Winston for comprehensive logging
- Google OAuth for user authentication
- Sui RPC for blockchain interactions
- Location Services for treasure proximity verification
- Push Notifications (planned)
- Node.js 18+
- React Native CLI
- Android Studio / Xcode
- MongoDB instance
- Sui CLI (for smart contract deployment)
git clone https://github.com/yourusername/treasure-hunt-app.git
cd treasure-hunt-app
# Install dependencies
npm install
# iOS only - install pods
cd ios && pod install && cd ..Create .env file in the root directory:
# Backend API
API_BASE_URL=https://your-backend-url.com/api/v1
# Google OAuth
GOOGLE_WEB_CLIENT_ID=your-google-web-client-id
GOOGLE_IOS_CLIENT_ID=your-google-ios-client-id
# Sui Blockchain
SUI_NETWORK=testnet
SUI_PACKAGE_ID=0x...your-package-id
TREASURE_REGISTRY_ID=0x...your-registry-id
# Encryption
ENCRYPTION_MASTER_KEY=your-32-character-encryption-keySee Backend Deployment Guide for detailed backend setup instructions.
Quick backend setup:
cd backend
npm install
cp .env.example .env
# Edit .env with your values
npm run dev# Install Sui CLI
curl -fLJO https://github.com/MystenLabs/sui/releases/download/sui-v1.15.0-release/sui-ubuntu-x86_64.tgz
tar -xzf sui-ubuntu-x86_64.tgz
sudo mv sui /usr/local/bin/
# Deploy contract
cd smart-contracts
sui client publish --gas-budget 100000000# Start Metro bundler
npm start
# Run on Android
npm run android
# Run on iOS
npm run iostreasure-hunt-app/
├── app/ # App screens (Expo Router)
│ ├── (tabs)/ # Tab navigation screens
│ │ ├── index.tsx # Home/Dashboard
│ │ ├── hunt.tsx # QR/NFC scanning
│ │ ├── gallery.tsx # NFT collection
│ │ ├── wallet.tsx # Sui wallet
│ │ └── profile.tsx # User profile
│ ├── auth/ # Authentication screens
│ ├── onboarding/ # App introduction
│ └── _layout.tsx # Root layout
├── components/ # Reusable UI components
│ └── ui/ # Basic UI components
├── contexts/ # React contexts
│ └── AuthContext.tsx # Authentication state
├── hooks/ # Custom React hooks
│ ├── useAuth.ts # Authentication logic
│ ├── useProfile.ts # User profile management
│ ├── useTreasures.ts # Treasure hunting logic
│ └── useWallet.ts # Wallet operations
├── services/ # External service integrations
│ ├── ApiService.ts # Backend API client
│ └── NFCService.ts # NFC functionality
├── backend/ # Backend API (Node.js)
│ ├── src/
│ │ ├── routes/ # API endpoints
│ │ ├── models/ # Database models
│ │ ├── services/ # Business logic
│ │ └── middleware/ # Express middleware
│ └── package.json
└── smart-contracts/ # Sui Move contracts
└── sources/
└── treasure_nft.move # Main treasure contract
- Download and open the app
- Sign in with Google
- Complete the onboarding tutorial
- Your Sui wallet is automatically created
- Use the map to find nearby treasures
- Travel to treasure locations (within 100m)
- Scan QR codes or NFC tags at the location
- Verify your location matches the treasure
- Receive instant NFT reward
- Add treasure to your collection
- Earn points and increase your rank
- Hunt daily to maintain streaks
- Unlock higher ranks for rare treasures
- Compete on global leaderboards
- Earn achievements and badges
- Daily stats and progress
- Nearby treasures map
- Quick actions and wallet balance
- Achievement highlights
- QR code camera scanner
- NFC tag reader interface
- Location verification
- Treasure discovery flow
- NFT collection display
- Treasure details and metadata
- Rarity-based filtering
- Blockchain verification status
- Sui balance and transactions
- Faucet for testnet tokens
- Address sharing and copying
- Network status indicator
- Hunter rank and progress
- Achievement badges
- Leaderboard position
- Account settings
- Database Entry: Add treasure to MongoDB via admin API
- Smart Contract: Register treasure in Sui contract
- QR/NFC Generation: Create scannable codes with treasure data
Example treasure data:
{
"treasureId": "TREASURE_001",
"name": "Golden Dragon Statue",
"description": "An ancient golden statue hidden in the mountains",
"latitude": 21.0285,
"longitude": 105.8542,
"rarity": 3,
"rewardPoints": 500,
"requiredRank": 2,
"imageUrl": "https://example.com/treasure.jpg"
}// Authentication
const { user, wallet, login, logout } = useAuth();
// Treasure hunting
const { treasures, discoverTreasure, loading } = useTreasures();
// Profile management
const { profileStats, updateProfile } = useProfile();
// Wallet operations
const { balance, transactions, requestFaucet } = useWallet();import { apiService } from '@/services/APIService';
// Get nearby treasures
const treasures = await apiService.getNearbyTreasures(lat, lng, radius);
// Discover treasure
const result = await apiService.discoverTreasure(treasureId, location, proof);
// Get NFT collection
const nfts = await apiService.getNFTCollection();- Encrypted Key Storage: Private keys encrypted with AES-256
- Location Verification: GPS + proof-of-presence validation
- JWT Authentication: Secure API communication
- Input Validation: Comprehensive data sanitization
- Rate Limiting: Protection against API abuse
Android:
cd android
./gradlew assembleRelease
# Upload APK to Google Play ConsoleiOS:
cd ios
open TreasureHunt.xcworkspace
# Archive and upload via XcodeUsing Docker:
docker build -t treasure-hunt-api .
docker run -p 3000:3000 --env-file .env treasure-hunt-apiCloud Platforms:
- Deploy to Railway, Render, or AWS
- Configure MongoDB Atlas
- Set environment variables
- Enable SSL/HTTPS
# Deploy to Sui testnet
sui client publish --gas-budget 100000000
# Save package ID and update environment variables
export SUI_PACKAGE_ID="0x..."
export TREASURE_REGISTRY_ID="0x..."cd backend
npm test
# Test specific treasure discovery
curl -X POST http://localhost:3000/api/v1/treasures/discover \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"treasureId": "TREASURE_001",
"location": {"latitude": 21.0285, "longitude": 105.8542},
"locationProof": "gps_verified"
}'-
New User Registration
- Google sign-in flow
- Wallet creation verification
- Onboarding completion
-
Treasure Discovery
- QR code scanning
- Location verification
- NFT minting process
-
Wallet Operations
- Balance checking
- Faucet requests
- Transaction history
- Ensure NFC is enabled in device settings
- Check
react-native-nfc-managerinstallation - Verify Android NFC permissions
- Grant location permissions
- Enable high accuracy GPS
- Check network connectivity
- Ensure sufficient SUI balance
- Verify network connectivity to Sui RPC
- Check smart contract deployment
# Clean builds
cd android && ./gradlew clean && cd ..
cd ios && rm -rf build && cd ..
# Reset Metro cache
npx react-native start --reset-cache
# Reinstall dependencies
rm -rf node_modules && npm install- ✅ Core treasure hunting mechanics
- ✅ Sui blockchain integration
- ✅ QR code scanning
- ✅ Basic NFT collection
- 🔄 NFC tag support enhancement
- 🔄 Social features and friend challenges
- 🔄 Push notifications for nearby treasures
- 🔄 Advanced achievement system
- 📋 AR treasure hunting mode
- 📋 Marketplace for trading NFTs
- 📋 Community-created treasures
- 📋 Cross-chain compatibility
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -m 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
- Follow TypeScript best practices
- Use provided custom hooks for state management
- Implement proper error handling
- Add comprehensive logging
- Write unit tests for new features
- Update documentation
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Documentation: Check this README and inline code comments
- Issues: Open a GitHub issue for bugs or feature requests
- Telegram: @AlvinIchikun
- Email: Nhatlapross2@gmail.com
- Sui Foundation for blockchain infrastructure
- React Native community for excellent tooling
- Expo team for simplifying mobile development
- All beta testers and contributors
Happy Treasure Hunting! 🏴☠️⚡
Made with ❤️ by the Treasure Hunt Team