Overview
The JARVIS frontend is a Next.js application featuring a real-time corkboard interface powered by Convex subscriptions. It’s optimized for deployment on Vercel’s edge network.Tech Stack
- Framework: Next.js 14+ with App Router
- Styling: Tailwind CSS
- Animations: Framer Motion
- Real-time Data: Convex subscriptions
- Deployment: Vercel
Prerequisites
Vercel Account
Sign up at vercel.com and connect your GitHub account
Backend Deployed
Backend API must be deployed and accessible
Deployment Steps
Configure Environment Variables
Create a The
.env.local file in the frontend directory:NEXT_PUBLIC_CONVEX_URL is the only required frontend environment variable. Get this from your Convex dashboard.Test Locally
Verify the application works locally:Open http://localhost:3000 in your browser.Verify:
- Convex connection is established
- Real-time subscriptions are working
- No console errors
Connect to Vercel
Push your code to GitHub, then:
- Go to vercel.com/new
- Import your repository
- Select the
frontenddirectory as the root - Vercel auto-detects Next.js configuration
Configure Vercel Environment Variables
In the Vercel dashboard:
- Go to Settings > Environment Variables
- Add
NEXT_PUBLIC_CONVEX_URLwith your Convex URL - Add for all environments (Production, Preview, Development)
Deploy
Deploy to production:Or simply push to your
main branch for automatic deployment.Vercel will:- Install dependencies
- Build the application
- Deploy to edge network
- Provide a production URL
Build Configuration
package.json Scripts
The frontend uses these npm scripts:Vercel Configuration
Vercel automatically detects Next.js, but you can customize withvercel.json:
Key Dependencies
Convex Integration
Client Setup
The frontend uses Convex for real-time subscriptions:Real-time Subscriptions
Example usage in components:Corkboard Features
Real-time Updates
The corkboard automatically updates when:- New persons are identified
- Profile data arrives from agents
- Connections are detected between people
- Status changes (pending → researching → complete)
Animations
Framer Motion powers all animations:Connection Strings
Red strings connecting related people:Environment Configuration
Frontend Environment Variables
Convex deployment URL from your Convex dashboard.Example:
https://happy-animal-123.convex.cloudBackend URL Configuration
The backend URL is automatically configured through Convex. API calls go through Convex functions, not directly to the backend.Performance Optimization
Image Optimization
Next.js automatically optimizes images:Code Splitting
Next.js automatically code-splits by route. For heavy components, use dynamic imports:Caching Strategy
Vercel automatically caches static assets. Configure caching headers:Deployment Modes
Production Deployment
Automatic on push tomain branch:
Preview Deployments
Automatic for all pull requests:Development
Local development with hot reload:Custom Domains
Adding a Domain
Add Domain in Vercel
- Go to project Settings > Domains
- Add your custom domain (e.g.,
jarvis.yourdomain.com)
Monitoring & Analytics
Vercel Analytics
Enable built-in analytics:Error Tracking
Integrate Sentry for error tracking:Troubleshooting
Build Failures
Check build logs in Vercel dashboard:- Go to Deployments
- Click on failed deployment
- View Build Logs
- Missing environment variables
- TypeScript errors
- Dependency conflicts
Convex Connection Errors
VerifyNEXT_PUBLIC_CONVEX_URL is set correctly:
Slow Initial Load
Optimize bundle size:- Dynamic imports
- Tree shaking
- Removing unused dependencies
Real-time Updates Not Working
Verify:- Convex URL is correct
- Convex deployment is active
- WebSocket connections are not blocked by firewall
- Browser DevTools shows “Convex connected”
Next Steps
Environment Variables
Complete list of all environment variables
Backend Deployment
Deploy the FastAPI backend