vercel setup - nself-org/nchat GitHub Wiki
This document provides an overview of the Vercel deployment infrastructure created for nchat.
Created: 2026-01-31 Status: Ready for Deployment
Optimized Vercel configuration with:
- Next.js framework preset
- pnpm package manager
- Security headers (CSP, X-Frame-Options, etc.)
- Cache control for API routes and static assets
- Clean URLs and trailing slash handling
- Function timeout configuration
Excludes unnecessary files from deployment:
- Backend services (
.backend/) - Development files (tests, docs, etc.)
- Build artifacts
- IDE and OS files
- CI/CD configurations
Comprehensive deployment guide covering:
- Why Vercel?
- Prerequisites
- Quick start with one-click deploy
- Manual deployment steps
- Environment variables setup (required and optional)
- Backend configuration (Nhost Cloud vs self-hosted)
- Custom domain setup
- Deployment monitoring
- 10 Common Issues with Solutions
- Advanced configuration
- Cost estimation
- Post-deployment checklist
Quick reference guide with:
- Links to all deployment guides
- Deployment options comparison table
- Backend requirements
- Quick start instructions
Production deployment checklist with:
- Pre-deployment checklist (8 sections, 50+ items)
- Vercel-specific checklist
- Post-deployment verification
- Ongoing maintenance schedule
- Troubleshooting quick links
Interactive deployment wizard featuring:
- One-click "Deploy to Vercel" button
- Step-by-step accordion guide (5 steps)
- Environment variable reference with copy buttons
- Status indicators for configured variables
- Links to documentation and resources
- Backend setup options (Nhost vs self-hosted)
- Visual progress tracking
Key Features:
- Checks if environment variables are set
- Copy-to-clipboard for env var examples
- Expandable/collapsible step guide
- External links to Vercel, Nhost, GitHub
- Responsive design with Radix UI components
Real-time health monitoring dashboard:
- Overall health status with progress bar
- Service health checks:
- Frontend status
- GraphQL API connectivity
- Authentication service
- Storage service
- Database accessibility
- Deployment information:
- Environment
- Region
- Version
- Commit SHA
- Build time
- Auto-refresh functionality
- Health status indicators (healthy/degraded/unhealthy)
- Warning alerts for dev mode and issues
Export file for deployment components
Admin deployment page with:
- Tabbed interface:
- "Deploy to Vercel" tab
- "Deployment Status" tab
- Full integration with admin layout
- Metadata for SEO
- Added "Deployment" navigation item with Rocket icon
- Positioned between "Advanced" and "Settings"
- Requires owner role
- Highlighted in sidebar when active
- Exported deployment components for easy imports
-
Access Admin Panel
Login as owner → /admin/deployment -
Click "Deploy to Vercel"
- Opens Vercel with pre-configured settings
- Repository, env vars, and project name pre-filled
-
Add Environment Variables
- Copy examples from the UI
- Paste into Vercel dashboard
- Configure backend URLs (Nhost or self-hosted)
-
Deploy
- Click "Deploy" in Vercel
- Wait 2-3 minutes
- Visit your new deployment URL
-
Monitor Status
- Switch to "Deployment Status" tab
- View real-time health checks
- Verify all services are healthy
-
Read the Guide
/docs/guides/deployment/vercel-deployment.md -
Install Vercel CLI
pnpm install -g vercel vercel login
-
Deploy
cd /path/to/nself-chat vercel -
Configure Environment
- Add env vars in Vercel dashboard
- Or use
vercel env add
-
Deploy to Production
vercel --prod
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_USE_DEV_AUTH |
Disable dev auth | false |
NEXT_PUBLIC_APP_URL |
Your deployment URL | https://nchat.vercel.app |
NEXT_PUBLIC_GRAPHQL_URL |
Hasura endpoint | https://api.project.nhost.run/v1/graphql |
NEXT_PUBLIC_AUTH_URL |
Auth service | https://auth.project.nhost.run/v1/auth |
NEXT_PUBLIC_STORAGE_URL |
Storage service | https://storage.project.nhost.run/v1/storage |
| Variable | Description |
|---|---|
NEXT_PUBLIC_SENTRY_DSN |
Error tracking |
NEXT_PUBLIC_GA_ID |
Google Analytics |
GOOGLE_CLIENT_ID |
Google OAuth |
GITHUB_CLIENT_ID |
GitHub OAuth |
See full list in deployment guide.
nself-chat/
├── .vercelignore # Deployment exclusions
├── vercel.json # Vercel configuration
├── VERCEL-DEPLOYMENT-SETUP.md # This file
├── docs/
│ └── guides/
│ └── deployment/
│ ├── README.md # Quick reference
│ ├── vercel-deployment.md # Full guide (60KB)
│ └── DEPLOYMENT-CHECKLIST.md # Production checklist
└── src/
├── app/
│ └── admin/
│ └── deployment/
│ └── page.tsx # Deployment page
└── components/
└── admin/
├── deployment/
│ ├── VercelDeployButton.tsx # Deploy wizard
│ ├── DeploymentStatusChecker.tsx # Health monitor
│ └── index.ts # Exports
├── admin-sidebar.tsx # Updated with nav
└── index.ts # Updated exports
- ✅ One-click deploy button
- ✅ Step-by-step visual guide
- ✅ Environment variable reference
- ✅ Copy-to-clipboard for examples
- ✅ Required vs optional variable indicators
- ✅ Backend setup options (Nhost vs self-hosted)
- ✅ Links to documentation and resources
- ✅ Status tracking for configured variables
- ✅ Real-time service health checks
- ✅ Frontend status
- ✅ GraphQL API connectivity test
- ✅ Authentication service check
- ✅ Storage service check
- ✅ Database accessibility via GraphQL
- ✅ Overall health percentage
- ✅ Deployment information (version, region, commit)
- ✅ Auto-refresh functionality
- ✅ Visual status indicators
- ✅ Warning alerts for issues
- ✅ Beginner-friendly language
- ✅ Screenshots and examples
- ✅ Troubleshooting section (10+ common issues)
- ✅ Backend configuration guide
- ✅ Custom domain setup
- ✅ Cost estimation
- ✅ Deployment checklist (50+ items)
- ✅ Ongoing maintenance schedule
- Check
package.jsonhas"packageManager": "[email protected]" - Ensure
pnpm-lock.yamlexists
- Set
NEXT_PUBLIC_USE_DEV_AUTH=false - Verify
NEXT_PUBLIC_AUTH_URLis correct
- Check
NEXT_PUBLIC_GRAPHQL_URL - Test URL in browser/Postman
- Verify CORS settings in backend
- Verify
NEXT_PUBLIC_STORAGE_URL - Configure CORS for storage service
See full troubleshooting guide in /docs/guides/deployment/vercel-deployment.md#troubleshooting
-
Review the Documentation
- Read
/docs/guides/deployment/vercel-deployment.md - Review
/docs/guides/deployment/DEPLOYMENT-CHECKLIST.md
- Read
-
Prepare Backend
- Set up Nhost project OR deploy nself backend
- Get GraphQL, Auth, and Storage URLs
-
Deploy
- Login as owner →
/admin/deployment - Click "Deploy to Vercel"
- Configure environment variables
- Deploy!
- Login as owner →
-
Monitor
- Check "Deployment Status" tab
- Verify all services are healthy
- Test application functionality
-
Configure
- Run setup wizard
- Customize branding
- Invite team members
-
Documentation:
/docs/guides/deployment/vercel-deployment.md -
In-App Helper:
/admin/deployment(requires owner role) - Community: Discord
- Issues: GitHub Issues
- Email: [email protected]
- Next.js 15.5.10: React framework
- Vercel: Deployment platform
- Radix UI: Component primitives
- Tailwind CSS: Styling
- Lucide Icons: Icon system
// VercelDeployButton.tsx
import { Button, Card, Badge, Alert, Accordion } from '@/components/ui'
// DeploymentStatusChecker.tsx
import { Button, Card, Badge, Alert, Progress, Separator } from '@/components/ui'// Checks if running in dev mode
const isDevMode = process.env.NEXT_PUBLIC_USE_DEV_AUTH === 'true'
// Checks if env var is set
const isSet = Boolean(process.env[varName])// Tests GraphQL connectivity
fetch(graphqlUrl, {
method: 'POST',
body: JSON.stringify({ query: '{ __typename }' }),
})
// Tests service endpoints
fetch(`${authUrl}/healthz`)- Created Vercel deployment configuration
- Added comprehensive deployment guide (60KB)
- Built in-app deployment helper components
- Integrated with admin panel
- Added health monitoring dashboard
- Created deployment checklist
- Updated admin navigation
Status: ✅ Ready for Production Deployment Tested: Local development environment Platform: Vercel (recommended) Difficulty: Beginner-friendly