A modern platform for creating and managing AI-powered chatbots with OpenAI integration. Build custom chatbots with file-based knowledge and optional CometChat integration for real-time communication.
- 🤖 Create and manage multiple AI-powered chatbots
- 📚 Upload files to enhance your bot's knowledge base
- 🔍 Vector search for accurate and contextual responses
- 💬 Optional CometChat integration for real-time chat capabilities
- 🔒 Secure user authentication system
- 🔑 User-specific OpenAI API keys for privacy and billing control
- Vercel account
- GitHub account
- Neon PostgreSQL database (or any PostgreSQL provider)
Deploy directly to Vercel with one click:
-
Fork the repository
Fork this repository to your GitHub account.
-
Set up Neon PostgreSQL database
- Sign up for a Neon account
- Create a new project
- Create a new database (e.g., "chatbotdb")
- Go to the "Connection Details" tab
- Copy the connection string (it should look like
postgres://user:password@endpoint/neondb)
-
Create a new Vercel project
- Go to Vercel Dashboard
- Click "Add New" → "Project"
- Import your forked repository
-
Configure environment variables
Add the following environment variables in the Vercel project settings:
DATABASE_URL: Your Neon PostgreSQL connection string (from step 2)JWT_SECRET: A secure random string for JWT token signing (generate withopenssl rand -hex 32)
-
Deploy
Click "Deploy" and wait for the build to complete.
-
Set up the database schema
After deployment, go to your Vercel project dashboard:
- Navigate to "Settings" → "Environment Variables"
- Verify that your
DATABASE_URLis correctly set - Go back to "Deployments" and trigger a new deployment to ensure the database schema is applied
- Node.js 18+ installed
- npm or yarn package manager
- Git installed
- PostgreSQL database (local or Neon)
-
Clone the repository
git clone <repository-url> cd chatbot-builder
-
Install dependencies
npm install # or yarn install -
Set up environment variables
# Copy the example environment file cp .env.example .envUpdate the
.envfile with your values:DATABASE_URL: Your PostgreSQL connection stringJWT_SECRET: A secure random string for JWT token signing
-
Initialize the database
# Run Prisma migrations npx prisma migrate deploy -
Create a test user (optional)
# This will create a user with email: [email protected] and password: test npm run create-test-user -
Start the development server
npm run dev
-
Access the application
- Open your browser and navigate to
http://localhost:3000 - Log in with your credentials (or use [email protected] if you created the test user)
- Go to the Settings page to add your OpenAI API key
- Open your browser and navigate to
This application uses user-specific OpenAI API keys:
- Each user must provide their own OpenAI API key in the settings page
- API keys are securely stored in the database
- No global API key is required for deployment
- Users can update or change their API keys at any time
chatbot-builder/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── bots/ # Bot management pages
│ ├── files/ # File management pages
│ └── settings/ # User settings page
├── components/ # React components
├── lib/ # Utility functions
├── prisma/ # Database schema and migrations
└── public/ # Static assets
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.