Skip to content

Eras256/GigStream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🚀 GigStream

Global Real-Time Freelance Marketplace Powered by Somnia Data Streams 🌟

Vercel Somnia Testnet Contracts License

Real-time freelance marketplace powered by Somnia Data Streams & Google Gemini AI

Live DemoDocumentationSmart ContractsTeam


🏆 Somnia Data Streams Mini Hackathon Submission

Welcome to Somnia Data Streams Mini Hackathon, a global, online event taking place from November 4th to November 15th, 2025.

This project is our submission for the Somnia Data Streams Mini Hackathon, showcasing how Somnia Data Streams (SDS) transforms on-chain data into live, structured, and reactive streams. GigStream demonstrates real-time job matching, instant bid notifications, and live reputation updates—all powered by SDS SDK.

SDS (Somnia Data Streams) is a new SDK and protocol that turns on-chain data into live, structured, and reactive streams. Instead of waiting for updates or relying on oracles, developers can now get instant data directly from the blockchain.

GigStream leverages SDS to build a marketplace that reacts as things happen on-chain—jobs appear instantly, bids stream in real-time, and payments finalize in sub-seconds.


📖 Introduction

GigStream is a global, decentralized freelance marketplace that connects workers and employers worldwide through blockchain technology and artificial intelligence. Built on Somnia Network with Somnia Data Streams, GigStream enables real-time job matching, instant payments, and transparent reputation systems—all without platform fees.

The Problem

Traditional freelance platforms suffer from:

  • High fees (20-30% commission)
  • Slow payments (7-14 days)
  • Centralized control (platforms can ban users)
  • Limited transparency (reputation systems are opaque)
  • Geographic restrictions (many platforms exclude informal workers)
  • No real-time updates (polling-based, slow, inefficient)

Our Solution

GigStream leverages Somnia Network's revolutionary blockchain technology and Somnia Data Streams SDK to create a decentralized, real-time marketplace where:

  • Instant payments via smart contract escrow
  • Zero platform fees (only network gas costs)
  • Real-time job matching powered by AI and Data Streams
  • Live event streaming (no polling, instant updates)
  • Transparent reputation on-chain
  • Global accessibility for all workers worldwide

Why We Win 🏆

Metric GigStream Traditional Platforms
Market Size Global (any country/city) Limited to registered users
Transaction Speed <1 second finality 7-14 days
Fees ~0.1% (gas only) 20-30% commission
Real-time Updates Live Data Streams (400k+ TPS) Polling (slow, inefficient)
AI Integration Gemini 2.5 Flash (instant matching) Basic search algorithms
Blockchain Somnia Testnet (production-ready) Centralized databases
Data Streams Reactive, structured streams No real-time capabilities

🎯 Core Features

💼 Smart Job Marketplace

  • Post jobs with instant escrow payments
  • Real-time bidding system with live updates
  • Automatic payment release upon completion
  • Job cancellation with automatic refunds
  • Global location selection (country and city)

Somnia Data Streams Integration

  • Live job postings via Data Streams (no polling)
  • Instant bid notifications streamed in real-time
  • Real-time reputation updates as jobs complete
  • Structured data queries for efficient job discovery
  • Sub-second transaction finality on Somnia Network

🤖 AI-Powered Matching

  • Gemini 2.5 Flash analyzes job descriptions
  • Intelligent bid suggestions
  • Worker-job compatibility scoring
  • Automated job recommendations
  • Real-time market insights

🏆 On-Chain Reputation

  • Transparent reputation scores
  • Transferable reputation tokens (ERC-20)
  • Staking system for trust building
  • Immutable work history

🔒 Secure & Decentralized

  • Smart contract escrow (no middleman)
  • Multi-signature job completion
  • Transparent dispute resolution
  • Self-custody of funds

🛠️ Technology Stack

Frontend & UI

Technology Version Purpose Badge
Next.js 14.2.0 React framework with SSR Next.js
React 18.3.0 UI library React
TypeScript 5.4.0 Type-safe JavaScript TypeScript
Tailwind CSS 3.4.0 Utility-first CSS Tailwind CSS
Framer Motion 11.0.0 Animation library Framer Motion

Blockchain & Web3

Technology Version Purpose Badge
Somnia Network Testnet High-performance L1 blockchain Somnia
Somnia Data Streams SDK 0.11.0 Real-time data streaming SDS
Viem 2.40.3 TypeScript Ethereum library Viem
Wagmi 2.19.5 React Hooks for Ethereum Wagmi
Reown AppKit 1.8.14 Wallet connection (WalletConnect) Reown
Solidity 0.8.29 Smart contract language Solidity

Smart Contract Development

Technology Version Purpose Badge
Hardhat 3.0.16 Ethereum development environment Hardhat
Ethers.js 6.15.0 Ethereum JavaScript library Ethers

Artificial Intelligence

Technology Version Purpose Badge
Google Gemini 2.5 Flash/Pro AI job matching & insights Gemini
@google/generative-ai 0.24.1 Official Gemini SDK Gemini SDK

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│                      Frontend Layer                         │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │   Next.js    │  │   React 18    │  │  TypeScript   │     │
│  │   (SSR/SSG)  │  │   (Hooks)     │  │  (Type Safe)  │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
│                                                              │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │ Tailwind CSS │  │Framer Motion │  │  Radix UI     │     │
│  │  (Styling)   │  │ (Animations) │  │ (Components)  │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
└─────────────────────────────────────────────────────────────┘
                            ↕
┌─────────────────────────────────────────────────────────────┐
│                    Web3 Integration Layer                     │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │     Viem     │  │    Wagmi     │  │ Reown AppKit │     │
│  │  (Ethereum)  │  │  (React Hooks)│  │  (Wallets)   │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
└─────────────────────────────────────────────────────────────┘
                            ↕
┌─────────────────────────────────────────────────────────────┐
│              Somnia Data Streams SDK Integration              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  @somnia-chain/streams SDK 0.11.0                    │   │
│  │  • Real-time event streaming                         │   │
│  │  • Structured data queries                           │   │
│  │  • Schema registration                                │   │
│  │  • Automatic job publishing                           │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Server-Sent Events (SSE) API                         │   │
│  │  • /api/streams - Live contract events               │   │
│  │  • /api/sds/read-jobs - Structured queries           │   │
│  │  • /api/sds/publish-job - Publish to Data Streams    │   │
│  └──────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────┘
                            ↕
┌─────────────────────────────────────────────────────────────┐
│                    Blockchain Layer                          │
│  ┌──────────────────────────────────────────────────────┐   │
│  │            Somnia Network (L1 EVM)                   │   │
│  │  • Chain ID: 50312 (Shannon Testnet)                  │   │
│  │  • 400k+ TPS throughput                             │   │
│  │  • Sub-second finality                              │   │
│  │  • MultiStream Consensus                            │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐     │
│  │  GigEscrow   │  │ReputationToken│  │ StakingPool  │     │
│  │  (Main)      │  │   (ERC-20)   │  │  (Staking)   │     │
│  └──────────────┘  └──────────────┘  └──────────────┘     │
└─────────────────────────────────────────────────────────────┘
                            ↕
┌─────────────────────────────────────────────────────────────┐
│                    AI Integration Layer                       │
│  ┌──────────────────────────────────────────────────────┐   │
│  │         Google Gemini 2.5 Flash/Pro                   │   │
│  │  • Job description analysis                          │   │
│  │  • Bid optimization suggestions                      │   │
│  │  • Worker-job matching                               │   │
│  │  • Intelligent insights                              │   │
│  └──────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────┘

🚀 Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/vaiosx01/Gigstream.git
cd Gigstream

# Install dependencies
pnpm install

# Compile contracts
pnpm run contracts:compile

Configuration

  1. Copy environment variables:
cp env.example .env.local
  1. Update .env.local with your keys:
# Web3 Wallet
NEXT_PUBLIC_REOWN_PROJECT_ID=your_reown_project_id

# AI
GEMINI_API_KEY=your_gemini_api_key

# Blockchain (optional - defaults provided)
NEXT_PUBLIC_SOMNIA_RPC_URL=https://dream-rpc.somnia.network
NEXT_PUBLIC_SOMNIA_CHAIN_ID=50312

# Smart Contracts (update after deployment)
NEXT_PUBLIC_GIGESCROW_ADDRESS=0x8D742671508E1C5BFF77f3d0AE70218C8Cc57Cef
NEXT_PUBLIC_REPUTATION_TOKEN_ADDRESS=0x995759f140029e4fEabCE8F555f5536A1b413562
NEXT_PUBLIC_STAKING_POOL_ADDRESS=0x6934126deC72a3Dba22a9C5D5300620E894C72a8

Deploy Contracts

# Deploy to Somnia Testnet
pnpm run contracts:deploy-testnet

# Verify contracts on explorer
pnpm run contracts:verify

Run Development Server

pnpm run dev

Visit http://localhost:3000 🎉


📊 Deployed Contracts

All contracts are deployed on Somnia Testnet (Shannon) - Chain ID: 50312

Contract Address Explorer Description Status
GigEscrow 0x8D742671508E1C5BFF77f3d0AE70218C8Cc57Cef View on Explorer Core escrow contract for job posting, bidding, and payment management ✅ Verified
ReputationToken 0x995759f140029e4fEabCE8F555f5536A1b413562 View on Explorer ERC-20 token for reputation points, transferable and mintable ✅ Verified
StakingPool 0x6934126deC72a3Dba22a9C5D5300620E894C72a8 View on Explorer Staking contract for workers to increase trust and earn rewards ✅ Verified

Network Details:

  • Network: Somnia Testnet (Shannon)
  • Chain ID: 50312
  • RPC URL: https://dream-rpc.somnia.network
  • Explorer: Shannon Explorer

🔄 Somnia Data Streams Integration

GigStream demonstrates real-time, reactive data streaming using @somnia-chain/streams SDK 0.11.0 (official Somnia Data Streams SDK).

How We Use Somnia Data Streams

1. Real-Time Event Streaming

  • Live job postings: Jobs appear instantly via Data Streams when posted on-chain
  • Instant bid notifications: Bids stream in real-time as they're placed
  • Reputation updates: Reputation changes are streamed immediately
  • No polling required: All updates are reactive and instant

2. Structured Data Queries

  • Schema registration: Job schema registered on-chain for structured queries
  • Efficient job discovery: Query jobs by publisher, location, or status
  • Indexed data: Fast queries without scanning entire blockchain

3. Automatic Publishing

  • On-chain events trigger Data Streams: When a job is posted, it's automatically published to Data Streams
  • Structured format: Jobs are published with consistent schema for easy querying
  • Dual source display: Frontend shows jobs from both contract events and Data Streams

Implementation Details

SDK Integration:

import { SDK } from '@somnia-chain/streams'

// Initialize SDK
const sdk = new SDK({
  public: publicClient,
  private: privateClient, // For publishing
})

// Publish job to Data Streams
await publishJobToDataStream(sdk, {
  jobId: '1',
  employer: '0x...',
  title: 'Plumber needed',
  location: 'New York, US',
  reward: '500',
  deadline: '2025-12-01'
})

// Read jobs from Data Streams
const jobs = await readJobsFromDataStream(sdk, {
  publisher: '0x...',
  limit: 50
})

API Endpoints:

Real-time Event Streaming (Server-Sent Events):

GET /api/streams?type=jobs          # Job postings stream
GET /api/streams?type=bids          # Bids stream
GET /api/streams?type=completions  # Job completions stream
GET /api/streams?type=cancellations # Job cancellations stream
GET /api/streams?type=reputation    # Reputation updates stream

Data Streams API (Structured Data Queries):

GET /api/sds/read-jobs?publisher=0x...&limit=50  # Read jobs from Data Streams
POST /api/sds/publish-job                        # Publish job to Data Streams (automatic)

Supported Events

Event Description Real-time Data Streams
JobPosted New jobs appear instantly ✅ Yes ✅ Published
BidPlaced Bids stream in real-time ✅ Yes ✅ Published
JobCompleted Completion events streamed ✅ Yes ✅ Published
JobCancelled Cancellation events ✅ Yes ✅ Published
ReputationUpdated Reputation changes ✅ Yes ✅ Published

Frontend Integration

  • useSDSJobs Hook: Fetch jobs from Data Streams in React components
  • useEventStream Hook: Consume real-time Server-Sent Events streams for all event types
  • LiveEventsPanel Component: Visual panel displaying live events (JobPosted, BidPlaced, JobCompleted, JobCancelled, ReputationUpdated) in real-time
  • SDSJobsIndicator Component: Visual indicator for Data Streams availability
  • Automatic Publishing: All events automatically published to Data Streams when they occur
  • Dual Source Display: Shows jobs from both contract and Data Streams
  • Real-time Updates: All hooks listen to contract events and SSE streams for instant UI updates

🌐 Somnia Network Integration

GigStream is fully optimized for Somnia Network, a high-performance L1 blockchain:

Key Features

  • MultiStream Consensus: Parallel block production for 400k+ TPS
  • 🗄️ IceDB: Fast read/write database for deterministic execution
  • 🔄 EVM Compatibility: Full compatibility with Ethereum tooling
  • ⏱️ Sub-second Finality: Transactions finalize in <1 second
  • 💎 Native Token: SOMI (mainnet) / STT (testnet)

Network Configuration

  • Testnet: Shannon Testnet (Chain ID: 50312)
  • Mainnet: Somnia Mainnet (Live since September 2025)
  • RPC Endpoints: Configured in env.example
  • Explorer: Shannon Explorer

Smart Contract Features

  • ✅ Gas-optimized for Somnia's high-throughput EVM
  • ✅ Custom errors for better error handling
  • ✅ Event-based architecture for Data Streams
  • ✅ Reputation system on-chain
  • ✅ Escrow payments with automatic release
  • ✅ Comprehensive test coverage (95%+)

🤖 AI Features

Gemini 2.5 Integration

  • Job Description Analysis: AI-powered job categorization
  • Bid Optimization: Smart bid suggestions based on market data
  • Worker Matching: Intelligent compatibility scoring
  • Insights Panel: Real-time market analytics
  • Global Context: AI understands location-specific job markets

Model Fallback Chain

The system automatically falls back through multiple Gemini models:

  1. gemini-2.5-flash (Primary - Fastest)
  2. gemini-2.5-pro (Fallback 1 - More capable)
  3. gemini-2.0-flash (Fallback 2)
  4. gemini-1.5-flash (Fallback 3 - Stable)
  5. gemini-1.5-pro (Fallback 4 - Most capable)

📋 Contract Functions

Core Functions

Function Description Gas Optimized
postJob() Create a new job with escrow payment ✅ Yes
placeBid() Place a bid on a job ✅ Yes
acceptBid() Accept a worker's bid ✅ Yes
completeJob() Complete job and release payment ✅ Yes
cancelJob() Cancel job and refund employer ✅ Yes

View Functions

Function Description
getJob() Get job details
getJobBids() Get all bids for a job
getUserJobs() Get user's posted jobs
getWorkerJobs() Get worker's assigned jobs
reputation() Get user reputation score

🧪 Testing

Run Tests

# Unit tests
pnpm test

# E2E tests
pnpm run test:e2e

# Contract tests
pnpm run contracts:test

# Coverage
pnpm run test:coverage

Test Coverage

  • Frontend: Playwright E2E tests
  • Smart Contracts: Hardhat tests with 95%+ coverage
  • Edge Case Testing: Comprehensive test coverage
  • Integration Tests: Full workflow testing

🔐 Security

Smart Contract Security

  • Hardhat tests with 95%+ coverage
  • Custom error handling (gas-efficient)
  • Reentrancy protection
  • Access control checks
  • Comprehensive testing for edge cases
  • Gas optimization for Somnia Network

Best Practices

  • ✅ Type-safe TypeScript throughout
  • ✅ Environment variable validation
  • ✅ Input sanitization
  • ✅ Error boundary handling
  • ✅ Secure wallet connections

🏆 Hackathon Submission

Submission Requirements ✅

Judging Criteria Match

Criteria GigStream Score
Technical Excellence Hardhat + @somnia-chain/streams SDK 0.11.0 + Comprehensive tests ⭐⭐⭐⭐⭐
Real-Time UX Live streams via Data Streams, 400k+ TPS, sub-second finality ⭐⭐⭐⭐⭐
Somnia Integration 100% deployed on Somnia Testnet, verified contracts ⭐⭐⭐⭐⭐
Potential Impact Global marketplace, real market need, scalable architecture ⭐⭐⭐⭐⭐

How We Use Somnia Data Streams

  1. Real-Time Job Postings: Jobs are automatically published to Data Streams when created on-chain, enabling instant discovery without polling
  2. Live Event Streaming: All contract events (JobPosted, BidPlaced, JobCompleted, JobCancelled, ReputationUpdated) are streamed in real-time via Server-Sent Events
  3. Complete Event Publishing: Every on-chain event is automatically published to Data Streams with structured schemas, enabling efficient queries and indexing
  4. Structured Data Queries: All events can be queried efficiently by publisher, jobId, or other fields using Data Streams' structured query capabilities
  5. Reactive UI: Frontend reacts instantly to on-chain changes through Data Streams, providing a seamless real-time experience
  6. Multiple Schemas: Each event type has its own schema (Job, Bid, Completion, Cancellation, Reputation) for optimal data structure

Submission Checklist

  • ✅ 100% Functional Code (NO placeholders)
  • ✅ Somnia Testnet Deployed
  • ✅ Somnia Data Streams SDK Integrated
  • ✅ Real-time streaming implemented
  • ✅ Gemini 2.5 AI Live
  • ✅ Reown AppKit Native
  • ✅ Modern UI/UX
  • ✅ Live SDS Streams
  • ✅ E2E Tests Passing
  • ✅ Security Best Practices
  • ✅ Vercel Production Ready

📚 Documentation

Getting Started

Development

Resources


🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Policies and Guidelines

This project strictly complies with official GitHub policies. Please review and follow:

GitHub Policies We Comply With

Important: Before committing or pushing, make sure to:

  • ❌ DO NOT include API keys, passwords, or private tokens
  • ❌ DO NOT include personal user information
  • ❌ DO NOT include content that violates copyright
  • ❌ DO NOT include malicious code or spam
  • ✅ Use environment variables for credentials
  • ✅ Verify that .env.local is not in the repository

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


👥 Team

Built with ❤️ by

Developer Role GitHub
Vaiosx Full Stack Developer @vaiosx01
M0nsxx Blockchain Developer @M0nsxx

Special Thanks:

  • Somnia Network team for the amazing infrastructure and Data Streams SDK
  • Google for Gemini AI
  • The open-source community

🔗 Links

Hackathon Resources


📖 About Somnia

Somnia is a high‑performance, cost‑efficient EVM‑compatible Layer‑1 blockchain capable of processing over 1.05 million transactions per second (TPS) with sub‑second finality. It supports millions of users and enables real‑time consumer applications like games, social platforms, and metaverses — all fully on‑chain.

Somnia Data Streams (SDS) is a new SDK and protocol that turns on-chain data into live, structured, and reactive streams. Instead of waiting for updates or relying on oracles, developers can now get instant data directly from the blockchain, enabling apps that react as things happen on-chain.


⭐ Star this repo if you find it helpful!

Made with ❤️ for the Somnia Data Streams Mini Hackathon

November 4-15, 2025

⬆ Back to Top

About

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors