The Web2 experience. The Web3 guarantee.
The TrustLink frontend is a Next.js 14 web application that makes decentralized escrow feel as simple as sending a payment link. Vendors generate a Smart Escrow Link in seconds. Buyers click a link, pay with a Stellar wallet, and their funds are held by a Soroban contract until the order is delivered.
No wallets to explain. No blockchain jargon. No friction.
VENDOR FLOW BUYER FLOW
βββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ
1. Connect Freighter wallet 1. Click Smart Escrow Link
2. Fill order form 2. See order summary & price
(item, price, shipping window) 3. Connect wallet or use hosted
3. Get a shareable link 4. Approve USDC payment
4. Share on WhatsApp / Instagram 5. Track shipment status
5. Track escrow status 6. Confirm delivery OR
6. Receive payout on delivery raise a dispute
- π Smart Link Generator β Vendors create escrow links with one form. Links are shareable anywhere β DMs, bios, stories.
- π³ Wallet-native Payments β Integrates Freighter SDK for in-browser Stellar transaction signing. No private key exposure.
- π¦ Shipment Tracker β Live shipment status pulled from logistics APIs (Terminal Africa / GIGL) displayed inline.
- βοΈ Dispute Dashboard β Buyers can flag issues, upload evidence, and track resolution status.
- π Real-time Notifications β Email and SMS alerts via SendGrid/Twilio at every state change.
- π± Mobile-first Design β Built for the social commerce audience β primarily on mobile.
- π No Crypto Knowledge Required β Blockchain complexity is entirely abstracted from the buyer experience.
trustlink-frontend/
β
βββ app/ # Next.js App Router
β βββ (vendor)/ # Vendor-authenticated routes
β β βββ dashboard/ # Vendor escrow dashboard
β β βββ create/ # Smart Escrow Link generator
β β βββ disputes/ # Outgoing dispute view
β β
β βββ pay/[escrowId]/ # Buyer payment page (public)
β βββ track/[escrowId]/ # Order tracking page (public)
β βββ dispute/[escrowId]/ # Buyer dispute submission
β β
β βββ admin/ # Admin dispute resolution panel
β βββ api/ # Next.js API routes
β βββ escrow/ # Escrow creation & status
β βββ webhooks/ # Logistics API webhooks
β βββ notifications/ # Email/SMS triggers
β
βββ components/
β βββ ui/ # shadcn/ui base components
β βββ escrow/ # Escrow-domain components
β β βββ EscrowLinkCard.tsx
β β βββ PaymentForm.tsx
β β βββ TrackingTimeline.tsx
β β βββ DisputeForm.tsx
β βββ wallet/ # Freighter wallet components
β β βββ WalletConnectButton.tsx
β β βββ WalletProvider.tsx
β βββ layout/ # Shared layout components
β
βββ lib/
β βββ stellar/ # Stellar / Soroban SDK wrappers
β β βββ contract.ts # Contract interaction helpers
β β βββ freighter.ts # Freighter wallet integration
β β βββ horizon.ts # Horizon API utilities
β βββ api/ # Backend API client
β βββ utils/ # Shared utilities
β
βββ hooks/ # Custom React hooks
β βββ useEscrow.ts
β βββ useWallet.ts
β βββ useTracking.ts
β
βββ types/ # Shared TypeScript types
- Node.js
18.17+ - npm / yarn / pnpm
- Freighter Wallet browser extension (for testing wallet flows)
- A running instance of the TrustLink Backend
Create a .env.local file at the project root:
# Backend API
NEXT_PUBLIC_API_URL=http://localhost:3001
# Stellar Network
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_CONTRACT_ID=C... # Your deployed Soroban contract ID
NEXT_PUBLIC_USDC_CONTRACT=C... # USDC token contract address (testnet)
# Horizon RPC
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
# Optional: Analytics
NEXT_PUBLIC_POSTHOG_KEY=phc_...# Clone the repository
git clone https://github.com/your-org/trustlink-frontend
cd trustlink-frontend
# Install dependencies
npm install
# Start the development server
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm startWallet interactions are wrapped in a reusable hook:
import { useWallet } from "@/hooks/useWallet";
const { isConnected, publicKey, signTransaction } = useWallet();
// Connect wallet
await connect();
// Sign and submit a Soroban contract call
const result = await signTransaction(xdr, { network: "TESTNET" });Smart Escrow Link generation triggers a contract interaction:
import { fundEscrow } from "@/lib/stellar/contract";
// Buyer funds the escrow β this prompts Freighter for signature
const { hash } = await fundEscrow({
escrowId,
buyerAddress: publicKey,
amount: BigInt(escrow.amount),
});Real-time shipment status is polled from the backend and rendered as a visual timeline:
// TrackingTimeline.tsx
const { tracking } = useTracking(escrowId);
// Renders: ORDER_PLACED β PICKED_UP β IN_TRANSIT β DELIVERED# Unit tests (Jest + React Testing Library)
npm run test
# End-to-end tests (Playwright)
npm run test:e2e
# Type checking
npm run type-check
# Lint
npm run lint- Wallet connect / disconnect flows
- Escrow link generation form validation
- Payment page β funded vs unfunded state
- Tracking timeline rendering
- Dispute form submission
- Mobile responsiveness (Playwright viewport tests)
TrustLink uses shadcn/ui components built on Radix UI primitives, styled with TailwindCSS. The design language is intentionally clean and "trust-signalling" β we're asking people to commit real money through a social media link.
| Token | Value | Usage |
|---|---|---|
--primary |
#1B2A6B (navy) |
CTAs, headers |
--accent |
#7B68EE (stellar purple) |
Highlights, links |
--success |
#22C55E |
Delivery confirmed, funds released |
--warning |
#F59E0B |
In transit, awaiting confirmation |
--destructive |
#EF4444 |
Dispute raised, errors |
- All payment-facing pages must show the escrow contract address in a visible
trust badge. - State changes (Funded, Shipped, Completed) must trigger visible feedback β no silent updates.
- Skeleton loaders for all async data β no layout shift.
This repo is part of the Stellar Wave Program β join the sprint, pick an issue, earn rewards.
Look for good first issue and Stellar Wave labels.
Example beginner-friendly tasks:
- Add loading skeleton to the
TrackingTimelinecomponent - Improve mobile layout of the payment confirmation page
- Add form field validation messages to
EscrowLinkGenerator - Write a unit test for
useWallethook - Improve accessibility (ARIA labels) on the dispute form
Example medium tasks:
- Implement dark mode support
- Add a "Copy Link" with QR code generator on the link creation success page
- Build the vendor analytics dashboard page
- Add i18n support for Nigerian Pidgin / French (West Africa focus)
# 1. Fork the repo and create your branch
git checkout -b feat/your-feature-name
# 2. Make your changes and write tests
# 3. Ensure everything passes
npm run test && npm run lint && npm run type-check
# 4. Commit using conventional commits
git commit -m "feat: add QR code to escrow link success page"
# 5. Open a Pull Request β describe what you did and reference the issue- Vendor dashboard (escrow creation, link sharing)
- Buyer payment page (wallet connect + fund)
- Order tracking timeline
- Dispute form
- Admin dispute resolution panel
- Vendor analytics dashboard (transaction volume, payout history)
- Mobile app wrapper (React Native / PWA)
- WhatsApp Pay integration (for non-wallet buyers)
- Multi-language support (FR, HA, YO)
- Vendor pro tier (custom branding)
MIT Β© TrustLink Contributors
Powered by Next.js Β· Secured by Stellar Soroban Β· Part of the Stellar Wave ecosystem.