Complete Vercel deployment setup for Nova-Rewards frontend with automated preview and production deployments, custom domain, SSL, and Edge Network caching.
novaRewards/frontend/vercel.json
- Framework preset: Next.js
- Build command:
npm run build - Output directory:
.next - Environment variables declaration
- Cache headers for static assets (1 year, immutable)
- Cache headers for Next.js static files (1 year, immutable)
novaRewards/frontend/.vercelignore
- Excludes unnecessary files from deployment
- Reduces deployment size and time
.github/workflows/vercel-preview.yml
- Triggered on: Pull requests to
main - Deploys to: Vercel Preview environment
- Creates: Unique preview URL per PR
- Comments: PR with deployment link
- Status check: Required for merge
.github/workflows/vercel-production.yml
- Triggered on: Push to
main - Deploys to: Vercel Production environment
- Target:
app.nova-rewards.xyz - SSL: Automatic via Let's Encrypt
- Caching: Edge Network with 1-year immutable assets
.github/workflows/ci.yml (Updated)
- Added: Frontend build check
- Verifies:
npm run buildsucceeds - Runs on: Push and PR to
main - Status check: Required for merge
.github/workflows/branch-protection.yml
- Documentation workflow for branch protection setup
- Provides step-by-step instructions
novaRewards/frontend/next.config.js (Updated)
- Added:
NEXT_PUBLIC_MULTISIG_CONTRACT_IDenvironment variable - Enabled: SWC minification for better performance
- Disabled: X-Powered-By header for security
- Enabled: Compression for smaller payloads
VERCEL_SETUP.md (Comprehensive Setup Guide)
- Step-by-step Vercel project creation
- Environment variables configuration
- Custom domain setup
- GitHub integration
- Branch protection rules
- Troubleshooting guide
- Rollback procedures
DEPLOYMENT_GUIDE.md (Complete Deployment Guide)
- Architecture overview
- Deployment workflow
- Environment configuration
- Caching strategy
- Monitoring & observability
- Troubleshooting
- Performance optimization
- Security best practices
- Team responsibilities
DEPLOYMENT_CHECKLIST.md (Pre-Deployment Checklist)
- Pre-deployment verification
- Vercel project setup
- Environment variables (Preview & Production)
- Custom domain configuration
- Edge Network caching
- GitHub integration
- Branch protection rules
- Testing procedures
- Monitoring & maintenance
- Sign-off section
QUICK_REFERENCE.md (Quick Reference Guide)
- One-time setup commands
- Daily workflow
- Environment variables summary
- Useful links
- Status checks
- Troubleshooting table
- Rollback procedure
- Performance targets
- Key files reference
.env.vercel.example (Environment Variables Template)
- Preview environment variables
- Production environment variables
- GitHub secrets
- Detailed notes and instructions
scripts/setup-vercel.sh (Interactive Setup Script)
- Checks for Vercel CLI
- Guides through project linking
- Explains environment variable setup
- Explains GitHub secrets setup
- Explains custom domain setup
- Explains branch protection setup
- Provides next steps
┌─────────────────────────────────────────────────────────────┐
│ GitHub Repository │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Pull Request to main │ │
│ │ ↓ │ │
│ │ .github/workflows/vercel-preview.yml │ │
│ │ ├─ Checkout code │ │
│ │ ├─ Deploy to Vercel Preview │ │
│ │ └─ Comment PR with preview URL │ │
│ │ │ │
│ │ Status Check: Vercel Preview Deployment (Required) │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Push to main │ │
│ │ ↓ │ │
│ │ .github/workflows/vercel-production.yml │ │
│ │ ├─ Checkout code │ │
│ │ ├─ Deploy to Vercel Production │ │
│ │ └─ Deploy to app.nova-rewards.xyz │ │
│ │ │ │
│ │ SSL: Automatic via Let's Encrypt │ │
│ │ Caching: Edge Network (1 year, immutable) │ │
│ └──────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Vercel Platform │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Preview Environment (Testnet) │ │
│ │ ├─ URL: https://nova-rewards-[hash].vercel.app │ │
│ │ ├─ API: https://api-preview.nova-rewards.xyz │ │
│ │ ├─ Network: Stellar Testnet │ │
│ │ └─ Auto-deleted after PR merge │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Production Environment (Mainnet) │ │
│ │ ├─ URL: https://app.nova-rewards.xyz │ │
│ │ ├─ API: https://api.nova-rewards.xyz │ │
│ │ ├─ Network: Stellar Mainnet │ │
│ │ ├─ SSL: Let's Encrypt (auto-renewed) │ │
│ │ └─ Caching: Edge Network (1 year) │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Edge Network │ │
│ │ ├─ Global CDN for static assets │ │
│ │ ├─ Cache-Control: public, max-age=31536000 │ │
│ │ ├─ Immutable flag for hashed assets │ │
│ │ └─ Automatic cache busting on new builds │ │
│ └──────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
NEXT_PUBLIC_API_URL=https://api-preview.nova-rewards.xyz
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
NEXT_PUBLIC_ISSUER_PUBLIC=<testnet-issuer-public-key>
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_MULTISIG_CONTRACT_ID=<testnet-contract-id>
NEXT_PUBLIC_API_URL=https://api.nova-rewards.xyz
NEXT_PUBLIC_HORIZON_URL=https://horizon.stellar.org
NEXT_PUBLIC_ISSUER_PUBLIC=<mainnet-issuer-public-key>
NEXT_PUBLIC_STELLAR_NETWORK=public
NEXT_PUBLIC_MULTISIG_CONTRACT_ID=<mainnet-contract-id>
Paths:
/static/*/_next/static/*
Cache Header:
Cache-Control: public, max-age=31536000, immutable
Benefits:
- Hashed filenames ensure cache busting
- 1-year TTL reduces server load
- Immutable flag prevents revalidation
- Vercel Edge Network serves globally
- Automatic cache invalidation on new builds
Required for main branch:
- ✅ Require pull request before merging
- ✅ Require status checks to pass:
- CI (backend tests)
- Frontend Build Check
- Vercel Preview Deployment
- ✅ Require branches up to date before merging
- ✅ Require code reviews (1 review minimum)
- ✅ Require deployment to succeed
- Create Vercel configuration files
- Update Next.js configuration
- Create GitHub Actions workflows
- Create documentation
- Create setup script
- Create Vercel project
- Link GitHub repository
- Configure environment variables (Preview)
- Configure environment variables (Production)
- Add custom domain
- Configure DNS records
- Add GitHub secrets
- Configure branch protection rules
- Create test PR
- Verify preview deployment
- Test preview URL
- Verify environment variables
- Merge PR to main
- Verify production deployment
- Test custom domain
- Verify SSL certificate
- Test cache headers
- Monitor build times
- Monitor deployment status
- Monitor performance metrics
- Monitor error rates
- Review analytics
Nova-Rewards/
├── .env.vercel.example
├── DEPLOYMENT_CHECKLIST.md
├── DEPLOYMENT_GUIDE.md
├── IMPLEMENTATION_SUMMARY.md
├── QUICK_REFERENCE.md
├── VERCEL_SETUP.md
├── scripts/
│ └── setup-vercel.sh
├── .github/workflows/
│ ├── branch-protection.yml
│ ├── vercel-preview.yml
│ ├── vercel-production.yml
│ └── ci.yml (updated)
└── novaRewards/frontend/
├── .vercelignore
├── vercel.json
└── next.config.js (updated)
-
Read Documentation
- Start with:
QUICK_REFERENCE.md - Then read:
VERCEL_SETUP.md - Reference:
DEPLOYMENT_GUIDE.md
- Start with:
-
Run Setup Script
bash scripts/setup-vercel.sh
-
Manual Configuration
- Follow steps in
VERCEL_SETUP.md - Configure Vercel project
- Add environment variables
- Set up custom domain
- Add GitHub secrets
- Configure branch protection
- Follow steps in
-
Test Deployment
- Create test PR
- Verify preview deployment
- Merge PR to main
- Verify production deployment
- Test custom domain
-
Monitor & Maintain
- Check Vercel dashboard regularly
- Monitor GitHub Actions
- Review performance metrics
- Update documentation as needed
✅ Automated Preview Deployments
- Triggered on pull requests
- Unique URL per PR
- Automatic cleanup after merge
- Required status check
✅ Automated Production Deployments
- Triggered on push to main
- Custom domain: app.nova-rewards.xyz
- Automatic SSL via Let's Encrypt
- Edge Network caching
✅ Environment Separation
- Preview: Testnet configuration
- Production: Mainnet configuration
- Automatic variable injection
✅ Performance Optimization
- Edge Network caching
- 1-year immutable assets
- Automatic cache busting
- SWC minification
✅ Security
- Automatic SSL/TLS
- Branch protection rules
- Required code reviews
- Status check enforcement
✅ Monitoring & Observability
- Vercel dashboard
- GitHub Actions logs
- Build logs
- Performance metrics
| Document | Purpose |
|---|---|
| QUICK_REFERENCE.md | Quick lookup guide |
| VERCEL_SETUP.md | Step-by-step setup |
| DEPLOYMENT_GUIDE.md | Complete guide |
| DEPLOYMENT_CHECKLIST.md | Pre-deployment checklist |
| .env.vercel.example | Environment variables template |
| scripts/setup-vercel.sh | Interactive setup script |
See VERCEL_SETUP.md → Troubleshooting section for:
- Build failures
- Preview URL issues
- Custom domain problems
- Cache issues
| Metric | Target |
|---|---|
| Build Time | < 2 minutes |
| First Contentful Paint | < 100ms |
| Bundle Size (gzipped) | < 200KB |
| Lighthouse Score | > 90 |
- ✅ HTTPS enforced
- ✅ SSL certificate auto-renewed
- ✅ Environment variables secured
- ✅ Branch protection enabled
- ✅ Code reviews required
- ✅ Status checks required
- ✅ Sensitive data not exposed
- Review deployments weekly
- Monitor performance metrics
- Update documentation
- Rotate tokens annually
- Test rollback procedures
- Review security settings
Implementation Date: March 28, 2026 Status: ✅ Complete (Configuration Required) Next Action: Follow VERCEL_SETUP.md for manual configuration