Skip to main content
Deploy your ToughTongue AI application to production.

Environment Variables

Before deploying, ensure you have all required environment variables:
.env.local
Important for production: - Set NEXT_PUBLIC_IS_DEV=false to disable the admin panel - Use a strong, unique ADMIN_TOKEN - Never commit .env.local to version control

1

Push to GitHub

Commit your code to a GitHub repository.
2

Import in Vercel

  1. Go to vercel.com/new 2. Import your repository 3. Set Root Directory to nextjs-minimal if using the monorepo structure
3

Add Environment Variables

In Project Settings → Environment Variables, add: - TOUGH_TONGUE_API_KEY = your API key - NEXT_PUBLIC_IS_DEV = false - ADMIN_TOKEN = your secure token - Firebase variables (if using)
4

Deploy

Click Deploy. Vercel will auto-deploy on future git pushes.

Vercel Project Settings


Custom Domain

After deployment, add a custom domain:
  1. Go to Project Settings → Domains
  2. Add your domain
  3. Update DNS records as instructed
  4. SSL is automatic

Other Platforms

Netlify

Add environment variables in Netlify dashboard.

Docker

Self-Hosted


Customization

App Branding

Edit lib/config.ts:

Scenario IDs

Update lib/ttai/constants.ts with your scenarios:

Styling

Customize the theme in tailwind.config.ts:

Production Checklist

Set NEXT_PUBLIC_IS_DEV=false
Use strong ADMIN_TOKEN
Verify TOUGH_TONGUE_API_KEY is correct
Configure Firebase authorized domains
Test all user flows
Monitor API usage in Developer Portal
Set up error monitoring (optional)

Troubleshooting

Check:
  • Root directory is set correctly (nextjs-minimal if monorepo)
  • All environment variables are added
  • No TypeScript errors: run pnpm build locally first
Solution: - Add your production domain to Firebase authorized domains - Go to Firebase Console → Authentication → Settings → Authorized domains
Check: - TOUGH_TONGUE_API_KEY is set in Vercel environment variables - API key has correct permissions - Check Vercel function logs for errors
Solution:
  • Ensure NEXT_PUBLIC_IS_DEV=false is set
  • Redeploy after changing environment variables

Learn More

API Reference

Full API documentation

Troubleshooting

Common issues and solutions

Developer Portal

Manage API keys and usage