Skip to content

cypherpulse/Foundry-FundMe-Reactjs-Typescript

Repository files navigation

FundMe - Decentralized Funding Platform

License: MIT TypeScript React Vite Tailwind CSS

πŸ›  Foundry FundMe Smart Contract | 🌐 Live Demo | πŸ“– Documentation

FundMe is a modern, decentralized funding platform that empowers creators and innovators to receive funding directly from supporters through blockchain technology. Built on the Base mainnet, it provides a secure, transparent, and user-friendly way to fund projects without intermediaries.

πŸ“Έ Screenshots

Main Dashboard

FundMe Frontend

Funding Interface

FundMe Frontend

✨ Features

  • πŸ”— Wallet Integration: Seamless connection with Ethereum wallets using RainbowKit and WalletConnect
  • πŸ“Š Real-time Analytics: View contract statistics, funding progress, and contributor data
  • πŸ’° Secure Funding: Fund projects with ETH, tracked on the blockchain
  • πŸ‘₯ Contributor Tracking: Monitor your funding history and contributions
  • πŸ‘‘ Owner Dashboard: Project owners can manage funds and view detailed analytics
  • πŸ“± Responsive Design: Beautiful, mobile-first UI with dark/light mode support
  • πŸ“ˆ Interactive Charts: Visualize funding data with Chart.js and Recharts
  • πŸ”’ Smart Contract Integration: Direct interaction with audited smart contracts

πŸ›  Tech Stack

Frontend

  • React 18 - Modern UI library with hooks
  • TypeScript - Type-safe JavaScript
  • Vite - Fast build tool and dev server
  • Tailwind CSS - Utility-first CSS framework

Blockchain Integration

  • wagmi v2 - React hooks for Ethereum
  • viem - Low-level Ethereum library
  • RainbowKit v2 - Beautiful wallet connection UI
  • WalletConnect v2 - Cross-platform wallet connectivity protocol

UI/UX

  • shadcn/ui - High-quality React components
  • Framer Motion - Animation library
  • Chart.js & Recharts - Data visualization

Development Tools

  • ESLint - Code linting
  • Prettier - Code formatting
  • PostCSS - CSS processing

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

πŸš€ Quick Start

  1. Clone the repository

    git clone https://github.com/John-Mukhwana/Foundry-FundMe-Reactjs-Typescript.git
    cd Foundry-FundMe-Reactjs-Typescript
  2. Install dependencies

    pnpm install
  3. Set up environment variables

    cp .env.example .env
    # Edit .env with your API keys
  4. Start development server

    pnpm run dev
  5. Open your browser Navigate to http://localhost:5173

πŸ“¦ Installation

Using pnpm (Recommended)

# Install dependencies
pnpm install

# Start development server
pnpm run dev

# Build for production
pnpm run build

# Preview production build
pnpm run preview

Using npm

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory with the following variables:

# Required: Your Alchemy API key for Base network access
VITE_ALCHEMY_KEY=your_alchemy_api_key_here

# Required: WalletConnect Project ID for wallet connections
VITE_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here

# Required: Base mainnet RPC endpoint
VITE_BASE_RPC_URL=https://mainnet.base.org

Getting API Keys

  1. Alchemy API Key:

    • Visit Alchemy
    • Create a free account
    • Generate an API key for Base network
  2. WalletConnect Project ID:

πŸ”— Wallet Connection Setup

This project uses RainbowKit v2 with WalletConnect v2 for seamless wallet integration. RainbowKit provides a beautiful, responsive wallet connection modal that supports multiple wallet types.

Supported Wallets

RainbowKit automatically detects and supports the following wallets:

  • MetaMask (Desktop & Mobile)
  • Coinbase Wallet
  • WalletConnect (Mobile wallets like Trust Wallet, Rainbow, etc.)
  • Injected wallets (Brave, Opera, etc.)
  • Ledger and Trezor hardware wallets

WalletConnect Configuration

The project is configured to use WalletConnect v2 with the following features:

  • Cross-platform compatibility: Connect mobile wallets to desktop dApps
  • Secure communication: End-to-end encrypted connections
  • Multi-chain support: Works with Base and other EVM networks
  • Session management: Persistent connections across browser sessions

Setting Up Wallet Connectors

The wallet configuration is handled in src/lib/wagmi.ts. Here's how RainbowKit is configured:

import { getDefaultConfig } from '@rainbow-me/rainbowkit';
import { base } from 'wagmi/chains';

// RainbowKit configuration
const config = getDefaultConfig({
  appName: 'FundMe',
  projectId: import.meta.env.VITE_WALLETCONNECT_PROJECT_ID,
  chains: [base],
  ssr: false,
});

Key Configuration Options

  • appName: Your dApp's name displayed in wallet connection modals
  • projectId: Your WalletConnect Cloud project ID
  • chains: Array of supported blockchain networks (Base mainnet)
  • ssr: Disabled for client-side rendering

Customizing Wallet List

You can customize which wallets appear in the connection modal by modifying the configuration:

import { connectorsForWallets } from '@rainbow-me/rainbowkit';
import { metaMaskWallet, coinbaseWallet, walletConnectWallet } from '@rainbow-me/rainbowkit/wallets';

// Custom wallet list
const connectors = connectorsForWallets([
  {
    groupName: 'Recommended',
    wallets: [metaMaskWallet, coinbaseWallet],
  },
  {
    groupName: 'Others',
    wallets: [walletConnectWallet],
  },
], {
  appName: 'FundMe',
  projectId: import.meta.env.VITE_WALLETCONNECT_PROJECT_ID,
});

Testing Wallet Connections

To test wallet connections in development:

  1. Start the development server: pnpm run dev
  2. Click the "Connect Wallet" button
  3. Try connecting with different wallet types
  4. Test network switching to Base
  5. Verify transaction signing and sending

Troubleshooting

Common Issues:

  • "Project ID not found": Ensure VITE_WALLETCONNECT_PROJECT_ID is set correctly
  • "Unsupported network": Make sure Base network is configured in your wallet
  • "Connection failed": Check your internet connection and try refreshing the page

Mobile Testing:

  • Use WalletConnect QR codes to test mobile wallet connections
  • Ensure your mobile wallet supports WalletConnect v2

πŸ“ Project Structure

fundme-reactjs/
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ ui/            # shadcn/ui components
β”‚   β”‚   └── ...            # Feature components
β”‚   β”œβ”€β”€ hooks/             # Custom React hooks
β”‚   β”œβ”€β”€ lib/               # Utility libraries
β”‚   β”œβ”€β”€ pages/             # Page components
β”‚   β”œβ”€β”€ utils/             # Helper functions
β”‚   └── ...
β”œβ”€β”€ .env.example           # Environment variables template
β”œβ”€β”€ package.json           # Dependencies and scripts
β”œβ”€β”€ tailwind.config.ts     # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json          # TypeScript configuration
└── vite.config.ts         # Vite configuration

πŸ— Development

Available Scripts

  • pnpm run dev - Start development server
  • pnpm run build - Build for production
  • pnpm run preview - Preview production build
  • pnpm run lint - Run ESLint

Code Style

This project uses ESLint and Prettier for code quality. Run pnpm run lint to check for issues.

Smart Contract Integration

The frontend interacts with the FundMe smart contract deployed on Base mainnet. Contract details:

  • Address: 0x5C6B1d462742AA58288F601E4722Df232682442b
  • Network: Base Mainnet (Chain ID: 8453)
  • Source: GitHub Repository

πŸš€ Deployment

Build for Production

# Build the application
pnpm run build

# The build artifacts will be stored in the `dist/` directory

Deploy to Vercel

  1. Connect your GitHub repository to Vercel
  2. Add environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Deploy to Netlify

  1. Connect your GitHub repository to Netlify
  2. Set build command: pnpm run build
  3. Set publish directory: dist
  4. Add environment variables
  5. Deploy

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

How to Contribute

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Make your changes and commit: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Write clear, concise commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™‹β€β™‚οΈ Support

If you have any questions or need help:

πŸ™ Acknowledgments

  • Coinbase Base for the excellent Layer 2 network
  • RainbowKit for beautiful wallet connection UI
  • WalletConnect for cross-platform wallet connectivity
  • shadcn/ui for beautiful UI components
  • The Ethereum community for inspiration and tools

Built with ❀️ by CypherPulse.base.eth

Fund the future, one block at a time. πŸš€

Releases

No releases published

Packages

No packages published

Languages