π 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.
- π 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
- React 18 - Modern UI library with hooks
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- wagmi v2 - React hooks for Ethereum
- viem - Low-level Ethereum library
- RainbowKit v2 - Beautiful wallet connection UI
- WalletConnect v2 - Cross-platform wallet connectivity protocol
- shadcn/ui - High-quality React components
- Framer Motion - Animation library
- Chart.js & Recharts - Data visualization
- ESLint - Code linting
- Prettier - Code formatting
- PostCSS - CSS processing
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) - Download here
- pnpm (v8 or higher) - Install guide
- Git - Download here
- Ethereum Wallet (MetaMask, Coinbase Wallet, etc.)
-
Clone the repository
git clone https://github.com/John-Mukhwana/Foundry-FundMe-Reactjs-Typescript.git cd Foundry-FundMe-Reactjs-Typescript -
Install dependencies
pnpm install
-
Set up environment variables
cp .env.example .env # Edit .env with your API keys -
Start development server
pnpm run dev
-
Open your browser Navigate to http://localhost:5173
# Install dependencies
pnpm install
# Start development server
pnpm run dev
# Build for production
pnpm run build
# Preview production build
pnpm run preview# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewCreate 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-
Alchemy API Key:
- Visit Alchemy
- Create a free account
- Generate an API key for Base network
-
WalletConnect Project ID:
- Visit WalletConnect Cloud
- Create a new project
- Copy the Project ID
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.
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
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
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,
});appName: Your dApp's name displayed in wallet connection modalsprojectId: Your WalletConnect Cloud project IDchains: Array of supported blockchain networks (Base mainnet)ssr: Disabled for client-side rendering
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,
});To test wallet connections in development:
- Start the development server:
pnpm run dev - Click the "Connect Wallet" button
- Try connecting with different wallet types
- Test network switching to Base
- Verify transaction signing and sending
Common Issues:
- "Project ID not found": Ensure
VITE_WALLETCONNECT_PROJECT_IDis 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
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
pnpm run dev- Start development serverpnpm run build- Build for productionpnpm run preview- Preview production buildpnpm run lint- Run ESLint
This project uses ESLint and Prettier for code quality. Run pnpm run lint to check for issues.
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
# Build the application
pnpm run build
# The build artifacts will be stored in the `dist/` directory- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
- Connect your GitHub repository to Netlify
- Set build command:
pnpm run build - Set publish directory:
dist - Add environment variables
- Deploy
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and commit:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or need help:
- π§ Email: [email protected]
- π¬ Discord: Join our community
- π Issues: GitHub Issues
- π Documentation: Full Docs
- 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. π