Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Wikedhart18/nextjs-ai-chatbot/llms.txt

Use this file to discover all available pages before exploring further.

The recommended way to deploy is to Vercel. The project uses Vercel Postgres (powered by Neon) for chat history and Vercel Blob for file storage — both can be provisioned directly from the Vercel dashboard.

One-click deploy

Click the button below to clone the repository into your Vercel account, provision the required storage, and deploy in a single flow: Deploy with Vercel The deploy wizard will prompt you for AUTH_SECRET and OPENAI_API_KEY and automatically create a Vercel Postgres database and a Vercel Blob store.
The one-click deploy flow creates the storage integrations and injects POSTGRES_URL and BLOB_READ_WRITE_TOKEN into your project’s environment variables automatically. You do not need to set these manually.

Manual deployment

1

Push your code to GitHub

Make sure your project is in a GitHub repository. Vercel imports directly from GitHub.
2

Create a new Vercel project

Go to the Vercel dashboard, click Add New → Project, and import your GitHub repository.
3

Create a Vercel Postgres database

In your Vercel project, go to the Storage tab and click Create Database. Select Postgres (powered by Neon).Once created, Vercel automatically adds POSTGRES_URL to your project’s environment variables.
Full instructions are available in the Vercel Postgres quickstart.
4

Create a Vercel Blob store

Still on the Storage tab, click Create Database again and select Blob.Once created, Vercel automatically adds BLOB_READ_WRITE_TOKEN to your project’s environment variables.
Full instructions are available in the Vercel Blob documentation.
5

Configure required environment variables

In your Vercel project, go to Settings → Environment Variables and add the following:
VariableDescription
OPENAI_API_KEYYour OpenAI API key for gpt-4o chat models. Get one at platform.openai.com.
FIREWORKS_API_KEYYour Fireworks AI API key for reasoning models. Get one at fireworks.ai.
AUTH_SECRETA random 32-byte secret used by NextAuth.js. Generate one with openssl rand -base64 32 or at generate-secret.vercel.app/32.
POSTGRES_URLInjected automatically when the Vercel Postgres integration is connected.
BLOB_READ_WRITE_TOKENInjected automatically when the Vercel Blob integration is connected.
POSTGRES_URL and BLOB_READ_WRITE_TOKEN are injected automatically by the storage integrations created in the previous steps. You only need to set OPENAI_API_KEY, FIREWORKS_API_KEY, and AUTH_SECRET manually.
6

Deploy the project

Click Deploy. Vercel will install dependencies, run pnpm build (which includes tsx lib/db/migrate && next build), and serve the app.
Database migrations run automatically during the build step via the build script in package.json. You do not need to run pnpm db:migrate separately after deployment.

Post-deployment

After the first successful deploy, open your Vercel project URL, register an account, and start a conversation to confirm the database, blob storage, and AI model connections are all working correctly.

Build docs developers (and LLMs) love