This is a Next.js project bootstrapped with create-next-app.
A decentralized crowdfunding platform that enables crypto donations to various campaigns and causes.
- Multi-cryptocurrency support (ETH, BTC, USDT, SOL, DOT, ADA)
- Campaign creation and management
- Secure wallet connections
- Real-time donation tracking
- User authentication via NextAuth
- Next.js 14 with App Router
- TypeScript
- Material UI
- NextAuth.js for authentication
- Prisma for database access
- CryptoProcessing API for cryptocurrency transactions
Create a .env file in the root of your project with the following variables:
# Database
DATABASE_URL="postgresql://username:password@hostname:port/dbname"
# NextAuth
NEXTAUTH_URL=https://your-production-domain.com
NEXTAUTH_SECRET=your-nextauth-secret-key
# Authentication Providers
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
APPLE_CLIENT_ID=your-apple-client-id
APPLE_CLIENT_SECRET=your-apple-client-secret
# CryptoProcessing API
CRYPTOPROCESSING_API_KEY=your-cryptoprocessing-api-key
NEXT_PUBLIC_CRYPTO_PROCESSING_STORE_ID=your-merchant-id
-
Prepare your PostgreSQL database:
# Create a new database psql -c "CREATE DATABASE crypto_fund_me"
-
Run database migrations for production:
npx prisma migrate deploy
-
Seed initial data (if needed):
npx prisma db seed
Ensure your server is configured to handle CORS correctly. For Apache, add to your .htaccess:
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"
</IfModule>
For Nginx:
location / {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
}
-
Build the application:
npm run build
-
Start the production server:
npm start
- Sign up for a CryptoProcessing account
- Create an API key and note your merchant ID
- Configure the callback URL in your CryptoProcessing dashboard to point to:
https://your-production-domain.com/api/donations/callback
- Ensure your server uses HTTPS
- Store API keys securely in environment variables
- Implement rate limiting on API routes
- Consider implementing IP filtering for admin endpoints
- Regularly update dependencies
If you're experiencing CORS errors with the CryptoProcessing API:
- Verify your API key is correct
- Check that your domain is whitelisted in the CryptoProcessing dashboard
- Ensure the proxy API route (
/api/crypto-proxy) is working correctly
If users can't connect their wallets:
- Verify browser extension compatibility
- Check for console errors related to wallet providers
- Ensure wallet providers are properly initializing on the client side
This project is licensed under the MIT License - see the LICENSE file for details.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
The project includes a Solana smart contract built with Anchor framework. The contract handles:
- Campaign creation and management
- Donation collection and tracking
- Automatic refunds if goals aren't met
- Currency conversion when goals are met
To build the Solana smart contract:
npm run solana:buildTo deploy the contract to Solana devnet:
npm run solana:deployYou'll need the Solana CLI and Anchor installed on your system. Make sure you have a funded Solana wallet configured at ~/.config/solana/id.json.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
To learn more about Solana development:
- Solana Documentation - Official Solana docs
- Anchor Framework - Framework for building Solana programs
- Jupiter Aggregator - DEX aggregator for optimal token swaps
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.