A web application that allows users to send USDC gift cards instantly via email. Recipients can easily redeem their USDC gifts through a secure, gasless experience powered by Coinbase Developer Platform.
- 💳 Create instant USDC gift cards
- 📧 Automatic email delivery to recipients
- 🎨 Multiple gift card designs
- ⛽ Gasless transactions on Base network
- 🔒 Secure wallet creation and management
- 💱 Fiat to USDC conversion
The application uses a Node.js/Express backend with a vanilla JavaScript frontend. Key components:
- Backend: Express.js server handling API routes and wallet management using CDP SDK
- Frontend: Vanilla JS with Webpack bundling
- Email Service: Resend for transactional emails
- Blockchain: Base network for USDC transactions
- Smart Wallet Creation: Coinbase Wallet SDK
- Payment Processing: Coinbase Onramp
- Node.js v16+
- npm or yarn
- A Coinbase account (No KYC required to sign up via Coinbase Developer Platform)
- A Resend account for email delivery (free tier is more than enough)
Create a .env
file in the root directory:
# Coinbase Developer Platform
CDP_CLIENT_KEY="your-cdp-client-key"
COINBASE_API_KEY_NAME="your-api-key-name"
COINBASE_PRIVATE_KEY="your-private-key"
ONRAMP_APP_ID="your-onramp-app-id"
# Email Service
RESEND_API_KEY="your-resend-api-key"
# Deployment (optional)
PORT=3000
RENDER_EXTERNAL_URL="your-render-url"
- Clone the repository:
git clone https://github.com/yourusername/usdc-gift-cards.git
cd usdc-gift-cards
- Install dependencies:
npm install
- Build the frontend assets:
npm run build
- Start the development server:
npm start
- Visit
http://localhost:3000
in your browser
- Create a new Web Service on Render
- Connect your GitHub repository
- Configure the following:
- Environment: Node
- Build Command:
npm install && npm run build
- Start Command:
npm start
- Add all environment variables from
.env
- Click "Create Web Service"
POST /send-gift-email-with-wallet
: Creates wallet and sends gift emailGET /get-onramp-options
: Generates onramp configurationGET /get-balance
: Retrieves USDC balance for a walletPOST /transfer
: Executes gasless USDC transfer
MIT License
Everything single line of code in this project was generated through Cursor. While fully functional, you may notice:
- Extensive inline comments reflecting the iterative development process
- Some code organization patterns that could be more elegant
- Redundant documentation in places
- Verbose error handling from careful iteration
Feel free to refactor and streamline the code while maintaining the core functionality!