Under Construction This DApp is in development

Front-End Integration

OmniSocial’s frontend stack is designed to be developer-friendly, modular, and easy to integrate into external applications or extend with new features.

Whether you're building a social experience, DAO dashboard, or custom interaction layer, this guide will walk you through the essential tools and patterns.

🛠️ Tech Stack Overview

  • Framework: Next.js 14 (App Router)

  • Styling: Tailwind CSS (with shadcn/ui components)

  • Wallet Integration: wagmi + viem + @rainbow-me/rainbowkit

  • Contracts: Ethers-compatible, deployed on Polygon zkEVM

  • i18n: next-i18next for localization support

  • State: Zustand for global app state

  • Animations: Framer Motion

🔗 Connecting Wallets

We use wagmi with RainbowKit to allow seamless wallet connection and transaction signing.

import { useAccount, useConnect, useDisconnect } from 'wagmi';

const WalletStatus = () => {
  const { address, isConnected } = useAccount();
  const { connect, connectors } = useConnect();
  const { disconnect } = useDisconnect();

  return (
    <div>
      {isConnected ? (
        <>
          <p>Connected: {address}</p>
          <button onClick={() => disconnect()}>Disconnect</button>
        </>
      ) : (
        connectors.map((connector) => (
          <button key={connector.id} onClick={() => connect({ connector })}>
            Connect {connector.name}
          </button>
        ))
      )}
    </div>
  );
};

🧩 Provided Components & Hooks

OmniSocial exports several reusable components and React hooks for interacting with the dApp.

🌐 Examples

  • PersonaSwitcher: Display and switch between PersonaNFTs

  • ReputationBar: Visualize user's rep across domains

  • ProposalList: Display proposals from a DAO

  • useOmniWallet(): Hook to get OmniWallet instance and execute actions

  • useCreatePersona(): Hook to mint a new PersonaNFT

  • useCastVote(): Hook to cast a vote in DAO proposal

All components follow the Tailwind utility-first design system and are fully responsive.

🧪 Calling Smart Contracts

OmniSocial uses viem under the hood for typed contract calls. Example:

Most calls are wrapped in hooks for safety and UI integration, but advanced users can import ABIs directly from /lib/contracts.

🎨 Styling & Design System

We follow a clean, minimalist aesthetic using Tailwind + shadcn/ui.

Example Tailwind snippet for a Persona Card:

You can import and customize UI primitives from:

🌍 Multi-language Support

OmniSocial uses next-i18next for localization.

Add a new language:

  1. Add your locale file to /public/locales/{lang}/common.json

  2. Update next-i18next.config.js with the new locale.

  3. Use useTranslation() hook in your components:

🚀 Quick Start: Run Frontend Locally

Make sure your .env.local contains the RPC endpoint and contract addresses:

📁 Key Directories

Path
Description

/components

React UI components (cards, layouts, etc.)

/hooks

Wagmi/viem logic and reusable calls

/pages or /app

Next.js routes

/lib/contracts

ABI and address definitions

/public/locales

i18n translation files

Last updated

Was this helpful?