Skip to content

Latest commit

Β 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nexfluence - Decentralized Influencer Marketing Platform

Nexfluence is a comprehensive Web3 platform that connects brands with influencers through smart contracts, AI-powered matching, and a dual-token economy (USDC + NEX) on the Polygon network.

πŸš€ Features

Dual-Token Economy

  • USDC Payments: All campaign payments processed in USDC for stability and transparency
  • NEX Utility Token: Platform governance, staking, and tier-based benefits
  • Staking System: Five-tier staking with lock periods and reward multipliers
  • Fee Discounts: Platform fee reductions based on NEX staking tier

Smart Contract System

  • Enhanced Escrow: Milestone-based payments with automated releases
  • NEX Token: ERC20 with vesting, minting controls, and transfer restrictions
  • Staking Contract: Tier-based staking with yield farming and governance power
  • Dynamic Fees: Platform fees adjusted based on user's staking tier

AI-Powered Discovery

  • Intelligent Matching: Advanced algorithms match brands with perfect influencers
  • Content Analysis: NLP-powered content analysis and sentiment detection
  • Fraud Detection: AI-based fraud detection and risk assessment
  • Performance Optimization: Data-driven recommendations for campaign success

Decentralized Storage

  • IPFS Integration: Campaign data and content stored on IPFS
  • Metadata Management: Structured metadata for profiles and campaigns
  • Content Verification: Immutable content storage and verification

πŸ—οΈ Technical Architecture

Nexfluence is built as a Next.js monolith application with the following components:

  • Frontend: Next.js 13+ with App Router and React 18
  • Database: PostgreSQL for all data storage
  • ORM: Prisma for type-safe database access
  • Authentication: JWT-based auth with wallet signatures
  • Blockchain Integration: Ethers.js for Web3 connectivity
  • AI/ML: Natural language processing for content analysis and matching
  • Storage: IPFS via Pinata for decentralized storage
  • Deployment: Docker for containerization, AWS Lightsail for hosting

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL database
  • MetaMask wallet
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/your-org/nexfluence.git
    cd nexfluence
  2. Install dependencies

    npm install
  3. Environment Setup Create a .env.local file:

    # Database
    DATABASE_URL="postgresql://postgres:postgres@localhost:5432/nexfluence?schema=public"
    
    # Authentication
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-nextauth-secret"
    JWT_SECRET="your-jwt-secret"
    
    # Blockchain Configuration
    NEXT_PUBLIC_NETWORK="amoy"
    NEXT_PUBLIC_INFLUENCER_NEXUS_ADDRESS="0x..."
    NEXT_PUBLIC_USDC_ADDRESS="0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"
    NEXT_PUBLIC_NEX_TOKEN_ADDRESS="0x..."
    NEXT_PUBLIC_STAKING_ADDRESS="0x..."
    NEXT_PUBLIC_ESCROW_V2_ADDRESS="0x..."
    PRIVATE_KEY="your-private-key"
    INFURA_PROJECT_ID="your-infura-project-id"
    POLYGONSCAN_API_KEY="your-polygonscan-api-key"
    
    # IPFS Configuration
    PINATA_API_KEY="your-pinata-api-key"
    PINATA_API_SECRET="your-pinata-api-secret"
    PINATA_JWT="your-pinata-jwt"
    PINATA_GATEWAY_URL="https://gateway.pinata.cloud"
  4. Database Setup

    # Create database schema
    npx prisma migrate dev
    
    # Seed the database with initial data
    npx prisma db seed
  5. Start Development Server

    npm run dev
  6. Build for Production

    npm run build
    npm start

🐳 Docker Deployment

Development with Docker

# Start PostgreSQL database only
docker-compose -f docker-compose.dev.yml up -d

# Run the app locally
npm run dev

Production Deployment

# Build and start all services
docker-compose up -d --build

# View logs
docker-compose logs -f

πŸ“Š Staking Tiers & Benefits

Tier Min Stake Lock Period Reward Multiplier Fee Discount Max Campaigns
Bronze 1,000 NEX 30 days 100% (5% APY) 5% 5
Silver 5,000 NEX 60 days 120% (6% APY) 10% 15
Gold 25,000 NEX 90 days 150% (7.5% APY) 15% 50
Platinum 100,000 NEX 180 days 200% (10% APY) 20% 200
Diamond 500,000 NEX 365 days 300% (15% APY) 25% 1,000

πŸ§ͺ Testing

# Run all tests
npm test

# Run specific test suite
npm test -- -t "authentication"

πŸ“ API Documentation

Authentication

Wallet Authentication

POST /api/auth/wallet
Body: { walletAddress, signature, message }

Campaigns

Get All Campaigns

GET /api/campaigns
Query: { category, minBudget, maxBudget, minFollowers, location }

Get Campaign Details

GET /api/campaigns/:id

Create Campaign

POST /api/campaigns
Body: { title, description, category, totalBudget, ... }

Apply to Campaign

POST /api/campaigns/:id/apply
Body: { proposedContent, proposedTimeline, customMessage }

Users

Get Current User

GET /api/users/me

Update Profile

PUT /api/users/profile
Body: { name, bio, location, ... }

πŸ—ΊοΈ Roadmap

Phase 1 (Current) βœ…

  • βœ… Monolith application architecture
  • βœ… Smart contract integration
  • βœ… AI-powered matching algorithm
  • βœ… IPFS content storage
  • βœ… Basic analytics dashboard

Phase 2 (Q3 2024) πŸ”„

  • πŸ”„ Mobile application
  • πŸ”„ Enhanced analytics
  • πŸ”„ Multi-chain support
  • πŸ”„ Advanced AI features
  • πŸ”„ DAO governance implementation

Phase 3 (Q4 2024) πŸ“‹

  • πŸ“‹ NFT integration for achievements
  • πŸ“‹ Advanced dispute resolution
  • πŸ“‹ Enterprise features
  • πŸ“‹ Institutional staking pools

🀝 Contributing

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

πŸ“„ License

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

πŸ™ Acknowledgments

  • OpenZeppelin: Smart contract security standards and implementations
  • Polygon: Layer 2 scaling solution for fast, low-cost transactions
  • IPFS/Pinata: Decentralized storage protocol
  • Next.js: React framework for production applications
  • Prisma: Type-safe database client
  • shadcn/ui: Beautiful and accessible component library

πŸ“ž Support


Built with ❀️ for the creator economy. Powered by Web3 technology and enhanced with dual-token economics.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages