Deployment makes a web application available in a production environment, typically at a public URL. Shipping the application alone is not enough: production databases and external services, such as authentication and rate limiting, must also be configured for security and the expected traffic. Infrastructure, resource allocation, and load balancing affect whether the application stays available during spikes. section 9.6.1 section 1.2.1
Choose a hosting approach, then check the operational requirements against expected load:
- Vercel offers a streamlined path for Next.js applications, with CDN integration, monitoring, and Git-based build and deployment workflows. Docker packages an application with its dependencies and configuration for consistency across environments; Docker and Kubernetes are options for more advanced deployment needs. section 9.6.1
- For fewer than 10,000 requests per day, establish uptime and response-time monitoring, basic alerting and error tracking, HTTPS and input validation, a way to add application instances, and daily backups. section 9.6.2
- As traffic rises, revisit performance, security, and reliability. At 10,000–100,000 requests per day, a CDN can distribute static assets and reduce latency; some hosts provide one by default. section 9.6.2
Deploy a chat application to Vercel
Configure production credentials for Google AI, Upstash Redis, and Clerk through environment variables rather than hard-coding keys. The example also restricts testing access and limits model interactions to 10 messages per user per day. After creating a Vercel account, install its CLI with `npm install -g vercel` and run `vercel` for a preview deployment. A successful deployment reports dashboard and preview URLs; use `vercel --prod` to promote it to production. If deployment fails, inspect the dashboard or `vercel logs`. section 9.6.3
// .env GEMINI_API_KEY=<GEMINI_AI_SECRET_KEY> UPSTASH_REDIS_REST_URL=<UPSTASH_REDIS_REST_URL> UPSTASH_REDIS_REST_TOKEN=<UPSTASH_REDIS_REST_TOKEN> NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=<NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY> CLERK_SECRET_KEY=<CLERK_SECRET_KEY>
The example environment-variable template identifies the Google AI, Upstash Redis, and Clerk credentials that must be configured for the deployment. section 9.6.3






















