A Next.js 14 web application for the StellarGrants Protocol smart contract on the Stellar blockchain
Getting Started • Documentation • Contributing • Wave Program
The StellarGrants frontend is a zero-backend Next.js 14 web application that provides a complete user interface for the StellarGrants Protocol smart contract on the Stellar blockchain. It enables grant creators, contributors, and reviewers to interact with on-chain grant management flows — including creating grants, funding escrow, submitting milestone work, and participating in DAO-based approval voting — all through a clean, responsive web interface.
The frontend communicates directly with Soroban smart contracts via the Stellar JavaScript SDK and supports Stellar wallet connections through Freighter, xBull, and Stellar Passkeys (WebAuthn/Secp256r1).
- 🔐 Wallet-First UX — Connect any Stellar-compatible wallet in one click
- ⛓️ Zero-Backend Architecture — All state lives on-chain; frontend reads from Stellar RPC
- 🔄 Real-Time Updates — Subscribe to contract events via streaming RPC
- 🎨 Modern UI — Built with Tailwind CSS and shadcn/ui components
- 📱 Responsive Design — Works seamlessly on desktop and mobile devices
- 🌊 Wave-Friendly — Each UI section maps directly to a GitHub issue for contributors
| Tool | Version | Install |
|---|---|---|
| Node.js | >= 18.17 | nodejs.org or nvm |
| pnpm | >= 8 | npm install -g pnpm |
| Freighter Wallet | Latest | Chrome Extension |
# Clone the repository
git clone https://github.com/your-org/stellargrant-fe.git
cd stellargrant-fe
# Install dependencies
pnpm install
# Copy environment variables
cp .env.example .env.local
# Start development server
pnpm devThe application will be available at http://localhost:3000.
Create a .env.local file in the root directory. Never commit this file to version control.
# ── Stellar Network ───────────────────────────────────────
NEXT_PUBLIC_STELLAR_NETWORK=testnet
# Options: testnet | mainnet | futurenet
NEXT_PUBLIC_STELLAR_RPC_URL=https://soroban-testnet.stellar.org
# Mainnet: https://soroban.stellar.org
NEXT_PUBLIC_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
# Mainnet: Public Global Stellar Network ; September 2015
# ── Contract ──────────────────────────────────────────────
NEXT_PUBLIC_CONTRACT_ID=CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Replace with your deployed StellarGrants contract address
# ── Token ─────────────────────────────────────────────────
NEXT_PUBLIC_NATIVE_TOKEN=CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC
# Native XLM asset contract on testnet
NEXT_PUBLIC_USDC_TOKEN=CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA
# USDC on testnet (Circle / Stellar)
# ── IPFS (for milestone proof uploads) ────────────────────
NEXT_PUBLIC_IPFS_GATEWAY=https://gateway.pinata.cloud/ipfs
PINATA_API_KEY=your_pinata_api_key
PINATA_SECRET_KEY=your_pinata_secret_key
# ── Analytics (optional) ──────────────────────────────────
NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=https://app.posthog.comNEXT_PUBLIC_ are exposed to the browser. Never prefix secrets (API keys, private keys) with NEXT_PUBLIC_. Server-only secrets like PINATA_SECRET_KEY are only available in API routes and server components.
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 14.x (App Router) | React framework, SSR, file-based routing |
| TypeScript | 5.x | Type safety across components and contract calls |
| @stellar/stellar-sdk | 12.x | Stellar network, transactions, XDR encoding |
| @stellar/freighter-api | 2.x | Freighter browser wallet integration |
| Tailwind CSS | 3.x | Utility-first styling |
| shadcn/ui | Latest | Accessible component primitives (Radix UI) |
| Zustand | 4.x | Lightweight global state for wallet + grants |
| TanStack Query | 5.x | Async data fetching, caching, background sync |
| Zod | 3.x | Runtime validation for form inputs and API responses |
| React Hook Form | 7.x | Form state and validation |
| Vitest | 1.x | Unit and component tests |
| Playwright | Latest | End-to-end browser tests |
stellargrant-fe/
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout (wallet provider, fonts)
│ ├── page.tsx # Homepage / grant discovery
│ ├── grants/
│ │ ├── page.tsx # Grant listing page
│ │ ├── [id]/
│ │ │ ├── page.tsx # Grant detail view
│ │ │ ├── fund/page.tsx # Fund grant flow
│ │ │ └── milestones/
│ │ │ ├── page.tsx # Milestone list
│ │ │ └── [idx]/page.tsx # Milestone detail + vote
│ │ └── create/page.tsx # Create grant form
│ ├── profile/page.tsx # Contributor profile
│ ├── leaderboard/page.tsx # Contributor reputation board
│ └── api/
│ └── events/route.ts # SSE endpoint for contract events
├── components/
│ ├── ui/ # shadcn/ui base components
│ ├── grants/ # Grant-specific components
│ ├── milestones/ # Milestone components
│ ├── wallet/ # Wallet connect components
│ └── layout/ # Header, Footer, Sidebar
├── hooks/ # Custom React hooks
├── lib/
│ ├── stellar/ # Stellar SDK wrappers
│ │ ├── client.ts # RPC client singleton
│ │ ├── contract.ts # Contract call helpers
│ │ └── events.ts # Event streaming
│ ├── store/ # Zustand stores
│ └── utils/ # Shared utilities
├── types/ # Global TypeScript types
├── public/ # Static assets
├── tests/ # Vitest unit tests
├── e2e/ # Playwright e2e tests
├── next.config.ts
├── tailwind.config.ts
└── tsconfig.json
| Command | Description |
|---|---|
pnpm dev |
Start development server with hot reload |
pnpm build |
Build optimized production bundle |
pnpm start |
Start production server |
pnpm lint |
Run ESLint across all files |
pnpm type-check |
Run TypeScript compiler (no emit) |
pnpm test |
Run Vitest unit and component tests |
pnpm test:e2e |
Run Playwright end-to-end tests |
pnpm test:coverage |
Generate Vitest coverage report |
pnpm format |
Run Prettier on all files |
pnpm analyze |
Bundle analyzer (@next/bundle-analyzer) |
The StellarGrants frontend follows a zero-backend architecture — there is no custom API server. All data is sourced directly from the Stellar blockchain via RPC. Server Components handle initial data fetching, and Client Components manage wallet interaction and real-time updates.
Browser Stellar Network
─────────────────────────── ─────────────────────────────
Next.js Page (Server) ──► Stellar RPC (simulateTransaction)
│ │
│ initial data │ read-only contract views
▼ ▼
React Component ◄── ContractClient.ts
(Client) │
│ │
│ wallet signs tx │ submit transaction
▼ ▼
Freighter / xBull ──────► Stellar RPC (sendTransaction)
(Wallet Extension) │
│ events stream
EventListener ◄───────────────────┘
(SSE / polling)
| Page / Component | Rendering | Reason |
|---|---|---|
app/page.tsx (Home) |
Server Component | Static grant count + SEO metadata |
app/grants/page.tsx |
Server Component + ISR (60s) | Grant listing, revalidated frequently |
app/grants/[id]/page.tsx |
Server Component | Grant detail with SSR for SEO |
| Grant fund flow | Client Component | Wallet interaction required |
| Milestone vote UI | Client Component | Real-time vote count + wallet tx |
| Wallet connect button | Client Component | Browser-only wallet API |
| Event feed | Client Component (SSE) | Real-time contract events stream |
The frontend supports multiple Stellar wallet options:
Freighter is the primary Stellar browser wallet. The app uses @stellar/freighter-api for connection and signing.
import { isConnected, getAddress, signTransaction } from "@stellar/freighter-api";
// Check if Freighter is installed
const { isConnected: hasFreighter } = await isConnected();
// Get connected address
const { address } = await getAddress();
// Sign a transaction XDR
const { signedTxXdr } = await signTransaction(txXdr, {
networkPassphrase: process.env.NEXT_PUBLIC_NETWORK_PASSPHRASE,
});StellarGrants supports Passkey-based authentication via Secp256r1 (WebAuthn), allowing users to sign transactions with their device biometrics instead of a seed phrase.
Support for xBull wallet extension is also available.
Landing page showing protocol stats, featured grants, and a call-to-action for new contributors.
Paginated, filterable list of all grants stored on-chain.
Query Parameters:
status:open | active | completed | cancelledtoken:XLM | USDC | allpage: number (pagination)sort:newest | funded | deadlineq: string (search query)
Full grant page showing metadata, funding progress, milestone list, reviewer panel, and event history.
Multi-step form for creating a new grant on-chain. Wallet connection required.
Dedicated funding flow for depositing XLM or USDC into a grant's escrow.
Shows a single milestone's submitted proof, vote count, reviewer list, and action buttons.
Shows the connected wallet's contributor profile: registered GitHub handle, skills, grants participated in, milestones completed, and reputation score.
Contributor reputation board showing top contributors by reputation score.
pnpm testTests live in tests/ and co-located *.test.tsx files.
pnpm test:e2eE2E tests live in e2e/ and run against a testnet-connected dev server.
# Install Vercel CLI
pnpm add -g vercel
# Deploy to preview
vercel
# Deploy to production
vercel --prodSet all environment variables in the Vercel dashboard under Project → Settings → Environment Variables. Use separate values for Preview (testnet) and Production (mainnet) environments.
# Build Docker image
docker build -t stellar-grants-frontend .
# Run locally
docker run -p 3000:3000 \
-e NEXT_PUBLIC_STELLAR_NETWORK=testnet \
-e NEXT_PUBLIC_CONTRACT_ID=CXXX... \
stellar-grants-frontendThe StellarGrants frontend contributes directly to the Stellar Wave Program on Drips. Frontend-specific issues are labeled with drips-wave and are eligible for Wave Point rewards.
Wave Tip: Frontend issues with UI screenshots in the PR description earn faster reviews.
See CONTRIBUTING.md for detailed contribution guidelines.
- Frontend Documentation - Complete technical documentation
- API Reference - Contract interaction patterns
- Component Library - UI component documentation
- Testing Guide - Testing strategies and examples
We welcome contributions! Please see CONTRIBUTING.md for details on:
- Code of conduct
- Development workflow
- Pull request process
- Coding standards
- Issue reporting
This project is licensed under the MIT License - see the LICENSE file for details.
- Protocol Contract: StellarGrants Smart Contract
- Stellar Documentation: developers.stellar.org
- Soroban Docs: soroban.stellar.org
- Wave Program: drips.network/wave/stellar
- GitHub Issues: Issues
- Built for the Stellar ecosystem
- Powered by Soroban smart contracts
- Supported by the Stellar Development Foundation
- Community-driven through the Wave Program
Fix. Merge. Earn. 🌊 | drips.network/wave/stellar
Made with ❤️ for the Stellar community