
Decentralized news verification platform and public-good interface for community-driven fact-checking across Ethereum and Stellar ecosystems.
The TruthBounty Frontend is designed to make decentralized news verification accessible, transparent, and usable for everyone β not just blockchain experts.
It provides a clean, intuitive interface for:
- Submitting and verifying news claims
- Understanding verification outcomes
- Tracking reputation and rewards
- Participating in truth verification as a public good
This frontend translates complex cryptoeconomic systems into a human-centered experience.
- β Submit & Verify Claims - Community-driven fact-checking interface
- π― Reputation Dashboard - Real-time reputation scoring and leaderboard
- π Token Rewards - Track and claim ERC-20 rewards on Optimism
- π Worldcoin Authentication - Sybil-resistant identity verification
- π IPFS Evidence Viewer - Decentralized evidence storage and retrieval
- π Dark/Light Mode - Customizable user experience
- π± Responsive Design - Mobile-first, accessible UI
- β‘ Real-time Updates - Live verification status and notifications
- User connects wallet (Ethereum / Stellar β planned)
- User authenticates via Worldcoin ID
- News claims are submitted or reviewed
- Verifications are performed with evidence
- Reputation updates in real time
- Rewards are tracked and claimed on-chain
TruthBounty Frontend is aligned with open-source and public-good ecosystems:
- Ethereum & Optimism β secure, scalable reward settlement
- Stellar (planned) β low-cost access and global participation
- IPFS β decentralized evidence access
- Worldcoin ID β Sybil-resistant identity
- Drips Network β sustainable open-source maintenance
The UI is intentionally chain-agnostic, enabling seamless expansion across ecosystems without redesign.
| Technology | Purpose |
|---|---|
| Next.js 14+ | React framework with App Router |
| TypeScript | Type-safe development |
| TanStack Query | Server state management & caching |
| Context API | Global state management |
| Tailwind CSS | Utility-first styling |
| Technology | Purpose |
|---|---|
| Wagmi | React hooks for Ethereum |
| Viem | TypeScript Ethereum library |
| RainbowKit | Wallet connection UI |
| Worldcoin ID | Sybil-resistant authentication |
| IPFS HTTP Client | Decentralized storage access |
| Technology | Purpose |
|---|---|
| Docker | Containerization |
| GitHub Actions | CI/CD pipeline |
| Vercel | Deployment platform |
- Node. js v18+
- npm or yarn or pnpm
- Git
- MetaMask or compatible Web3 wallet
# Clone repository
git clone https://github.com/DigiNodes/truthbounty-frontend.git
cd truthbounty-frontend
# Install dependencies
npm install
# or
yarn install
# or
pnpm install
# Configure environment
cp .env.example .env. local
# Edit .env. local with your credentials
# Start development server
npm run dev
# or
yarn dev
# or
pnpm devVisit http://localhost:3000 to view the application.
Create a .env.local file in the root directory:
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_WS_URL=ws://localhost:3001
# Blockchain Configuration
NEXT_PUBLIC_OPTIMISM_RPC_URL=https://mainnet.optimism.io
NEXT_PUBLIC_CHAIN_ID=10
NEXT_PUBLIC_TOKEN_CONTRACT_ADDRESS=0x...
# IPFS Configuration
NEXT_PUBLIC_IPFS_GATEWAY=https://ipfs.io/ipfs/
# Worldcoin Configuration
NEXT_PUBLIC_WORLDCOIN_APP_ID=app_...
NEXT_PUBLIC_WORLDCOIN_ACTION=verify
# Analytics (Optional)
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX# Build and run with Docker
docker build -t truthbounty-frontend .
docker run -p 3000:3000 truthbounty-frontend
# Or use Docker Compose
docker-compose up -dtruthbounty-frontend/
βββ app/ # Next.js App Router pages
β βββ (auth)/ # Authentication routes
β βββ (dashboard)/ # Protected dashboard routes
β βββ claims/ # Claims pages
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ ui/ # Reusable UI components
β βββ features/ # Feature-specific components
β βββ layout/ # Layout components
βββ contexts/ # React Context providers
β βββ AuthContext.tsx # Authentication state
β βββ Web3Context.tsx # Blockchain connection
β βββ ThemeContext.tsx # Theme management
βββ hooks/ # Custom React hooks
β βββ useAuth. ts
β βββ useClaims.ts
β βββ useTokenBalance.ts
βββ lib/ # Utility libraries
β βββ api/ # API client (TanStack Query)
β βββ web3/ # Blockchain utilities
β βββ ipfs/ # IPFS client
βββ types/ # TypeScript type definitions
βββ public/ # Static assets
βββ styles/ # Global styles
// lib/api/queryClient.ts
import { QueryClient } from '@tanstack/react-query'
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 1000, // 1 minute
cacheTime: 5 * 60 * 1000, // 5 minutes
refetchOnWindowFocus: false,
},
},
})// contexts/AuthContext.tsx
'use client'
import { createContext, useContext, useState } from 'react'
interface AuthContextType {
user: User | null
login: (credentials: Credentials) => Promise<void>
logout: () => void
}
const AuthContext = createContext<AuthContextType | undefined>(undefined)
export const useAuth = () => {
const context = useContext(AuthContext)
if (!context) throw new Error('useAuth must be used within AuthProvider')
return context
}# Run unit tests
npm run test
# Run e2e tests
npm run test:e2e
# Run tests with coverage
npm run test:coverage# Production build
npm run build
# Start production server
npm run start
# Type checking
npm run type-check
# Linting
npm run lintThis frontend connects to the TruthBounty API. Ensure the backend is running before starting development.
POST /api/claims- Submit new claimGET /api/claims- Fetch claims listPOST /api/verifications- Submit verificationGET /api/users/reputation- Get user reputationPOST /api/rewards/claim- Claim token rewards
We welcome contributions! Please follow these steps:
- Read our Contributor's Guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow Conventional Commits
- Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for all new code
- Follow the existing code style (ESLint + Prettier)
- Write tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
- Never commit
.env.localor sensitive credentials - Report security vulnerabilities to [email protected]
- Use environment variables for all configuration
MIT Β© DigiNodes
- TruthBounty API - Backend services
- TruthBounty Contracts - Smart contracts
- π§ Email: [email protected]
- π¬ Discord: Join our community
- π¦ Twitter: @DigiNodes
- π Documentation: docs.truthbounty.io
Built with β€οΈ by the DigiNodes team