Skip to content

vingupta22/Loop---On-Chain-Location-Bounties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loop 📍

UGAHacks XI Solana Next.js Status

Race. Explore. Win. Loop turns your city into a competitive playground. Stake SOL, race to real-world checkpoints, and be the first to claim the prize pool.

Project Banner

💡 The Problem

People don’t explore enough, and local businesses struggle to attract foot traffic. Tourism apps are passive, and loyalty programs are boring. We wanted to change that.

🚀 What is Loop?

Loop is a competitive, location-based scavenger hunt platform built on Solana. It combines the thrill of "The Amazing Race" with instant on-chain rewards and AI-generated content.

  • Stake to Play: Users stake SOL (or join free) to enter a time-limited hunt.
  • Race Real-World Locations: Players physically visit checkpoints validated via GPS.
  • Trustless Payouts: The first player to complete the route instantly claims the SOL prize pool from the vault.
  • AI-Powered: Uses Google Gemini to generate unique routes and narratives anywhere in the world.

🛠 Tech Stack

Frontend & Design

  • Framework: Next.js 16 (App Router), React 19, TypeScript
  • Styling: Tailwind CSS, Framer Motion, Shadcn UI
  • Visuals: Three.js (Interactive Globe), Leaflet (Maps)
  • Wallet: Solana Wallet Adapter

Blockchain (Solana Devnet)

  • Smart Contract: Anchor Framework (Rust)
  • Data Model: PDAs for Hunts, Vaults, and Player Progress
  • NFTs: Underdog Protocol (Badge minting)

Backend & AI

  • AI Logic: Google Gemini 2.5 Flash (Route generation)
  • Persistence: Supabase (Profiles, live location tracking, community hunts)
  • Infrastructure: Vercel (Deployment)

🏗 Architecture

Loop utilizes a hybrid architecture to ensure a seamless user experience while maintaining decentralized trust for payments.

graph TD
    User[User] -->|Connect Wallet| FE[Next.js Frontend]
    FE -->|Generate Route| AI[Google Gemini API]
    FE -->|Live Locations| SB[Supabase Realtime]
    FE -->|Stake SOL| SOL[Solana Program / Vault]
    FE -->|GPS Check-in| GPS[Geolocation API]
    GPS -->|Verify| FE
    FE -->|Claim Prize| SOL
    SOL -->|Payout| User
Loading

Key Components

  • Smart Contract (Anchor): Handles the create_hunt, join_hunt (staking), and claim_prize logic.
  • Supabase Layer: Handles user profiles, badges, and real-time WebSocket subscriptions for the "Live Player Map" (seeing opponents move in real-time).
  • Gemini AI: Dynamically creates scavenger hunts based on a city prompt (e.g., "Historic Downtown Athens").

Features

1. Active Quest Map

View checkpoints, track your distance, and see other players' live positions on the map as you race toward the finish line.

2. AI Route Generator

Don't see a hunt near you? Type in your city, and our Gemini integration will generate a 5-stop scavenger hunt with descriptions and coordinates in seconds.

3. Global Exploration

An interactive 3D globe (Three.js) allowing users to visualize available quests worldwide.

4. Solana Vaults

Prize money isn't held by us—it's held in a Program Derived Address (PDA) vault. When the winner checks in at the final spot, the smart contract releases the funds automatically.

Getting Started

Prerequisites

  • Node.js (v18+)
  • Solana CLI (for local Anchor testing)
  • Phantom Wallet (or any Solana wallet) set to Devnet

Installation

  1. Clone the repository

    git clone https://github.com/UGAHacksXI/Loop.git
    cd Loop
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Configure environment variables
    Create a .env.local file in the root directory:

    # AI Generation
    GEMINI_API_KEY=your_google_gemini_key
    
    # Solana & Payments
    NEXT_PUBLIC_SOLANA_RPC=https://api.devnet.solana.com
    NEXT_PUBLIC_VAULT_WALLET=your_demo_wallet_address
    VAULT_PRIVATE_KEY=your_private_key_array
    
    # Database
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_key
    
    # NFTs
    UNDERDOG_API_KEY=your_underdog_key
  4. Run the application

    npm run dev

    Open http://localhost:3000 with your browser.

Project Structure

UGAHacksXI/
├── app/                  # Next.js Frontend
│   ├── src/app/          # Pages (Quest, Explore, Profile)
│   ├── src/lib/          # Supabase & Solana Helpers
│   └── src/components/   # React Components (HuntMap, 3D Globe)
├── programs/wanderquest/ # Anchor Solana Program (Rust)
│   └── src/lib.rs        # Smart Contract Logic
└── Anchor.toml           # Anchor Configuration

Smart Contract Details (Devnet)

  • Program ID: WanderQuestProgram1D11111111111111111111111
  • Instructions:
    • create_hunt — Initialize a hunt and vault.
    • join_hunt — Transfer entry fee to vault.
    • check_in — Validate GPS coordinates.
    • claim_prize — Transfer vault balance to the winner.

What's Next?

  • Mobile App: Native React Native app for better background GPS tracking.
  • Sponsored Hunts: Partnerships with local businesses for coupons/discounts as checkpoints.
  • Oracles: Integrating a geo-oracle to fully decentralize the location verification process.

Team

  • Vinay Gupta
  • Eshan Jaffar
  • Vedant Lalit Bhatt
  • Ishan Voleti

License

This project is for demonstration purposes.

About

Loop — On-Chain Location Bounties

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors