Skip to main content
Deriverse is optimized for deployment on Vercel with Next.js 16. This guide covers production deployment, environment configuration, and Supabase setup.

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

next build

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
Default Output Directory
.next/
├── cache/              # Build cache
├── server/             # Server-side code
├── static/             # Static assets
└── standalone/         # Standalone mode (optional)
Used 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

1

Solana Network Configuration

RPC Endpoints
# Primary RPC URL (Helius recommended)
NEXT_PUBLIC_HELIUS_RPC_URL=https://api.devnet.helius-rpc.com/?api-key=YOUR_API_KEY

# Devnet RPC (fallback)
NEXT_PUBLIC_RPC_DEVNET=https://api.devnet.solana.com

# Mainnet RPC (production)
NEXT_PUBLIC_RPC_MAINNET=https://api.mainnet-beta.solana.com

# Default cluster (devnet or mainnet-beta)
NEXT_PUBLIC_WALLET_CLUSTER=devnet
Use a dedicated RPC provider (Helius, Alchemy, QuickNode) for production. Public endpoints have strict rate limits.
2

Deriverse Program Configuration

On-Chain Program IDs
# Deriverse program ID
NEXT_PUBLIC_PROGRAM_ID=Drvrseg8AQLP8B96DBGmHRjFGviFNYTkHueY9g3k27Gu

# Deriverse protocol version
NEXT_PUBLIC_DERIVERSE_VERSION=12
Program IDs differ between devnet and mainnet. Ensure you use the correct ID for your target network.
3

Supabase Configuration

Database Credentials
# Supabase project URL
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co

# Supabase anonymous key (public)
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Get these from your Supabase project dashboard under Settings → API.
The anon key is safe to expose publicly. Row Level Security (RLS) enforces data isolation.
4

Application Metadata

Optional Configuration
# Environment mode
NODE_ENV=production

# Application URL (for wallet adapter metadata)
NEXT_PUBLIC_APP_URL=https://deriverse.app

Environment Variable Security

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)
Never expose:
  • Supabase service role key
  • Private API keys
  • Secret signing keys
Variables without NEXT_PUBLIC_ are server-only and never sent to the browser.Example:
# Server-only (if needed)
SUPABASE_SERVICE_ROLE_KEY=your-secret-key
DATABASE_PASSWORD=your-db-password
Create a .env.local file in the project root:
.env.local
# Copy from .env.example
NEXT_PUBLIC_HELIUS_RPC_URL=https://api.devnet.helius-rpc.com/?api-key=dev-key
NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=local-dev-key
Never commit .env.local to version control. Add it to .gitignore.

Vercel Deployment

Automatic Deployments

Vercel automatically deploys when you push to your Git repository.
1

Connect Repository

Link your GitHub, GitLab, or Bitbucket repository to Vercel.
  1. Log in to Vercel Dashboard
  2. Click New Project
  3. Import your Deriverse repository
  4. Vercel auto-detects Next.js configuration
2

Configure Environment Variables

Add production environment variables in Vercel:
  1. Go to Settings → Environment Variables
  2. Add each variable from the list above
  3. Select Production environment
  4. Click Save
Use different values for Preview (staging) and Production environments to test with devnet before mainnet deployment.
3

Deploy

Push to your main branch:
git add .
git commit -m "Deploy to production"
git push origin main
Vercel automatically:
  • Runs npm install
  • Executes next build
  • Deploys to global edge network
  • Provides a unique deployment URL
4

Verify Deployment

Check the deployment URL provided by Vercel:
https://deriverse-your-project.vercel.app
Test wallet connection, trade lookup, and database persistence.

Custom Domain

Add a custom domain in Vercel:
  1. Go to Settings → Domains
  2. Add your domain (e.g., deriverse.app)
  3. Configure DNS records as instructed
  4. Vercel automatically provisions SSL certificates
Vercel provides automatic HTTPS with Let’s Encrypt certificates. No additional SSL configuration needed.

Supabase Setup

Create Supabase Project

1

Create Project

  1. Sign in to Supabase Dashboard
  2. Click New Project
  3. Choose organization and region (closest to users)
  4. Set database password (store securely)
2

Run Database Migrations

Execute the schema creation scripts in Supabase SQL Editor:
-- Create user_wallets table
CREATE TABLE user_wallets (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  wallet_address TEXT UNIQUE NOT NULL,
  network TEXT NOT NULL,
  wallet_provider TEXT NOT NULL DEFAULT 'manual',
  connection_method TEXT NOT NULL DEFAULT 'manual',
  last_synced_at TIMESTAMPTZ,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE INDEX idx_user_wallets_address ON user_wallets(wallet_address);
CREATE INDEX idx_user_wallets_last_synced ON user_wallets(last_synced_at DESC);
See Database for full schema.
3

Enable Row Level Security

Apply RLS policies to protect user data:
-- Enable RLS on user_wallets
ALTER TABLE user_wallets ENABLE ROW LEVEL SECURITY;

-- Policy: Users can view their own wallets
CREATE POLICY "Users can view their own wallets"
ON user_wallets
FOR SELECT
USING (wallet_address = current_setting('request.jwt.claim.wallet_address'));
4

Get API Credentials

Copy credentials from Settings → API:
  • Project URL: https://your-project.supabase.co
  • Anon Key: Public key for client-side requests
  • Service Role Key: Admin key (never expose to frontend)
Add these to Vercel environment variables.

Supabase Configuration

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:
import { createClient } from '@supabase/supabase-js';

const supabase = createClient(url, key, {
auth: {
persistSession: true,
autoRefreshToken: true,
},
});

Production Checklist

Before going live, verify:
1

Environment Variables

  • All NEXT_PUBLIC_* variables set
  • Supabase credentials configured
  • RPC provider with sufficient rate limits
  • Correct Deriverse program ID for target network
2

Database

  • Tables created with correct schema
  • Indexes applied for performance
  • RLS policies enabled and tested
  • Backup strategy configured
3

Deployment

  • Build succeeds without errors
  • No console errors in production
  • Wallet connection works
  • Trade lookup and caching functional
  • Custom domain configured (if applicable)
4

Monitoring

  • Vercel Analytics enabled
  • Supabase usage monitoring active
  • Error tracking configured (Sentry, LogRocket)
  • RPC usage within provider limits
Once all items are checked, your Deriverse deployment is production-ready.

Deployment Commands

Local Build Test

Test the production build locally:
# Build for production
npm run build

# Start production server
npm run start
Access at http://localhost:3000.

Manual Deployment

Deploy manually with Vercel CLI:
# Install Vercel CLI
npm i -g vercel

# Login
vercel login

# Deploy to preview
vercel

# Deploy to production
vercel --prod
Manual deployments bypass Git-based workflows. Use for emergencies only.

Troubleshooting

Cause: Missing dependencies or incorrect import paths.Solution:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install

# Rebuild
npm run build
Cause: SSR hydration mismatch with Jupiter adapter.Solution: Ensure Providers component uses lazy loading:
useEffect(() => {
  import('@jup-ag/wallet-adapter').then(mod => {
    setWalletProvider(() => mod.UnifiedWalletProvider);
  });
}, []);
See src/app/providers.tsx for implementation.
Cause: Incorrect credentials or RLS blocking requests.Solution:
  1. Verify NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY
  2. Check RLS policies allow anonymous access
  3. Test query in Supabase SQL Editor
Cause: Too many blockchain queries, insufficient RPC plan.Solution:
  1. Verify 24-hour caching is active
  2. Upgrade RPC provider plan
  3. Implement request throttling
  4. Consider using multiple RPC providers with fallback

Monitoring & Analytics

Vercel Analytics

Enable in Vercel dashboard:
  1. Go to Analytics tab
  2. Click Enable Analytics
  3. View real-time metrics:
    • Page views
    • Unique visitors
    • Performance scores (Web Vitals)
    • Geographic distribution

Supabase Monitoring

Track database usage:
  1. Database Size: Settings → Usage
  2. Query Performance: Database → Query Performance
  3. API Requests: Settings → API → Request Logs
Set up alerts in Supabase for:
  • Database storage > 80% of limit
  • Slow queries > 1 second
  • High error rates

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.

Build docs developers (and LLMs) love