Installation Guide is Incomplete, Create Neon, then no instructions on setting up tables, users, user logging.
The installation guide stops half way through. You can start up the project, and figure out you need to create a neon database, but it doesn't give you any of the tables needed to create user logins.
I'm trying to run this localhost, and this project should be marked incomplete. After following install instructions you can't get past a registration screen.
I followed the instructions exactly
this shit sucks
https://github.com/vercel/ai-chatbot/issues/731
https://claude.site/artifacts/f61c63b3-3932-42ee-a87c-591a1c267de0 for reference this is what worked for me
Local Development Setup Guide
Prerequisites
- Node.js installed
- pnpm installed
- A Vercel account
Initial Setup
- Clone the repository and install dependencies:
pnpm install
- Set up your environment variables:
- Create a
.envfile in the root directory - Generate an Auth.js secret:
npx auth secret- Add the secret to your
.env:
AUTH_SECRET="your-generated-secret" - Create a
Database Setup
- Create a new project on Vercel and link it:
vercel link
-
Set up Postgres and Blob storage:
- Go to your Vercel project dashboard
- Navigate to the "Storage" tab
- Create a new Postgres database
- Add Blob storage
-
Pull the environment variables:
vercel env pull
This will add database-related environment variables to your .env file.
Database Migration
- Run the database migrations:
pnpm tsx lib/db/migrate.ts && pnpm run build
If you encounter any errors about existing tables or foreign key constraints:
- Drop existing tables either through a database client or Prisma Studio
- Run the migrations again
Running the Application
Start the development server:
pnpm run dev
The application should now be running at http://localhost:3000 (or 3001 if 3000 is in use).
Troubleshooting
Database Issues
If you encounter database-related errors:
- Ensure all environment variables are properly set in your
.envfile - Check that the database tables are properly created
- If needed, drop all tables and rerun migrations
Authentication Issues
If you encounter authentication errors:
- Verify your
AUTH_SECRETis properly set - Ensure the database migrations have run successfully
- Check that your database connection is working
Known Issues
- Port 3000 might be in use; the app will automatically try port 3001
- Initial database setup might require dropping existing tables if migrations fail
Note About AI Models
This template uses Vercel's AI SDK which provides access to AI models without requiring individual API keys. The models are available through Vercel's infrastructure during development.
@kanodiaayush Thinks for your guide, but I'm still have trouble:
⏳ Running migrations...
❌ Migration failed
Error: write CONNECT_TIMEOUT ep-super-<xxx>.aws.neon.tech:5432
at connectTimedOut (/ai-chatbot/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:257:20)
at Timeout.done [as _onTimeout] (ai-chatbot/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:1033:8)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7) {
code: 'CONNECT_TIMEOUT',
errno: 'CONNECT_TIMEOUT',
address: 'ep-super-<xxx>.aws.neon.tech',
port: 5432
}
Ulivz, ran into the same issues, but eventually got it working with these steps:
On Neon:
DROP SCHEMA public CASCADE; CREATE SCHEMA public;
Then on local:
pnpm db:migrate
Then started the server locally with pnpm dev, and was able to go to http://localhost:3000/ and sign In with a new account, entering both username and password.
❌ Migration failed
Error: POSTGRES_URL is not defined
at runMigrate (D:\project\ai-chatbot\lib\db\migrate.ts:12:11)
at postgres (D:\project\ai-chatbot\lib\db\migrate.ts:28:1)
at Object.
https://claude.site/artifacts/f61c63b3-3932-42ee-a87c-591a1c267de0 for reference this is what worked for me
Local Development Setup Guide
Prerequisites
- Node.js installed
- pnpm installed
- A Vercel account
Initial Setup
- Clone the repository and install dependencies:
pnpm install 2. Set up your environment variables:
- Create a
.envfile in the root directory- Generate an Auth.js secret:
npx auth secret
- Add the secret to your
.env:AUTH_SECRET="your-generated-secret"
Database Setup
- Create a new project on Vercel and link it:
vercel link 2. Set up Postgres and Blob storage:
- Go to your Vercel project dashboard
- Navigate to the "Storage" tab
- Create a new Postgres database
- Add Blob storage
- Pull the environment variables:
vercel env pull This will add database-related environment variables to your
.envfile.Database Migration
- Run the database migrations:
pnpm tsx lib/db/migrate.ts && pnpm run build If you encounter any errors about existing tables or foreign key constraints:
- Drop existing tables either through a database client or Prisma Studio
- Run the migrations again
Running the Application
Start the development server:
pnpm run dev The application should now be running at http://localhost:3000 (or 3001 if 3000 is in use).
Troubleshooting
Database Issues
If you encounter database-related errors:
- Ensure all environment variables are properly set in your
.envfile- Check that the database tables are properly created
- If needed, drop all tables and rerun migrations
Authentication Issues
If you encounter authentication errors:
- Verify your
AUTH_SECRETis properly set- Ensure the database migrations have run successfully
- Check that your database connection is working
Known Issues
- Port 3000 might be in use; the app will automatically try port 3001
- Initial database setup might require dropping existing tables if migrations fail
Note About AI Models
This template uses Vercel's AI SDK which provides access to AI models without requiring individual API keys. The models are available through Vercel's infrastructure during development.
I ran the exact same but I can not fix the following error that occurs after trying to sign up or sign in:
[TypeError: Invalid URL] {
code: 'ERR_INVALID_URL',
input: '*',
page: '/register'
}
My browser showing me this:
Error: An unexpected response was received from the server.
at fetchServerAction (http://localhost:3000/_next/static/chunks/3dc60_next_dist_client_62519b05._.js:18106:37)
at ClientPageRoot (http://localhost:3000/_next/static/chunks/3dc60_next_dist_7f1666fd._.js:2059:50)
I have tried multiple things so far but nothing seems to work 🙄