Skip to content

sauravs296/Fundr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fundr Logo

Fundr

A Decentralized, Transparent, and Secure Crowdfunding Platform built on Stellar Soroban.


🟒 Live Production Link: https://fundr-green.vercel.app

▢️ Youtube Video Link : https://youtu.be/81VFHshgxiw


πŸ“– About the Project

Fundr is a next-generation decentralized crowdfunding platform designed to eliminate fraud, guarantee fund delivery, and provide unmatched transparency for charitable causes, startup ideas, and community projects.

By leveraging Stellar's Soroban Smart Contracts, Fundr ensures that backers' funds are held safely in a programmatic escrow and are only released to campaign creators if their funding goals are met. If a campaign fails to reach its goal by the deadline, backers can instantly withdraw their pledges, completely eliminating platform exit scams and traditional banking hold-ups.

πŸ›‘οΈ Impact, Security, and Transparency

  • Trustless Escrow: Funds are never held by an intermediary. They are secured directly within an on-chain smart contract.
  • Guaranteed Refunds: If a campaign misses its funding target, smart contract logic guarantees that backers can easily retrieve their XLM. No manual processing or chargebacks required.
  • Immutable Goal Enforcement: Campaign creators cannot alter their funding targets or deadlines once the campaign is deployed on-chain.
  • KYC Identity Verification: Creators undergo strict admin-approved KYC (Know Your Customer) reviews before they are permitted to deploy campaigns, protecting the platform from anonymous bad actors.
  • Platform Sustainability: A built-in 5% maintenance fee is automatically and transparently routed to the platform administrators during a successful withdrawal, aligning platform success with creator success.

πŸ“Έ Screenshots

Web Screens

Landing & Public Pages

Landing Page Web

Backer / Funder Experience

Active Campaign Details

Fund Form Web

Funding Success

Creator Dashboard

Creator Dashboard

Create Campaign Form

Manage Campaigns

Campaign Withdrawal

Campaign Performance

Fundraised History

Profile Settings

Admin Panel

Admin Home

Admin KYC Review

Admin Campaign Moderation

Mobile Screens

Landing Page Mobile

Fund Form Mobile


πŸ’» Tech Stack

Category Technology Purpose
Frontend Framework Next.js 14 (App Router) React framework for SSR and optimized routing
Styling Tailwind CSS & Vanilla CSS Modern, responsive, and highly-customizable UI
Backend & Auth Supabase PostgreSQL database, Auth, RLS Policies, and Storage
Smart Contracts Rust (Soroban) Writing secure, fast, and lightweight blockchain logic
Blockchain Integration @stellar/stellar-sdk & Freighter Interacting with Horizon/Soroban RPC and signing transactions
Deployment Vercel Global edge network hosting for the frontend application

πŸ”— Smart Contracts Deployed (Stellar Testnet)

The platform utilizes a Factory pattern to dynamically spawn isolated escrow contracts for each campaign.

Contract Name Contract ID (Testnet) Verification Link
Crowdfund Factory CBCEVQXYDJXFW6PLP4BDHXBDSR7HPU6YBV6LPSGNKLLX2BKUV35PYTMU Verify on Stellar Expert
Campaign Template (Sample) CCJLG4SZUMZGZLOMVWFCPSB4BIPH6A2ZJBGFDEV6VABDWCNXWXNH37A7 Verify on Stellar Expert

You can verify these addresses on Stellar Expert Testnet.


πŸ“‚ Clean File Architecture

Fundr/
β”œβ”€β”€ app/                      # Next.js App Router Pages
β”‚   β”œβ”€β”€ (auth)/               # Login, Register, Forgot Password
β”‚   β”œβ”€β”€ (protected)/          # Admin Dashboard, Creator Dashboard, KYC, Manage Campaigns
β”‚   β”œβ”€β”€ campaigns/            # Public Campaign display pages
β”‚   └── globals.css           # Global Tailwind and Design System Tokens
β”œβ”€β”€ components/               # Reusable React Components
β”‚   β”œβ”€β”€ admin/                # Admin specific tables and controls
β”‚   β”œβ”€β”€ campaigns/            # Campaign cards, withdrawal buttons
β”‚   β”œβ”€β”€ dashboard/            # Stat cards and dashboard tables
β”‚   β”œβ”€β”€ fund/                 # Interactive funding forms
β”‚   β”œβ”€β”€ layout/               # Navbars, Footers, and Protected Sidebars
β”‚   └── ui/                   # Reusable base UI (Buttons, Tooltips, Verification tags)
β”œβ”€β”€ contracts/                # Rust Smart Contracts
β”‚   β”œβ”€β”€ campaign/             # Escrow and logic for individual campaigns
β”‚   └── crowdfund-factory/    # Factory for dynamic campaign deployment
β”œβ”€β”€ hooks/                    # Custom React Hooks
β”‚   └── useSorobanIntegration.ts # Modularized Freighter and smart contract integration logic
β”œβ”€β”€ lib/                      # Utilities and Integrations
β”‚   └── stellar/              # Soroban SDK, Freighter wallet, and RPC wrappers
β”œβ”€β”€ sql/                      # Supabase Database Migrations & RLS Policies
β”œβ”€β”€ scripts/                  # Deployment & E2E Testing scripts
└── types/                    # TypeScript interfaces & Supabase DB Types

πŸ”„ User Workflow & Architecture

User Workflow

graph TD;
    A[Visitor] -->|Signs Up| B["Account Created"];
    B --> C{User Role};
    C -->|Backer| D["Browse Campaigns"];
    D --> E["Connect Freighter Wallet"];
    E --> F["Pledge XLM via Contract"];
    
    C -->|Creator| G["Submit KYC"];
    G --> H["Admin Reviews KYC"];
    H -->|Approved| I["Create Campaign Draft"];
    I --> J["Admin Publishes to Chain via Factory"];
    J --> K["Campaign is Live"];
    
    K --> L{Deadline Reached?};
    L -->|Goal Met| M["Creator Withdraws XLM (5% Fee)"];
    L -->|Goal Failed| N["Backers Refunded"];
Loading

Smart Contract Architecture

graph LR;
    A["Web Client"] -->|Calls Factory| B["CrowdfundFactory Contract"];
    B -->|deploy_v2| C["Campaign Contract (Instance)"];
    A -->|"Calls pledge()"| C;
    A -->|"Calls withdraw()"| C;
    A -->|"Calls refund()"| C;
Loading

✨ Platform & Contract Features

Layer Feature Description
Frontend Multi-Role Dashboards Distinct, secure routing and UI for Backers, Creators, and Admins.
Frontend Real-time Metrics Aggregates on-chain contributions and displays dynamic progress bars.
Frontend Modular Hooks Extracted Stellar and Freighter integrations into highly reusable React hooks (e.g. useSorobanIntegration).
Backend Admin KYC & Moderation Immutable KYC application flow with admin approval gates.
Backend Row Level Security (RLS) Strict PostgreSQL policies ensuring users can only modify their own data.
Contract Factory Deployment Uses deploy_v2 to spawn isolated contract state for every single campaign.
Contract Trustless Escrow Smart contract securely holds XLM without central authority intervention.
Contract Conditional Withdrawals Creators can only withdraw if pledged >= goal and the deadline has passed.
Contract Platform Fee Routing Hardcoded 5% network maintenance fee sent to the admin wallet on withdrawal.

🚨 Error Handling

Scenario Handled By User Feedback
Wallet Not Installed Frontend Guard "Freighter is not installed. Please install the extension."
User rejects transaction Wallet Provider Graceful catch displaying "Transaction rejected by user."
Funding an expired campaign Smart Contract Contract panics: "campaign closed", bubbled up to UI.
Withdrawing before deadline Smart Contract Contract panics: "campaign still active".
Withdrawing below goal Smart Contract Contract panics: "goal not met, cannot withdraw".
Invalid form inputs Server Actions / Zod Inline red text displaying exact validation errors.

πŸ§ͺ Test Results & Evidence

The platform's critical functionality is thoroughly tested via automated Node E2E scripts and Rust contract unit tests.

Smart Contract Test Verification

Contract Tests Contract Tests 2

Frontend E2E Route Verification

E2E Tests


βœ… Submission Verification Checklist

Level Criteria Status
Level 1 Wallet connect / disconnect βœ…
Level 1 Balance display βœ…
Level 1 Send XLM transaction βœ…
Level 1 Transaction feedback βœ…
Level 1 3+ error types handled βœ…
Level 2 Smart contracts deployed on Testnet βœ…
Level 2 Contract calls working (Factory, Pledging, Withdrawal, Refund) βœ…
Level 2 Multi-wallet support (Freighter) βœ…
Level 2 Real-time on-chain status βœ…
Level 3 Inter-contract calls (Factory β†’ Campaign deploy_v2) βœ…
Level 3 E2E route & contract tests passing βœ…
Level 3 Mobile responsive βœ…
Level 3 Application live on Vercel βœ…
Submission Complete README with architecture βœ…
Submission Contract addresses documented with Tx links βœ…
Submission Contracts test done and added βœ…

πŸ› οΈ Project Setup Guide

1. Database Setup

  1. Create a project on Supabase.
  2. Navigate to the SQL Editor and run the complete schema script:
    cat sql/full_schema.sql | # Execute this entire file in the Supabase SQL editor

2. Smart Contract Deployment

To build and deploy the contracts locally to Testnet:

# Compile contracts
soroban contract build

# Run deployment script
node scripts/deploy-contracts.mjs

Note: Make sure to update your .env.local with the new Contract IDs.

3. Frontend Setup

  1. Clone the repository and install dependencies:
    npm install
  2. Create a .env.local file based on .env.example and fill in your Supabase and Stellar credentials.
  3. Start the development server:
    npm run dev

Built with ❀️ for the Stellar Ecosystem.
Thank you for reviewing the Fundr Project!

About

A Decentralized, Transparent, and Secure Crowdfunding Platform built on Stellar Soroban.

Topics

Resources

Stars

Watchers

Forks

Contributors