will-lp1
MCP Serverwill-lp1public

vercel ai chatbot supabase

A Hackable AI-Chat Template Powered By Vercel's AI SDK, and using Supabase for Auth/DB

Repository Info

6
Stars
1
Forks
6
Watchers
0
Issues
TypeScript
Language
Other
License

About This Server

A Hackable AI-Chat Template Powered By Vercel's AI SDK, and using Supabase for Auth/DB

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Next.js Ai-Chat with Supabase

This is a chat application template built with Next.js and Supabase, providing a modern UI for conversations with AI assistants.

Features

  • Real-time chat interface
  • Model selector for different AI models
  • Public/private visibility for chats
  • Document management
  • Suggestions system
  • User authentication via Supabase Auth
  • Row-level security for data protection

Tech Stack

  • Frontend: Next.js, React, Tailwind CSS
  • Backend: Supabase (PostgreSQL, Auth)
  • Styling: Tailwind CSS

Getting Started

Prerequisites

  • Supabase CLI installed (for local development)
  • A Supabase project (for production)

Setting Up the Project

  1. Clone this repository
git clone https://github.com/will-lp1/vercel-ai-chatbot-supabase.git
cd <repository-name>
  1. Install dependencies
pnpm install
  1. Set up Supabase locally
supabase init
supabase start
  1. Copy the environment variables
cp .env.example .env.local
  1. Update the .env.local file with your Supabase URL and anon key (found in the Supabase dashboard or from the local setup)

  2. Run the development server

pnpm dev

Open http://localhost:3000 to see the application running.

Database Structure

The application uses the following tables in Supabase:

  • Chat: Stores chat conversations
  • Message: Stores individual messages in chats
  • MessageContent: Stores different types of content within messages
  • Document: Stores document information
  • Suggestion: Stores suggestions for document improvements
  • Vote: Tracks user votes on messages

See the supabase/README.md file for more details on the database structure and migration files.

Authentication

The application uses Supabase Auth for user authentication. Users can:

  • Sign up with email and password
  • Log in with existing credentials
  • Access their own chats and documents

Deployment

Deploying the Frontend

You can deploy the Next.js application to Vercel:

  1. Push your code to a GitHub repository
  2. Import the project in Vercel
  3. Set the environment variables (from your Supabase project)
  4. Deploy

Setting Up the Database

There are multiple ways to set up the database for this application:

  1. Create a Supabase project
  2. Link your local project to the Supabase project:
supabase link --project-ref your-project-ref
  1. Push the migrations:
supabase db push

Option 2: Using Supabase SQL Editor Directly

  1. Navigate to your Supabase project dashboard
  2. Go to the SQL Editor tab
  3. Copy the contents of the migration files from either:
    • supabase/migrations/*.sql files
    • lib/db/migrations/*.sql files
  4. Paste and execute these SQL files in order in the SQL Editor

For example, first execute 20240601000000_initial_schema.sql, then 20240601000001_functions_and_types.sql.

Option 3: Using supabase-mcp-server with AI Coding Tools

For a seamless setup experience, you can use the supabase-mcp-server with AI coding tools to:

  1. Follow the setup
  2. Connect to your Supabase project through the server
  3. Have the AI assistant analyze the migration files and apply them to your project

This approach is particularly useful when working with AI coding IDEs, like Windsurf and Cursor, that can help automate the setup process and ensure all migrations are applied correctly.

Project Structure

  • /app: Next.js app router files
  • /components: React components
  • /lib: Utility functions and shared code
  • /public: Static assets
  • /supabase: Supabase configuration and migrations

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Quick Start

1

Clone the repository

git clone https://github.com/will-lp1/vercel-ai-chatbot-supabase
2

Install dependencies

cd vercel-ai-chatbot-supabase
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerwill-lp1
Repovercel-ai-chatbot-supabase
LanguageTypeScript
LicenseOther
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation