Infrastructure
Vercel
Recommended Platform: Native Next.js support with automatic deployments, edge functions, and zero-config setup.
Requirements
- Node.js: 20+ (Runtime)
- Next.js: 16.1.6+
- Build Tool: Next.js build system
- Package Manager: npm, yarn, or pnpm
Vercel automatically detects Next.js projects and configures build settings. No additional configuration needed.
Build Process
Build Command
Build Output
The build generates a.next directory containing:
- Static Assets: HTML, CSS, JavaScript bundles
- Server Functions: API routes and server components
- Middleware: Wallet adapter and RPC proxies
- Optimized Images: Next.js Image Optimization artifacts
- Standard Build
- Standalone Mode
Default Output DirectoryUsed for standard Vercel deployments.
Environment Variables
Deriverse requires several environment variables for production. Configure these in Vercel’s dashboard under Settings → Environment Variables.Required Variables
Deriverse Program Configuration
On-Chain Program IDs
Program IDs differ between devnet and mainnet. Ensure you use the correct ID for your target network.
Supabase Configuration
Database CredentialsGet these from your Supabase project dashboard under Settings → API.
Environment Variable Security
NEXT_PUBLIC_ Prefix
NEXT_PUBLIC_ Prefix
Variables prefixed with
NEXT_PUBLIC_ are exposed to the browser. Use only for:- RPC URLs (public endpoints)
- Supabase anon key (protected by RLS)
- Program IDs (on-chain public data)
- Supabase service role key
- Private API keys
- Secret signing keys
Server-Only Secrets
Server-Only Secrets
Variables without
NEXT_PUBLIC_ are server-only and never sent to the browser.Example:Local Development
Local Development
Create a
.env.local file in the project root:.env.local
Vercel Deployment
Automatic Deployments
Vercel automatically deploys when you push to your Git repository.Connect Repository
Link your GitHub, GitLab, or Bitbucket repository to Vercel.
- Log in to Vercel Dashboard
- Click New Project
- Import your Deriverse repository
- Vercel auto-detects Next.js configuration
Configure Environment Variables
Add production environment variables in Vercel:
- Go to Settings → Environment Variables
- Add each variable from the list above
- Select Production environment
- Click Save
Deploy
Push to your main branch:Vercel automatically:
- Runs
npm install - Executes
next build - Deploys to global edge network
- Provides a unique deployment URL
Custom Domain
Add a custom domain in Vercel:- Go to Settings → Domains
- Add your domain (e.g.,
deriverse.app) - Configure DNS records as instructed
- Vercel automatically provisions SSL certificates
Vercel provides automatic HTTPS with Let’s Encrypt certificates. No additional SSL configuration needed.
Supabase Setup
Create Supabase Project
Create Project
- Sign in to Supabase Dashboard
- Click New Project
- Choose organization and region (closest to users)
- Set database password (store securely)
Run Database Migrations
Supabase Configuration
- Authentication
- Real-time
- Storage
Disable Auth (Current Setup)Deriverse does not use Supabase Auth. Data isolation is enforced via RLS policies based on wallet addresses.If you want to add authentication later:
Production Checklist
Before going live, verify:Environment Variables
- All
NEXT_PUBLIC_*variables set - Supabase credentials configured
- RPC provider with sufficient rate limits
- Correct Deriverse program ID for target network
Database
- Tables created with correct schema
- Indexes applied for performance
- RLS policies enabled and tested
- Backup strategy configured
Deployment
- Build succeeds without errors
- No console errors in production
- Wallet connection works
- Trade lookup and caching functional
- Custom domain configured (if applicable)
Once all items are checked, your Deriverse deployment is production-ready.
Deployment Commands
Local Build Test
Test the production build locally:http://localhost:3000.
Manual Deployment
Deploy manually with Vercel CLI:Troubleshooting
Build Fails with 'Module not found'
Build Fails with 'Module not found'
Cause: Missing dependencies or incorrect import paths.Solution:
Wallet Adapter Fails to Load
Wallet Adapter Fails to Load
Cause: SSR hydration mismatch with Jupiter adapter.Solution: Ensure See
Providers component uses lazy loading:src/app/providers.tsx for implementation.Supabase Connection Errors
Supabase Connection Errors
Cause: Incorrect credentials or RLS blocking requests.Solution:
- Verify
NEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEY - Check RLS policies allow anonymous access
- Test query in Supabase SQL Editor
RPC Rate Limit Exceeded
RPC Rate Limit Exceeded
Cause: Too many blockchain queries, insufficient RPC plan.Solution:
- Verify 24-hour caching is active
- Upgrade RPC provider plan
- Implement request throttling
- Consider using multiple RPC providers with fallback
Monitoring & Analytics
Vercel Analytics
Enable in Vercel dashboard:- Go to Analytics tab
- Click Enable Analytics
- View real-time metrics:
- Page views
- Unique visitors
- Performance scores (Web Vitals)
- Geographic distribution
Supabase Monitoring
Track database usage:- Database Size: Settings → Usage
- Query Performance: Database → Query Performance
- API Requests: Settings → API → Request Logs
Next Steps
Architecture
Understand the system design and data flow patterns.
Database
Explore the database schema and caching strategy.
Service APIs
Explore Supabase service integrations.
GitHub
View source code and report issues.
Last Updated: February 2026 For architecture details, see Architecture. For database schema, see Database.
