General Introduction
AI Chatbot Supabase is an open source AI chatbot template built on Next.js and Supabase. Developed by Vercel, the project aims to provide a fully functional and customizable chatbot solution. By integrating the Supabase database, users can realize efficient storage and management of chat logs and user data. The template supports a variety of AI model providers and real-time response capabilities for a variety of application scenarios.
Function List
- Model Provider Integration: Support for OpenAI, Anthropic, Cohere, and many other model providers.
- real time response: Built-in streaming support for real-time AI response.
- Database Integration: Use Supabase Postgres database to store chat logs and user data.
- Document management: Manage and upload files efficiently with Supabase file storage.
- user authentication: Supports multiple authentication providers and line-level security.
- Customized Themes: Support for Tailwind CSS and Radix UI components, providing flexible theme and dark mode support.
- local development: Provides detailed local development and deployment guidelines.
Using Help
Installation and Setup
- Installation of the necessary tools::
- Node.js 18+
- pnpm (via
npm install -g pnpm
(Installation) - Git
- Code editor (VS Code recommended)
- Setting up a Supabase project::
- Install the Supabase CLI:
- Mac:
brew install supabase/tap/supabase
- Windows (PowerShell):
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git && scoop install supabase
- Linux:
brew install supabase/tap/supabase
- NPM/Bun:
npx supabase
- Mac:
- Create a Supabase project:
npx supabase projects create -i "ai-chatbot-supabase"
- Initialize the Supabase configuration:
npx supabase init npx supabase link --project-ref your-project-id
- Install the Supabase CLI:
- Configuring Environment Variables::
- establish
.env.local
file, add the following variables:
NEXT_PUBLIC_SUPABASE_URL= NEXT_PUBLIC_SUPABASE_ANON_KEY=
- establish
- Initializing the Database Architecture::
supabase db push
supabase db reset --dry-run
local development
- Clone and install the project::
git clone https://github.com/nolly-studio/ai-chatbot-supabase.git
cd ai-chatbot-supabase
pnpm install
- Starting the Development Server::
pnpm dev
The application will run on thehttp://localhost:3000
The
Deployment to Vercel
- Configuring the Vercel Project::
- Click on "New Project" in the Vercel dashboard.
- Import the cloned repository and select "Next.js" as the framework.
- Setting environment variables:
NEXT_PUBLIC_SUPABASE_URL= NEXT_PUBLIC_SUPABASE_ANON_KEY= OPENAI_API_KEY=
- Configuring Build Settings::
- Build command:
pnpm build
- Output directory:
.next
- Installation commands:
pnpm install
- Build command:
- deployments::
- Click "Deploy" and Vercel will automatically build and deploy the application.
common problems
- Supabase connection problems::
- Verify that the environment variables are set correctly.
- Check the database status in the Supabase dashboard.
- build error::
- clear up
.next
Folder:rm-rf .next
- Reinstall the dependencies:
pnpm clean-install
- clear up