This guide will help you deploy your Ionic Debt Token UI to Vercel.
- Vercel account
- WalletConnect Project ID
- Mode Network contract addresses
Before deploying, you need to set up the following environment variables in your Vercel project settings:
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID |
Your WalletConnect project ID from https://cloud.reown.com | a1b2c3d4e5f6... |
NEXT_PUBLIC_IONIC_DEBT_TOKEN_ADDRESS |
Your deployed IonicDebtToken contract address on Mode Mainnet | 0x1234567890... |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_MODE_RPC_URL |
Custom Mode Network RPC URL | https://mainnet.mode.network |
-
Connect your repository to Vercel:
- Go to vercel.com
- Click "New Project"
- Import your Git repository
- Vercel will automatically detect this as a Next.js project
-
Configure environment variables:
- In your Vercel project settings, go to "Environment Variables"
- Add all the required variables listed above
- Make sure to add them for all environments (Production, Preview, Development)
-
Deploy:
- Click "Deploy"
- Vercel will automatically build and deploy your application
-
Install Vercel CLI:
npm i -g vercel
-
Login to Vercel:
vercel login
-
Deploy:
vercel
-
Set environment variables:
vercel env add NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID vercel env add NEXT_PUBLIC_IONIC_DEBT_TOKEN_ADDRESS vercel env add NEXT_PUBLIC_MODE_RPC_URL
The project includes optimized configuration for Vercel:
- next.config.ts: Configured with standalone output, image optimization, and security headers
- vercel.json: Custom configuration for pnpm, function timeouts, and CORS headers
- package.json: Uses pnpm as the package manager with optimized scripts
-
Verify deployment:
- Visit your deployed URL
- Check that the WalletConnect modal works
- Test connecting to Mode Network
- Verify contract interactions work
-
Update metadata:
- Update the
metadata.urlinsrc/context/index.tsxto match your deployed domain - Redeploy after making this change
- Update the
-
Monitor:
- Check Vercel dashboard for deployment logs
- Monitor function execution times
- Review any error logs
-
Build failures:
- Check that all environment variables are set
- Verify TypeScript compilation passes locally
- Review build logs in Vercel dashboard
-
WalletConnect not working:
- Verify
NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDis correct - Check that your domain is added to your WalletConnect project settings
- Update the metadata URL in the context provider
- Verify
-
Contract interaction failures:
- Verify
NEXT_PUBLIC_IONIC_DEBT_TOKEN_ADDRESSis correct - Check that the contract is deployed on Mode Mainnet
- Verify RPC URL is accessible
- Verify
- The project is configured with:
- Standalone output for optimal serverless functions
- Image optimization for better performance
- Security headers for better SEO and security
- Webpack optimizations for smaller bundle sizes
If you encounter issues:
- Check the Vercel documentation
- Review the Next.js deployment guide
- Check your environment variables in Vercel dashboard
- Review build and function logs