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.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.
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: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
Push your code to GitHub
Make sure your project is in a GitHub repository. Vercel imports directly from GitHub.
Create a new Vercel project
Go to the Vercel dashboard, click Add New → Project, and import your GitHub repository.
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.
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.
Configure required environment variables
In your Vercel project, go to Settings → Environment Variables and add the following:
| Variable | Description |
|---|---|
OPENAI_API_KEY | Your OpenAI API key for gpt-4o chat models. Get one at platform.openai.com. |
FIREWORKS_API_KEY | Your Fireworks AI API key for reasoning models. Get one at fireworks.ai. |
AUTH_SECRET | A random 32-byte secret used by NextAuth.js. Generate one with openssl rand -base64 32 or at generate-secret.vercel.app/32. |
POSTGRES_URL | Injected automatically when the Vercel Postgres integration is connected. |
BLOB_READ_WRITE_TOKEN | Injected 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.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.