This directory contains scripts to help you deploy the Document Chat System to various platforms.
Syncs environment variables from your local .env.local file to your Vercel project.
-
Install Vercel CLI (if not already installed):
npm install -g vercel
-
Login to Vercel:
vercel login
-
Create your environment file:
cp .env.example .env.local
Then edit
.env.localwith your actual values (API keys, database URLs, etc.)
Basic usage (syncs to all environments):
./scripts/setup-vercel.shSync to specific environments:
# Production only
./scripts/setup-vercel.sh --prod
# Production and preview
./scripts/setup-vercel.sh --prod --preview
# All environments
./scripts/setup-vercel.sh --allPreview changes before applying (dry run):
./scripts/setup-vercel.sh --dry-runSkip sensitive variables (useful for testing):
./scripts/setup-vercel.sh --skip-sensitiveUse a different environment file:
./scripts/setup-vercel.sh --env-file .env.production| Option | Description |
|---|---|
--prod |
Add variables to production environment only |
--preview |
Add variables to preview environment only |
--dev |
Add variables to development environment only |
--all |
Add variables to all environments (default) |
--dry-run |
Show what would be added without making changes |
--skip-sensitive |
Skip sensitive variables (API keys, secrets) |
--env-file <file> |
Use a different environment file (default: .env.local) |
--help |
Show help message |
Test what would be added:
./scripts/setup-vercel.sh --dry-runAdd only non-sensitive variables first:
./scripts/setup-vercel.sh --skip-sensitive --allAdd all variables to production:
./scripts/setup-vercel.sh --prod-
Sensitive Variables: The script will detect sensitive variables (API keys, secrets, database URLs) and handle them carefully.
-
Existing Variables: If a variable already exists in Vercel, the script will report it but won't overwrite it. You'll need to manually remove and re-add variables to update them.
-
Placeholder Values: Variables with placeholder values (like
your-api-key) will be automatically skipped. -
Vercel Project Linking: The script will prompt you to link a Vercel project if you haven't already done so.
You can also manage individual variables using Vercel CLI:
Add a single variable:
vercel env add VARIABLE_NAMEList all variables:
vercel env lsRemove a variable:
vercel env rm VARIABLE_NAMEPull variables from Vercel:
vercel env pull .env.vercelMake sure the script is executable:
chmod +x scripts/setup-vercel.sh- Check that your
.env.localfile exists and has the correct format - Verify you're logged in to Vercel:
vercel whoami - Ensure your Vercel project is linked:
vercel link - Try running with
--dry-runto see what would be added
Vercel CLI doesn't overwrite existing variables. To update:
# Remove the old value
vercel env rm VARIABLE_NAME production
# Add the new value
vercel env add VARIABLE_NAME productionOr use the Vercel dashboard: https://vercel.com/dashboard
-
Set up your environment:
cp .env.example .env.local # Edit .env.local with your values -
Link to Vercel:
vercel link
-
Sync environment variables:
./scripts/setup-vercel.sh --all
-
Deploy:
vercel --prod
- ✅ Never commit
.env.localor any file containing real credentials - ✅ Use different credentials for development, preview, and production
- ✅ Rotate secrets regularly, especially after team member changes
- ✅ Review Vercel logs to ensure no secrets are being logged
- ✅ Use environment-specific database instances
- 📖 Vercel Environment Variables Documentation
- 💬 Open an issue if you encounter problems
- 🔧 Check the main README for project setup instructions