nsoybean / chatbot-ui

Marketing Chatbot built with Next.js, the Vercel AI SDK, OpenAI, LangChain, and MongoDB πŸ’¬

Home Page:https://chatbot-ui-nsoybean.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Marketing App Chatbot

Marketing Chatbot

An open-source AI marketing chatbot app template built with Next.js, the Vercel AI SDK, OpenAI, LangChain, and MongoDB.

Forked from NextJs AI Chatbot

Authors


Features


Coming Soon

  • Mongoose: ORM for mongoose
  • Vercel KV: Rate limiting
  • Authentication provider
    • Github, Google, Twitter
    • Email
    • Credentials

Architecture

architecture diagram

Data Model

MongoDB Collections Description
memory stores each chat data
userChatList stores all chat IDs related to a user

Representing the entity relationship diagram informally:

erDiagram  UserChatList  }|--||  Chat  :  includes  UserChatList 
{  
	string  userId   
	array  chats  
}  Chat || -- || ChatMemory : has Chat  
{  
	string id
	updatedAt  time
} ChatMemory }| -- || Msgs : includes ChatMemory  
{
    string chatId
    string userId
    string title
    array messages
    string path
    string shared
    time createdAt
} Msgs  
{
    string role
    string content
}

Loading

Running locally

Env File

Create .env file. You will need to use the environment variables defined in .env.example to run the Marketing Chatbot.

Note: You should not commit your .env file or it will expose secrets that will allow others to control access to your various OpenAI and authentication provider accounts.

Configuring GitHub's OAuth

🚨 When configuring Github's OAuth App. Homepage URL and authorization callback URL should look something like the following:

Homepage URL: http://localhost:3000
Authorization callback URL: http://localhost:3000/api/auth/callback/github

Running the app

npm i --legacy-peer-deps
npm run dev

Your app template should now be running on localhost:3000 πŸŽ‰πŸŽ‰πŸŽ‰

About

Marketing Chatbot built with Next.js, the Vercel AI SDK, OpenAI, LangChain, and MongoDB πŸ’¬

https://chatbot-ui-nsoybean.vercel.app

License:Other


Languages

Language:TypeScript 95.4%Language:JavaScript 3.3%Language:CSS 1.3%