Skip to content

Securify001/trustflow-frontend

Β 
Β 

Repository files navigation

πŸ–₯️ TrustFlow Frontend

License: MIT Next.js TypeScript PRs Welcome Good First Issues

The decentralized UI for the TrustFlow gig-economy protocol.

TrustFlow Frontend is the Next.js web application that gives users a seamless interface for creating escrows, tracking milestones, resolving disputes, and managing their on-chain reputation β€” all powered by Soroban smart contracts on the Stellar network.

πŸš€ Live Demo (Coming Soon) | πŸ“– Documentation | 🀝 Contributing


✨ Core Features

  • πŸ”— Wallet Integration: One-click Stellar wallet connection via Freighter.
  • πŸ’Ό Escrow Dashboard: Create, fund, and track milestone-based escrow vaults.
  • 🎯 Gig Explorer: Browse and filter available gigs with search functionality.
  • πŸ† Freelancer Leaderboard: Compare top earners and highest-reputation workers.
  • πŸ“ Gig Creation Wizard: Multi-step form to create milestone-based gigs.
  • βš–οΈ Dispute Interface: Submit evidence, monitor juror votes, and receive settlement outcomes.
  • πŸŒ— Dark / Light Mode: System-aware theme toggling via the useTheme hook.
  • πŸ”” Toast Notifications: Non-blocking feedback for all transaction states.
  • πŸ“± Responsive Design: Mobile-first layout across all breakpoints.

πŸ› οΈ Tech Stack


πŸ“„ Available Pages

  • / - Landing page with feature showcase
  • /dashboard - User dashboard (My Gigs)
  • /dashboard/disputes - Active disputes
  • /dashboard/profile - User profile and reputation
  • /dashboard/settings - Account settings
  • /explore - Browse available gigs
  • /leaderboard - Global freelancer rankings by earnings and reputation
  • /create-gig - Multi-step gig creation wizard

πŸ—‚οΈ Project Structure

β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ _app.tsx            # App shell β€” providers, global styles
β”‚   └── index.tsx           # Landing / dashboard entry point
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ atoms/              # Primitive UI: Button, Card, Input, Checkbox, ProgressBar, Toast
β”‚   β”œβ”€β”€ molecules/          # Composed UI: Deposits, FormPledge, TransactionModal, WalletData
β”‚   └── organisms/          # Page-level sections: Navbar, Campaign, Pledge
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useAccount.ts       # Stellar wallet account state
β”‚   β”œβ”€β”€ useSubscription.ts  # Real-time contract event subscriptions
β”‚   β”œβ”€β”€ useTheme.ts         # Dark/light theme management
β”‚   β”œβ”€β”€ useToast.ts         # Toast notification queue
β”‚   └── useIsMounted.ts     # SSR hydration safety guard
β”œβ”€β”€ shared/
β”‚   β”œβ”€β”€ contracts.ts        # Shared contract address constants
β”‚   └── utils.ts            # Shared utility functions
β”œβ”€β”€ styles/
β”‚   β”œβ”€β”€ globals.css         # Global styles and CSS variables
β”‚   └── Home.module.css     # Homepage styles
└── public/                 # Static assets and favicon

πŸš€ Getting Started

Prerequisites

  • Node.js >= 18
  • Freighter Wallet browser extension
  • A funded Stellar testnet account

Installation

npm install

Environment Setup

cp .env.example .env

Key variables:

NEXT_PUBLIC_STELLAR_NETWORK=TESTNET
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
NEXT_PUBLIC_ESCROW_CONTRACT_ID=your-contract-id

Running

# Development
npm run dev

# Lint code
npm run lint

# Type-check
npm run typecheck

# Production build
npm run build

# Start production server
npm start

Open http://localhost:3000 in your browser.


πŸ“– Component Guide

Atoms

Base-level, stateless UI primitives. Use these directly or compose them into molecules.

  • Button β€” primary, secondary, and loading states.
  • AmountInput β€” numeric input with token denomination label.
  • ProgressBar β€” milestone completion indicator.
  • Toast β€” auto-dismissing notification bubble (integrated globally).
  • ThemeToggle β€” dark/light mode switcher (integrated in Navbar).

Using Toast Notifications:

import { useGlobalToast } from '../pages/_app'

function MyComponent() {
  const toast = useGlobalToast()

  const handleSuccess = () => toast.success('Transaction confirmed!')
  const handleError = () => toast.error('Connection failed')
  const handleWarning = () => toast.warning('Low balance detected')
  const handleInfo = () => toast.info('Fetching data...')

  return <button onClick={handleSuccess}>Show Toast</button>
}

Molecules

Stateful compositions built from atoms.

  • FormPledge β€” full pledge form with validation and submission.
  • TransactionModal β€” step-by-step transaction status overlay.
  • WalletData β€” connected wallet summary card.
  • Deposits β€” list of active deposits with release controls.

Organisms

Full page sections wired to on-chain data.

  • Navbar β€” responsive top nav with wallet connect.
  • Campaign β€” campaign detail with funding progress.
  • Pledge β€” pledge workflow from input to confirmation.

🧭 Architecture Notes

  • The project currently uses the Next.js Pages Router. The Freelancer Leaderboard is implemented at pages/leaderboard.tsx to match the existing routing convention.
  • The leaderboard is backed by typed local sample data until the protocol exposes a public ranking endpoint or indexer query. The UI sorts the same dataset by total escrow earnings or reputation score.
  • No new runtime dependencies were added for this feature.

πŸ›‘οΈ Security

  • No private keys ever touch the browser β€” all signing delegated to Freighter.
  • Contract IDs and RPC URLs loaded strictly from environment variables.
  • XDR simulation run before every transaction submission.

πŸ—ΊοΈ Roadmap

βœ… Completed

  • Landing page with feature showcase
  • Dark/Light mode theming
  • Toast notification system
  • User dashboard with sidebar navigation
  • Gig explorer with search and filtering
  • Multi-step gig creation wizard
  • Responsive mobile-first design

🚧 In Progress

  • Wallet Integration (#21): Full Freighter API integration
  • Escrow SDK (#16): Connect gig creation to smart contracts
  • Profile Pages (#10): On-chain reputation and work history viewer

πŸ“‹ Planned

  • Dispute UI (#15): Full juror dashboard with evidence upload and voting
  • Mobile Navbar (#34): Enhanced mobile navigation
  • i18n Support (#8): Multi-language support via next-intl
  • Real-time Updates (#12): WebSocket integration for live notifications

View all issues β†’


🀝 Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.

Quick Start for Contributors

  1. Find an issue: Check good first issues or help wanted
  2. Read the guide: See CONTRIBUTING.md for detailed instructions
  3. Set up locally: Follow the installation steps above
  4. Make your changes: Create a feature branch and commit your work
  5. Submit a PR: Open a pull request with a clear description

Development Workflow

# 1. Fork and clone the repo
git clone https://github.com/YOUR_USERNAME/trustflow-frontend.git

# 2. Create a feature branch
git checkout -b feature/your-feature-name

# 3. Make changes and test
npm run dev
npm run lint
npm run typecheck
npm run build

# 4. Commit and push
git commit -m "feat: add your feature"
git push origin feature/your-feature-name

Areas We Need Help

  • πŸ”— Blockchain Integration: Freighter wallet and Soroban contract integration
  • 🎨 UI Components: Additional components and improvements
  • πŸ“ Documentation: Improving guides and code comments
  • πŸ§ͺ Testing: Adding unit and E2E tests
  • πŸ› Bug Fixes: Resolving reported issues

Read the full contributing guide β†’


🀝 Community & Support


Securing the future of work, one transaction at a time.


πŸ“œ License

MIT License. Copyright (c) 2026 TrustFlow Protocol.

πŸ“Š Project Status

This project is under active development. The UI foundation is complete and ready for blockchain integration. We're actively seeking contributors, especially those with:

  • Stellar/Soroban smart contract experience
  • React/Next.js expertise
  • UI/UX design skills

Good First Issues: Start here

About

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 85.1%
  • CSS 13.4%
  • JavaScript 1.5%