Skip to content

Fully decentralized crowdfunding on Stellar with Soroban smart contracts. Launch campaigns, fund with XLM, and track goals transparently.

License

Notifications You must be signed in to change notification settings

wiredium/xlm-crowdfunding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Stellar Crowdfunding DApp (XLM Crowdfunding)

Stellar Soroban Next.js TypeScript Rust MIT License

Developed by @byigitt & @phun333 from @wiredwiredwired
Modern, decentralized crowdfunding platform built on Stellar blockchain with Soroban smart contracts.

πŸš€ Quick Start

  • Contract (Testnet): CDLKPA54COCVUIZWI2SCAVADLUX4ALKLFXNIFRRT4Q4C3CL2E3BF5VAE
  • Network: Stellar Testnet
  • Demo: Run locally after setup

✨ Features

Core Functionality

  • βœ… Campaign Creation - Create crowdfunding campaigns with XLM goals
  • βœ… Real XLM Contributions - Native Stellar Lumens transactions
  • βœ… Live Tracking - Real-time funding progress via blockchain
  • βœ… Wallet Integration - Freighter wallet connectivity
  • βœ… Theme Support - Dark/light mode with responsive design

Security & Transparency

  • πŸ”— Blockchain Verified - All data on Stellar network
  • πŸ” Non-custodial - Users control their funds
  • πŸ“Š Real-time Updates - Live campaign monitoring
  • 🌍 Decentralized - No central authority

πŸ’» Tech Stack

Frontend (Next.js)

  • Next.js 14 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS + ShadCN/UI - Modern styling
  • React Hook Form + Zod - Form management

Smart Contracts (Rust)

  • Soroban SDK 21.0.0 - Stellar smart contracts
  • Rust 2021 - Systems programming
  • WebAssembly - Contract deployment

Blockchain

  • Stellar Testnet - Blockchain platform
  • Freighter Wallet - Browser extension
  • Horizon API - Blockchain data access

πŸ“ Project Structure

xlm-crowdfunding/
β”œβ”€β”€ πŸ“‚ frontend/              # Next.js Application
β”‚   β”œβ”€β”€ πŸ“‚ app/               # App Router (pages)
β”‚   β”‚   β”œβ”€β”€ dashboard/        # Main DApp interface
β”‚   β”‚   β”œβ”€β”€ page.tsx          # Landing page
β”‚   β”‚   └── layout.tsx        # Root layout
β”‚   β”œβ”€β”€ πŸ“‚ components/        # React components
β”‚   β”‚   β”œβ”€β”€ ui/               # ShadCN/UI components
β”‚   β”‚   └── layout/           # Layout & sections
β”‚   └── πŸ“‚ public/            # Static assets
β”œβ”€β”€ πŸ“‚ contract/              # Soroban Smart Contracts
β”‚   β”œβ”€β”€ src/lib.rs            # Main contract
β”‚   └── Cargo.toml            # Rust config
β”œβ”€β”€ deploy.sh                 # Deployment script
└── README.md                 # This file

βš™οΈ Prerequisites

Required Software

# Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
cargo install --locked soroban-cli

# Node.js 18+
node --version  # v18+
npm --version   # v9+

Browser Setup

πŸ”§ Installation & Setup

1. Clone Repository

git clone https://github.com/wiredwiredwired/xlm-crowdfunding.git
cd xlm-crowdfunding

2. Smart Contract Setup

cd contract
soroban contract build

3. Frontend Setup

cd ../frontend
npm install

# Create environment file
echo 'NEXT_PUBLIC_CONTRACT_ID="your_contract_id"
NEXT_PUBLIC_STELLAR_NETWORK="TESTNET"
NEXT_PUBLIC_HORIZON_URL="https://horizon-testnet.stellar.org"
NEXT_PUBLIC_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"' > .env.local

# Start development server
npm run dev

4. Access Application

Open http://localhost:3000

πŸš€ Deployment

Automated Deployment

chmod +x deploy.sh
./deploy.sh

Manual Deployment

# Deploy contract
cd contract
soroban contract deploy \
    --wasm target/wasm32-unknown-unknown/release/crowdfunding.wasm \
    --source alice \
    --network testnet

# Deploy frontend
cd ../frontend
npm run build
vercel  # or netlify deploy --prod

πŸ“– Usage Guide

Wallet Connection

  1. Install Freighter Wallet
  2. Create Stellar testnet account
  3. Fund with testnet XLM
  4. Connect wallet in DApp

Campaign Management

// Create campaign
const campaign = {
  title: "My Project",
  goalAmount: 1000, // XLM
};

// Contribute to campaign
const contribution = {
  campaignId: "campaign_123",
  amount: 50, // XLM
};

πŸ“‹ Smart Contract API

Data Structures

pub struct Campaign {
    pub id: u32,
    pub owner: Address,
    pub title: String,
    pub goal_amount: i128,
    pub current_amount_raised: i128,
}

Functions

// Create new campaign
pub fn create_campaign(env: Env, owner: Address, title: String, goal_amount: i128) -> u32

// Contribute to campaign
pub fn contribute(env: Env, contributor: Address, campaign_id: u32, amount: i128) -> bool

// Get all campaigns
pub fn get_campaigns(env: Env) -> Vec<Campaign>

// Get specific campaign
pub fn get_campaign(env: Env, campaign_id: u32) -> Option<Campaign>

πŸ§ͺ Testing

Smart Contract Tests

cd contract
cargo test

Frontend Tests (Optional)

cd frontend
npm install --save-dev @testing-library/react @testing-library/jest-dom jest
npm test

πŸ”’ Security Features

  • Authentication: All transactions require address signature
  • Input Validation: Comprehensive validation on all inputs
  • Non-custodial: Users control their private keys
  • Audit Trail: Complete transaction logging
  • Network Verification: Testnet safety

🀝 Contributing

Getting Started

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Install dependencies and follow setup guide
  4. Make changes and test thoroughly
  5. Submit pull request

Development Standards

  • Follow ESLint/Prettier for frontend
  • Use Rust clippy for smart contracts
  • Add tests for new functionality
  • Update documentation

Commit Convention

feat(scope): add new feature
fix(scope): fix bug
docs: update documentation
style: format code
test: add tests

πŸ”— Links & Resources

Documentation

Tools

Community

πŸ“„ License

MIT License - see LICENSE file for details.

🌟 Acknowledgments

Built with:


πŸš€ Ready to build the future of crowdfunding?

Get Started Star Project

Built with ❀️ for the Stellar Community

About

Fully decentralized crowdfunding on Stellar with Soroban smart contracts. Launch campaigns, fund with XLM, and track goals transparently.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •