Vercel Deployment
GitStarRecall is optimized for deployment on Vercel with built-in SPA routing and serverless API functions.Prerequisites
- Vercel account
- GitHub OAuth app configured for production
- Domain or Vercel-provided domain for your deployment
Deployment Steps
Connect repository to Vercel
- Go to Vercel Dashboard
- Click “Add New Project”
- Import your GitStarRecall repository
- Select the repository and click “Import”
Configure build settings
Vercel should auto-detect the build configuration. Verify:
- Build Command:
pnpm build - Output Directory:
dist - Install Command:
pnpm install
Configure environment variables
Add all required environment variables in Vercel project settings.See Environment Variables section below for details.
Deploy
Click “Deploy” and wait for the build to complete.Vercel will provide a production URL (e.g.,
https://your-project.vercel.app).Environment Variables
Configure these environment variables in your Vercel project settings (Settings > Environment Variables):
Required OAuth Configuration
Recommended Production Settings
Optional Features
Vercel Configuration
The project includes avercel.json file that configures SPA routing:
- Static files are served directly from the filesystem
- All other routes (including
/appand/auth/callback) fall back toindex.html - SPA routing works correctly without 404 errors on page refresh
Do not remove or modify
vercel.json - it’s required for proper SPA behavior.OAuth Callback Configuration
The OAuth flow requires proper callback URL configuration:For Production Domain
Update GitHub OAuth app
Multiple Environments
If you have multiple deployment environments (staging, production), create separate GitHub OAuth apps for each:- Development:
http://localhost:5173/auth/callback - Preview:
https://your-project-git-branch.vercel.app/auth/callback - Production:
https://your-domain.com/auth/callback
Security Considerations
Client Secret Protection
The OAuth exchange endpoint (api/github/oauth/exchange.js) keeps the client secret server-side:
- Client secret is never exposed to the browser
- Code exchange happens via serverless function
- PKCE verifier adds additional security layer
Token Storage
GitStarRecall follows a secure token handling model:- OAuth tokens are held in memory only (not persisted)
- PAT tokens can be pasted by users but are not stored as raw tokens
- Optional: API keys for LLM providers can be encrypted with
VITE_LLM_SETTINGS_ENCRYPTION_KEY
Content Security Policy
The application includes a strict CSP with explicit allowlist:- Prevents inline script execution
- Restricts resource loading to trusted domains
- Mitigates XSS and injection attacks
Build and Preview Locally
Test the production build locally before deploying:Create production build
dist/.Preview production build
http://localhost:4173.Deployment Checklist
Before deploying to production:- GitHub OAuth app configured with production callback URL
- All required environment variables set in Vercel
-
VITE_GITHUB_REDIRECT_URImatches production domain exactly -
GITHUB_OAUTH_REDIRECT_URImatches production domain exactly -
GITHUB_OAUTH_CLIENT_SECRETis set (server-side only) -
vercel.jsonrouting configuration is present - Production build tested locally with
pnpm build && pnpm preview - Optional:
VITE_LLM_SETTINGS_ENCRYPTION_KEYgenerated (if storing API keys)
Troubleshooting
/app or /auth/callback returns 404 on refresh
Cause: SPA fallback routing not configured.
Solution: Ensure vercel.json exists with the proper fallback route:
OAuth exchange fails with redirect_uri_mismatch
Cause: Mismatch between environment variables and GitHub OAuth app settings. Solution:- Verify GitHub OAuth app callback URL
- Check
VITE_GITHUB_REDIRECT_URIin Vercel environment variables - Check
GITHUB_OAUTH_REDIRECT_URIin Vercel environment variables - Ensure all three match exactly (including
https://protocol)
Environment variables not updating
Cause: Vercel caches builds and environment variables are only read at build time. Solution:- Update environment variables in Vercel dashboard
- Trigger a new deployment (redeploy or push new commit)
- Clear browser cache and reload
Build fails with TypeScript errors
Cause: Type-checking fails duringtsc -b step.
Solution:
- Run
pnpm buildlocally to reproduce - Fix TypeScript errors
- Commit and push changes
- Redeploy
Monitoring and Maintenance
Vercel Deployment Logs
Monitor deployment status and runtime errors:- Build logs: Check for build-time failures
- Function logs: Monitor serverless function execution (
/api/github/oauth/exchange) - Runtime errors: Track client-side errors in browser console
Performance Monitoring
GitStarRecall includes built-in telemetry for embedding operations:- Backend selection (WebGPU vs WASM)
- Throughput metrics
- Checkpoint behavior
- Queue depth
- Worker pool activity
Rolling Updates
When deploying updates:- Test changes locally with
pnpm ci(lint + test + build) - Deploy to preview environment first
- Test OAuth flow and critical features
- Promote to production
- Monitor error rates and user reports
Vercel automatically creates preview deployments for each branch/PR, making it easy to test changes before merging.