Skip to content

Latest commit

ย 

History

100 Commits

Folders and files

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

Repository files navigation

๐ŸŒ Celo Engage Hub - Social Engagement Platform

https://img.shields.io/badge/Celo-Mainnet-gold https://img.shields.io/badge/License-MIT-yellow.svg https://img.shields.io/github/stars/tebberen/celo-engage-hub https://img.shields.io/github/forks/tebberen/celo-engage-hub https://img.shields.io/github/issues/tebberen/celo-engage-hub https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Ftebberen%2Fcelo-engage-hub

Social TX - Where Every Interaction Builds Real Value A decentralized social engagement platform built on Celo blockchain that rewards meaningful community interactions through governance, badges, and social verification.

๐Ÿ“‘ Table of Contents

ยท ๐ŸŒŸ Introduction ยท ๐Ÿš€ Features ยท ๐Ÿ—๏ธ Architecture ยท ๐Ÿ“ฆ Installation ยท ๐ŸŽฎ Quick Start ยท ๐Ÿ”ง Smart Contracts ยท ๐Ÿ› ๏ธ Development ยท ๐Ÿงช Testing ยท ๐Ÿ“š API Documentation ยท ๐ŸŒ Deployment ยท ๐Ÿค Contributing ยท ๐Ÿ“ License ยท ๐Ÿ™ Acknowledgments Base

๐ŸŒŸ Introduction

Celo Engage Hub is a groundbreaking social platform that leverages blockchain technology to create a trustless, community-driven ecosystem. Built on the Celo network, it combines social interactions with on-chain governance and reputation systems.

๐ŸŽฏ Problem Statement

Traditional social platforms suffer from:

ยท Centralized control and censorship ยท Lack of transparency in content moderation ยท No real ownership or rewards for users ยท Limited community governance

๐Ÿ’ก Our Solution

ยท Decentralized Governance: Community-driven proposal and voting system ยท Social Verification: Support-based content curation ยท Monetization & Rewards: Badge-based achievement system ยท Transparent Operations: Fully on-chain interactions

๐Ÿš€ Features

๐Ÿ›ก๏ธ Social Verification System

ยท Support-Based Submission: Users must support existing content before submitting their own ยท Community Curation: Content visibility determined by community engagement ยท Anti-Spam Mechanism: Limits and verification prevent platform abuse

๐Ÿ›๏ธ On-Chain Governance

ยท Proposal Creation: Any user can create governance proposals ยท Transparent Voting: Verifiable on-chain voting with Celo transactions ยท Community Decisions: Platform evolution driven by user votes

๐ŸŽ–๏ธ Badge & Reputation System

ยท Achievement Tracking: Earn badges for platform participation ยท Reputation Scoring: Build reputation through quality contributions ยท Soulbound Tokens: Non-transferable achievement badges (future)

๐Ÿ’ฐ Gas Optimization

ยท Efficient Transactions: Optimized for Celo's low-gas environment ยท Batch Operations: Multiple actions in single transactions ยท Gas Estimation: Accurate gas prediction for better UX

๐ŸŒ Multi-Platform Integration

ยท Social Media Links: Support for X, Farcaster, GitHub, and more ยท Cross-Platform Verification: Unified identity across platforms ยท Content Syndication: Share across multiple platforms seamlessly

๐Ÿ” Advanced Wallet Integration

ยท MetaMask Support: Full MetaMask compatibility ยท Celo Native Wallets: Support for Valora, Celo Wallet ยท Network Switching: Automatic Celo network detection and switching

๐Ÿ—๏ธ Architecture

System Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Frontend      โ”‚    โ”‚   Smart Contract โ”‚    โ”‚   Celo Network  โ”‚
โ”‚   (Client)      โ”‚    โ”‚   (Middleware)   โ”‚    โ”‚   (Blockchain)  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ€ข HTML/CSS/JS   โ”‚โ—„โ”€โ”€โ–บโ”‚ โ€ข User Registry  โ”‚โ—„โ”€โ”€โ–บโ”‚ โ€ข Transactions  โ”‚
โ”‚ โ€ข Ethers.js     โ”‚    โ”‚ โ€ข Governance     โ”‚    โ”‚ โ€ข Smart Contractsโ”‚
โ”‚ โ€ข LocalStorage  โ”‚    โ”‚ โ€ข Badge System   โ”‚    โ”‚ โ€ข CELO/cUSD     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Technology Stack

ยท Frontend: HTML5, CSS3, Vanilla JavaScript (ES6+) ยท Blockchain: Celo Network (Mainnet & Alfajores Testnet) ยท Web3 Library: Ethers.js v5.7.2 ยท Wallet Integration: MetaMask, Celo-Compatible Wallets ยท Storage: Browser LocalStorage + On-chain Storage ยท Styling: Custom CSS with Celo Brand Colors

Smart Contract Architecture

// Core Contract Structure
CeloEngageHub.sol
โ”œโ”€โ”€ UserRegistry
โ”‚   โ”œโ”€โ”€ registerUser()
โ”‚   โ”œโ”€โ”€ updateProfile()
โ”‚   โ””โ”€โ”€ getUserProfile()
โ”œโ”€โ”€ Governance
โ”‚   โ”œโ”€โ”€ createProposal()
โ”‚   โ”œโ”€โ”€ voteProposal()
โ”‚   โ””โ”€โ”€ getProposalDetails()
โ”œโ”€โ”€ BadgeSystem
โ”‚   โ”œโ”€โ”€ awardBadge()
โ”‚   โ”œโ”€โ”€ getUserBadges()
โ”‚   โ””โ”€โ”€ checkEligibility()
โ””โ”€โ”€ Utilities
    โ”œโ”€โ”€ checkUserActive()
    โ””โ”€โ”€ getPlatformStats()

๐Ÿ“ฆ Installation

Prerequisites

ยท Node.js (v16 or higher) ยท npm or yarn ยท MetaMask or Celo-compatible wallet ยท Celo tokens for gas fees

Step-by-Step Installation

# 1. Clone the repository
git clone https://github.com/tebberen/celo-engage-hub.git

# 2. Navigate to project directory
cd celo-engage-hub

# 3. Install dependencies (if any added in future)
npm install

# 4. Start local development server
npm run dev

# 5. Open browser and navigate to
# http://localhost:3000

Docker Installation (Optional)

# Build Docker image
docker build -t celo-engage-hub .

# Run container
docker run -p 3000:3000 celo-engage-hub

๐ŸŽฎ Quick Start

For End Users

  1. Connect Your Wallet ยท Click "Connect MetaMask" button ยท Approve connection request ยท Switch to Celo Mainnet when prompted
  2. Support Community Content ยท Browse existing links in the support section ยท Click "Support This Content" on at least one item ยท This unlocks your submission privileges
  3. Submit Your Content ยท Enter your social media link (X, Farcaster, GitHub, etc.) ยท Confirm transaction in your wallet ยท Pay gas fee (typically < $0.01 on Celo)
  4. Participate in Governance ยท Create proposals for platform improvements ยท Vote on active proposals ยท Shape the future of the platform
  5. Earn Badges ยท Receive badges for active participation ยท Build your reputation score ยท Unlock special privileges

For Developers

// Quick integration example
const engageHub = {
  connect: async () => {
    if (typeof window.ethereum !== 'undefined') {
      await window.ethereum.request({ method: 'eth_requestAccounts' });
      const provider = new ethers.providers.Web3Provider(window.ethereum);
      return provider.getSigner();
    }
  },
  
  submitLink: async (link) => {
    const contract = new ethers.Contract(CONTRACT_ADDRESS, ABI, signer);
    const tx = await contract.registerUser("username", link);
    return await tx.wait();
  }
};

๐Ÿ”ง Smart Contracts

Contract Addresses

ยท Mainnet: 0x22eA49c074098931a478F381f971C77486d185b2 ยท Alfajores Testnet: Deploying Soon

Core Functions

User Management

function registerUser(string memory _username, string memory _link) public
function updateProfile(string memory _username, string memory _link) public
function getUserProfile(address _user) public view returns (
    string memory link,
    string memory username, 
    uint256 supportCount,
    uint256 reputation,
    uint256 badgeCount,
    bool isActive,
    uint256 timestamp
)

Governance

function createProposal(string memory _title, string memory _description) public
function voteProposal(uint256 _proposalId, bool _support) public
function getActiveProposals() public view returns (uint256[] memory)
function getProposalDetails(uint256 _proposalId) public view returns (
    uint256 id,
    string memory title,
    string memory description,
    address creator,
    uint256 votesFor,
    uint256 votesAgainst,
    uint256 deadline,
    bool executed
)

Badge System

function awardBadge(address _user, string memory _badge) public
function getUserBadges(address _user) public view returns (string[] memory)
function revokeBadge(address _user, string memory _badge) public

Events

event UserRegistered(address indexed user, string username);
event ProposalCreated(uint256 indexed proposalId, string title, address creator);
event Voted(uint256 indexed proposalId, address indexed voter, bool support);
event BadgeAwarded(address indexed user, string badge);

๐Ÿ› ๏ธ Development

Setting Up Development Environment

  1. Fork the Repository
    # Fork on GitHub, then clone your fork
    git clone https://github.com/YOUR_USERNAME/celo-engage-hub.git
    cd celo-engage-hub
  2. Install Development Dependencies
    npm install --save-dev live-server gh-pages
  3. Run Development Server
    npm run dev

Building for Production

# Build optimized version
npm run build

# Deploy to GitHub Pages
npm run deploy

Code Structure

src/
โ”œโ”€โ”€ index.html              # Main application entry point
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ style.css           # All styles and responsive design
โ”œโ”€โ”€ js/
โ”‚   โ”œโ”€โ”€ app.js              # Main application logic
โ”‚   โ”œโ”€โ”€ wallet.js           # Wallet connection and management
โ”‚   โ”œโ”€โ”€ contract.js         # Smart contract interactions
โ”‚   โ””โ”€โ”€ ui.js               # User interface controls
โ”œโ”€โ”€ contracts/
โ”‚   โ””โ”€โ”€ CeloEngage.sol      # Smart contract source
โ””โ”€โ”€ tests/
    โ””โ”€โ”€ test.js             # Test suites

๐Ÿงช Testing

Smart Contract Testing

# Run contract tests
npx hardhat test

# Run tests with coverage
npx hardhat coverage

Frontend Testing

// Example test case
describe('Celo Engage Hub', () => {
  it('should connect wallet successfully', async () => {
    const result = await connectWallet();
    expect(result).toBe(true);
  });

  it('should submit link with proper validation', async () => {
    const link = 'https://github.com/tebberen';
    const result = await submitLink(link);
    expect(result.status).toBe('success');
  });
});

Integration Testing

# Run full test suite
npm test

# Run specific test group
npm run test:contracts
npm run test:frontend

๐Ÿ“š API Documentation

JavaScript SDK

Initialization

import CeloEngageHub from 'celo-engage-hub';

const hub = new CeloEngageHub({
  network: 'mainnet', // or 'alfajores'
  contractAddress: '0x22eA49c074098931a478F381f971C77486d185b2'
});

Core Methods

connectWallet()

// Connect user's wallet
const userAddress = await hub.connectWallet();

submitContent(link, platform)

// Submit new content
const result = await hub.submitContent(
  'https://github.com/tebberen',
  'github'
);

getUserProfile(address)

// Get user profile
const profile = await hub.getUserProfile('0x...');

REST API (Future)

# Get platform statistics
GET /api/stats

# Get user profile
GET /api/users/:address

# Get active proposals
GET /api/proposals/active

๐ŸŒ Deployment

GitHub Pages Deployment

The project is automatically deployed to GitHub Pages:

ยท Live URL: https://tebberen.github.io/celo-engage-hub/ ยท Branch: main ยท Auto-deploy: On every push to main

Manual Deployment

# Build project
npm run build

# Deploy to any static hosting
# Netlify, Vercel, AWS S3, etc.

Smart Contract Deployment

# Deploy to Celo Mainnet
npx hardhat run scripts/deploy.js --network celo

# Deploy to Alfajores Testnet
npx hardhat run scripts/deploy.js --network alfajores

๐Ÿค Contributing

We love your input! We want to make contributing to Celo Engage Hub as easy and transparent as possible.

How to Contribute

  1. Fork the repo and create your branch from main
  2. Make your changes and test thoroughly
  3. Follow our code style and add tests if applicable
  4. Submit a pull request with clear description of changes

Development Workflow

# Create feature branch
git checkout -b feature/amazing-feature

# Make changes and commit
git add .
git commit -m "feat: add amazing feature"

# Push and create PR
git push origin feature/amazing-feature

Reporting Bugs

ยท Use the GitHub Issues template ยท Describe the bug and steps to reproduce ยท Include browser/device information

Suggesting Enhancements

ยท Open an issue with enhancement label ยท Explain the proposed feature ยท Discuss implementation approach

๐Ÿ“ License

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

Permitted Use:

ยท โœ… Commercial use ยท โœ… Modification ยท โœ… Distribution ยท โœ… Private use

Requirements:

ยท โ„น๏ธ License and copyright notice preservation

๐Ÿ™ Acknowledgments

Core Team

ยท tebberen - Project Lead & Full-stack Development

Special Thanks

ยท Celo Foundation for ecosystem support and builder rewards ยท Celo Community for testing, feedback, and support ยท Builder Rewards Program for incentivizing quality development

Technologies & Tools

ยท Celo Blockchain - Green, mobile-first blockchain ยท Ethers.js - Complete Ethereum wallet implementation ยท MetaMask - Crypto wallet & gateway to blockchain apps ยท GitHub Pages - Static site hosting

Inspiration

This project draws inspiration from:

ยท Social media platforms with community governance ยท Blockchain-based reputation systems ยท DAO (Decentralized Autonomous Organization) models


โญ If this project helped you, please give it a star!

https://img.shields.io/github/stars/tebberen/celo-engage-hub?style=social https://img.shields.io/github/forks/tebberen/celo-engage-hub?style=social

Built with โค๏ธ for the Celo Ecosystem

---

About

Community engagement platform on Celo blockchain with support-first model and governance

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages