Skip to content

Latest commit

ย 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PeerFlow - Decentralized Collaboration Platform on Sui

Sui Network React Move Walrus

A decentralized platform for project collaboration, freelance jobs, and on-chain messaging built on Sui blockchain.

Live Demo โ€ข Sui Explorer โ€ข Documentation


๐ŸŒŸ Features

๐Ÿ” zkLogin Authentication

  • Passwordless login via Google OAuth
  • Powered by Mysten Labs Enoki
  • Gas sponsorship for seamless UX

๐Ÿ‘ค User Profiles

  • On-chain username registration as NFT
  • Unique user identity across the platform
  • Profile verification via blockchain

๐Ÿ’ผ Project Management

  • Create and showcase projects on-chain
  • Multiple project types: Pull Requests, Hackathons, Documentation, etc.
  • Immutable proof of contributions
  • Community endorsements

๐ŸŽฏ Freelance Jobs

  • Post job listings with SUI token budgets
  • Apply for jobs with cover letters
  • Job assignment and completion tracking
  • On-chain payment settlements

๐Ÿ’ฌ On-Chain Messaging

  • Peer-to-peer encrypted messaging
  • All messages stored on Sui blockchain
  • Transaction-verified message authenticity
  • Permanent and immutable communication history

๐Ÿ† Leaderboard & Community

  • Top contributors ranking
  • Community profiles discovery
  • Achievement tracking

๐Ÿ—๏ธ Architecture

Smart Contracts (Move)

Located in /move directory:

move/
โ”œโ”€โ”€ sources/
โ”‚   โ”œโ”€โ”€ username.move       # User profile NFTs
โ”‚   โ”œโ”€โ”€ contribution.move   # Project registry
โ”‚   โ”œโ”€โ”€ messaging.move      # On-chain messaging
โ”‚   โ””โ”€โ”€ jobs.move          # Freelance job platform
โ””โ”€โ”€ tests/
    โ””โ”€โ”€ contribution_tests.move

Deployed Contracts (Testnet):

  • Main Package: 0xdb0f5cdf05d5e03ceee2c00c4bfafe7e6a95a12f198362c7080017d1c57d28fb
  • Username Registry: 0x4e893f556ca298e3ce4ce63c7e6c0f4311f6fa774b3d32f0349a59287e10b11e
  • Project Registry: 0x373ca7995f0c408bc88355504633516a4a0e0aaffd3e93c9deb9d28000232861
  • Jobs Package: 0x7051e5fc1852ef619b7b6893eb623059c47359dde27b8c35bb23f64506f78b31

Frontend (React + TypeScript)

Located in /sui-dapp directory:

sui-dapp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/       # Reusable UI components
โ”‚   โ”œโ”€โ”€ pages/           # Application pages
โ”‚   โ”œโ”€โ”€ contexts/        # React context providers
โ”‚   โ”œโ”€โ”€ hooks/           # Custom React hooks
โ”‚   โ”œโ”€โ”€ lib/             # Utilities and helpers
โ”‚   โ”œโ”€โ”€ config/          # Configuration files
โ”‚   โ””โ”€โ”€ constants/       # Application constants
โ”œโ”€โ”€ public/              # Static assets
โ””โ”€โ”€ move/               # Local Move contract reference

Tech Stack:

  • Frontend: React 18.3, Vite 7.1, TailwindCSS 3.4
  • Blockchain: @mysten/dapp-kit 0.19, @mysten/sui 1.43
  • Authentication: @mysten/enoki 0.12 (zkLogin)
  • State Management: React Query, Context API
  • UI Components: Radix UI, Lucide Icons

๐Ÿš€ Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/Myxoceph/SUI-Hackathon.git
    cd SUI-Hackathon
  2. Install frontend dependencies

    cd sui-dapp
    npm install
  3. Configure environment variables

    Create .env file in sui-dapp/ directory:

    VITE_ENOKI_PUBLIC_KEY=your_enoki_public_key
    VITE_GOOGLE_CLIENT_ID=your_google_oauth_client_id
    VITE_SUI_NETWORK=testnet

    Note: Get your Enoki API key from Mysten Labs Enoki Portal

Development

Start development server:

npm run dev

The application will be available at http://localhost:5173

Key development commands:

npm run build          # Build for production
npm run build:prod     # Production build with optimizations
npm run typecheck      # TypeScript type checking
npm run lint           # ESLint code analysis
npm run lint:fix       # Auto-fix linting issues
npm run clean          # Clean build artifacts

๐ŸŒ Deployment

Walrus Deployment

PeerFlow is deployed on Walrus, a decentralized storage network for Sui.

Deploy to Walrus (10 days):

npm run deploy:walrus

Deploy to Walrus (30 days):

npm run deploy:walrus:30d

Manual deployment:

# Build production bundle
npm run build:prod

# Publish to Walrus
site-builder publish --epochs 10 dist/

After deployment, your site will be accessible at:

https://{site-id}.trwal.app/

Vercel/Netlify Deployment

The app can also be deployed to traditional hosting platforms:

  1. Build the project: npm run build
  2. Deploy the dist/ directory
  3. Configure environment variables in hosting dashboard

๐ŸŽฎ Usage Guide

1. Connect Wallet

  • Click "Connect Wallet" button
  • Choose Google OAuth for zkLogin
  • Grant permissions

2. Create Profile

  • Enter a unique username (3-20 characters)
  • Username is minted as an NFT on-chain
  • Gas fees sponsored by Enoki

3. Create a Project

  • Navigate to "Contribute" page
  • Fill in project details:
    • Type (Pull Request, Hackathon, etc.)
    • Title and description
    • Proof link (GitHub, etc.)
  • Submit transaction

4. Post a Job

  • Go to "Jobs" page
  • Click "Post New Job"
  • Specify:
    • Job title and description
    • Required skills
    • Budget in SUI tokens
  • Confirm transaction

5. Send Messages

  • Navigate to "Messages" page
  • Click "New Chat"
  • Enter recipient's SUI address
  • Start on-chain messaging

6. Explore Projects

  • Browse all projects in "Explore" page
  • Endorse projects you like
  • View project details on-chain

๐Ÿ“– Documentation

Smart Contract Functions

Username Module

public entry fun register_username(
    registry: &mut UsernameRegistry,
    username: String,
    ctx: &mut TxContext
)

Contribution Module

public entry fun create_project(
    registry: &mut ProjectRegistry,
    project_type: String,
    title: String,
    description: String,
    proof_link: String,
    ctx: &mut TxContext
)

public entry fun endorse_project(
    registry: &mut ProjectRegistry,
    project_id: ID,
    ctx: &mut TxContext
)

Jobs Module

public entry fun create_job(
    registry: &mut JobRegistry,
    title: String,
    description: String,
    tags: vector<String>,
    budget_sui: u64,
    ctx: &mut TxContext
)

public entry fun assign_job(
    registry: &mut JobRegistry,
    job_id: ID,
    worker: address,
    ctx: &mut TxContext
)

Gas Budget Configuration

All transactions have optimized gas budgets:

Transaction Type Gas Budget
Username Registration 0.05 SUI
Create Project 0.05 SUI
Create Job 0.05 SUI
Endorse Project 0.03 SUI
Apply for Job 0.03 SUI
Assign Job 0.03 SUI
Send Message 0.02 SUI

๐Ÿ”ง Configuration

Enoki Gas Sponsorship

To enable automatic gas sponsorship:

  1. Visit Enoki Portal
  2. Navigate to Gas Sponsorship section
  3. Add Move Call Targets:
    0xdb0f5cdf05d5e03ceee2c00c4bfafe7e6a95a12f198362c7080017d1c57d28fb::username::register_username
    0xdb0f5cdf05d5e03ceee2c00c4bfafe7e6a95a12f198362c7080017d1c57d28fb::contribution::create_project
    0x7051e5fc1852ef619b7b6893eb623059c47359dde27b8c35bb23f64506f78b31::jobs::create_job
    
  4. Click SAVE

Network Configuration

The app defaults to Sui Testnet. To change networks:

// sui-dapp/src/config/networkConfig.js
export const networkConfig = createNetworkConfig({
  testnet: { url: getFullnodeUrl("testnet") },
  mainnet: { url: getFullnodeUrl("mainnet") },
});

๐Ÿงช Testing

Frontend Tests

npm run test

Smart Contract Tests

cd move
sui move test

Manual Testing Checklist

  • Wallet connection (zkLogin)
  • Username registration
  • Project creation
  • Job posting
  • Message sending
  • Transaction confirmations
  • Error handling

๐Ÿ› ๏ธ Troubleshooting

Common Issues

1. "No valid gas coins found"

  • Solution: Get testnet SUI from Sui Faucet
  • Or ensure Enoki sponsorship is configured correctly

2. "Username already taken"

  • Solution: Try a different username
  • Check on-chain registry for availability

3. Black screen after deployment

  • Solution: Clear browser cache
  • Check browser console for errors
  • Verify environment variables

4. Transaction failures

  • Solution: Check gas budget
  • Verify wallet has sufficient balance
  • Ensure network connectivity

๐Ÿ“ Project Structure

SUI-Hackathon/
โ”œโ”€โ”€ move/                          # Move smart contracts
โ”‚   โ”œโ”€โ”€ sources/
โ”‚   โ”‚   โ”œโ”€โ”€ username.move
โ”‚   โ”‚   โ”œโ”€โ”€ contribution.move
โ”‚   โ”‚   โ”œโ”€โ”€ messaging.move
โ”‚   โ”‚   โ””โ”€โ”€ jobs.move
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ Move.toml
โ”‚
โ”œโ”€โ”€ sui-dapp/                      # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/           # UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Chat.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Navbar.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ UsernameSetup.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ui/              # Radix UI components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/               # Application pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Explore.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Jobs.jsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Messages.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Passport.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ contexts/            # React contexts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ WalletContext.jsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ MessagingContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/               # Custom hooks
โ”‚   โ”‚   โ”œโ”€โ”€ lib/                 # Utilities
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ suiTransactions.js
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ jobTransactions.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ userProfile.js
โ”‚   โ”‚   โ”œโ”€โ”€ config/              # Configuration
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ contracts.js
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ networkConfig.js
โ”‚   โ”‚   โ””โ”€โ”€ constants/           # Constants
โ”‚   โ”œโ”€โ”€ public/                  # Static assets
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ vite.config.mts
โ”‚
โ””โ”€โ”€ README.md                     # This file

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  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

Development Guidelines

  • Follow existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

๐Ÿ“„ License

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


๐Ÿ”— Links


๐Ÿ‘ฅ Team

AYS Team

  • Decentralized collaboration platform built for the Sui Hackathon 2025

๐Ÿ™ Acknowledgments


Built with โค๏ธ on Sui blockchain

โฌ† Back to Top

About

SUI Hackathon start

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages