Skip to content
/ cbase Public template

Chatbase Dashboard - AI Chatbot Management Platform

Notifications You must be signed in to change notification settings

o9nn/cbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– CBase - AI Chatbot Management Platform

Comprehensive AI Chatbot Management Platform with Advanced RAG Features

Version License TypeScript Node

Features โ€ข Quick Start โ€ข Documentation โ€ข Roadmap โ€ข Contributing


๐Ÿ“– Overview

CBase is a production-ready AI chatbot management platform featuring advanced RAG (Retrieval-Augmented Generation) capabilities, inspired by Chatbase's legacy RAG learning chatbots. Build, train, and deploy intelligent AI agents with comprehensive knowledge bases, analytics, and real-time testing capabilities.

๐ŸŽฏ Core Capabilities

  • ๐Ÿง  Advanced RAG System - Auto-training with document ingestion, vector embeddings, and semantic search
  • ๐Ÿค– Agent Management - Complete lifecycle management for AI chatbots
  • ๐Ÿ“Š Analytics Dashboard - Real-time metrics, insights, and performance tracking
  • ๐Ÿ’ฌ Live Playground - Interactive testing environment with RAG-enhanced responses
  • ๐Ÿ“ Chat Logs - Comprehensive conversation history and export capabilities
  • โš™๏ธ Settings & Integrations - Database integrations (Supabase, Neon), S3 storage, and more

โœจ Key Features

๐Ÿง  RAG Knowledge Training System

Train your AI agents with custom knowledge sources:

  • Multiple Source Types: Text, files (PDF, DOCX), URLs, Q&A pairs
  • Smart Text Processing: Overlapping chunk segmentation with boundary detection
  • Vector Embeddings: 1536-dimensional vectors via OpenAI-compatible API
  • Semantic Search: Cosine similarity-based retrieval with relevance scoring
  • Batch Training: Process multiple sources efficiently
  • Real-time Status: Monitor training progress and job status

๐Ÿค– Agent Management

Complete control over your AI chatbots:

  • Full CRUD Operations: Create, read, update, delete agents
  • Configuration: System prompts, models (GPT-4, GPT-3.5), temperature, tokens
  • Conversation Starters: Pre-defined quick replies for users
  • Constraints: Rate limiting, visibility controls, max length settings
  • Status Tracking: Active, training, needs retraining indicators
  • Templates: Pre-built agent templates for common use cases

๐Ÿ“Š Analytics & Insights

Understand your chatbot performance:

  • Message Analytics: Total counts, user/bot distribution, trends over time
  • Topic Analysis: Category breakdown and trend identification
  • Signal Scores: Quality metrics and threshold alerts
  • Performance Metrics: Response times, success rates, error tracking
  • Emoji Usage: Sentiment analysis and usage patterns
  • Custom Reports: Export analytics as CSV, PDF, or JSON

๐Ÿ’ฌ Interactive Playground

Test and refine your agents:

  • Live Chat Interface: Real-time AI responses with streaming
  • RAG Toggle: Enable/disable knowledge retrieval on-the-fly
  • Configuration Panel: Adjust settings without leaving the playground
  • System Prompt Editor: Inline editing with preview
  • Export Results: Save test sessions for analysis
  • Debug Mode: View RAG context and relevance scores

๐ŸŽจ Modern UI/UX

Beautiful, accessible interface:

  • Dark Mode: Purple/indigo themed dark interface (default)
  • Responsive Design: Optimized for desktop, tablet, and mobile
  • Accessibility: WCAG 2.1 AA compliant
  • Smooth Animations: Framer Motion powered interactions
  • Loading States: Skeleton loaders and progress indicators
  • Toast Notifications: User-friendly feedback system

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18.x or 20.x LTS
  • pnpm 10.4.1 or higher
  • MySQL 8.0+
  • OpenAI API Key or compatible endpoint

Installation

# Clone the repository
git clone https://github.com/o9nn/cbase.git
cd cbase

# Install dependencies
pnpm install

# Configure environment
cp .env.example .env
# Edit .env with your configuration

# Run database migrations
pnpm run db:push

# Start development server
pnpm run dev

The application will be available at http://localhost:3000

Docker Quick Start

# Using Docker Compose
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

๐Ÿ“š Documentation

Core Documentation

RAG System

Implementation


๐Ÿ—๏ธ Architecture

Technology Stack

Frontend

  • React 19 - Modern UI library
  • TypeScript - Type-safe development
  • TailwindCSS - Utility-first styling
  • Radix UI - Accessible component primitives
  • Framer Motion - Smooth animations
  • React Query - Data fetching and caching
  • Wouter - Lightweight routing

Backend

  • Node.js - Runtime environment
  • Express - Web framework
  • tRPC - Type-safe API layer
  • Drizzle ORM - Type-safe database access
  • MySQL - Primary database
  • Zod - Schema validation

Infrastructure

  • Vite - Fast build tool
  • pnpm - Efficient package manager
  • PM2 - Process manager
  • Docker - Containerization
  • nginx - Reverse proxy

System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Client (React)                       โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  Agents  โ”‚  โ”‚Knowledge โ”‚  โ”‚Analytics โ”‚  โ”‚Settings โ”‚ โ”‚
โ”‚  โ”‚   Page   โ”‚  โ”‚   Base   โ”‚  โ”‚Dashboard โ”‚  โ”‚  Panel  โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚ tRPC API
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Server (Node.js)                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚    Router    โ”‚  โ”‚   RAG Core   โ”‚  โ”‚    Storage    โ”‚ โ”‚
โ”‚  โ”‚   (tRPC)     โ”‚  โ”‚   Service    โ”‚  โ”‚   (S3/Local)  โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚ Drizzle ORM
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Database (MySQL)                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Agents  โ”‚  โ”‚  Knowledge  โ”‚  โ”‚  Chat Sessions &   โ”‚  โ”‚
โ”‚  โ”‚  Table  โ”‚  โ”‚  Sources &  โ”‚  โ”‚     Messages       โ”‚  โ”‚
โ”‚  โ”‚         โ”‚  โ”‚  Embeddings โ”‚  โ”‚                    โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ—“๏ธ Roadmap

โœ… Completed (v2.0.0)

  • Phase 1-7: Core platform with RAG system (85% complete)
    • Agent management system
    • RAG knowledge training
    • Chat logs and analytics
    • Interactive playground
    • Settings and integrations
    • Dark mode UI with purple/indigo theme
    • Comprehensive documentation

โœ… Recently Completed (January 2026)

  • Phase 8: File upload & processing โœ…

    • PDF, DOCX, DOC, TXT, MD file support
    • Automatic text extraction and RAG processing
    • File management UI with status tracking
    • Secure file handling with authorization
  • Phase 9: URL scraping & web crawling โœ…

    • Single URL and multi-page crawling
    • Configurable crawl depth (1-3 levels)
    • Max pages limit (5-50 pages)
    • HTML content extraction with cheerio
    • HTML to Markdown conversion
    • Robots.txt compliance
    • Same-domain restriction
    • SSRF protection and URL validation
    • Automatic RAG processing of crawled content

๐Ÿšง In Progress (Q2 2026)

  • Enhanced testing infrastructure
  • Performance optimization

๐Ÿ“‹ Planned (Q3-Q4 2026)

  • Phase 10: Advanced training & optimization
  • Phase 11: Multi-language support
  • Phase 12: Enterprise features & scaling
  • Vector database migration
  • Team collaboration features
  • Public API & webhooks

See DEVELOPMENT_ROADMAP.md for complete details.


๐ŸŽฏ Use Cases

Customer Support

Train chatbots with FAQs, policies, and documentation for accurate, context-aware support.

Technical Documentation

Index API references, code docs, and guides for developer assistance.

Sales Assistant

Load product information and sales materials for intelligent customer interactions.

Educational Tutor

Train with course materials and textbooks for personalized learning assistance.


๐Ÿ› ๏ธ Development

Project Structure

cbase/
โ”œโ”€โ”€ client/              # Frontend React application
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/      # Page components
โ”‚   โ”‚   โ”œโ”€โ”€ components/ # Reusable components
โ”‚   โ”‚   โ””โ”€โ”€ lib/        # Utilities and helpers
โ”‚   โ””โ”€โ”€ public/         # Static assets
โ”œโ”€โ”€ server/             # Backend Node.js application
โ”‚   โ”œโ”€โ”€ _core/          # Core server functionality
โ”‚   โ”œโ”€โ”€ db.ts           # Database operations
โ”‚   โ”œโ”€โ”€ rag.ts          # RAG service
โ”‚   โ””โ”€โ”€ routers.ts      # API routes
โ”œโ”€โ”€ drizzle/            # Database schema and migrations
โ”œโ”€โ”€ examples/           # Code examples
โ””โ”€โ”€ docs/              # Documentation

Available Scripts

# Development
pnpm run dev           # Start dev server with hot reload

# Building
pnpm run build         # Build for production
pnpm run start         # Start production server

# Quality
pnpm run check         # TypeScript type checking
pnpm run format        # Format code with Prettier
pnpm run test          # Run tests

# Database
pnpm run db:push       # Run database migrations

Environment Variables

Create a .env file with:

# Required
DATABASE_URL=mysql://user:pass@host:3306/db
FORGE_API_KEY=your-api-key-here

# Optional
FORGE_API_URL=https://api.openai.com/v1
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
S3_BUCKET=your-bucket-name

# โš ๏ธ WARNING: Never commit actual credentials to version control!
# Use environment variables or secure secrets management in production.

See DEPLOYMENT_GUIDE.md for complete configuration.


๐Ÿงช Testing

Running Tests

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test -- --watch

# Run tests with coverage
pnpm test -- --coverage

Test Coverage Goals

  • Unit Tests: 80% coverage target
  • Integration Tests: Critical paths covered
  • E2E Tests: User journey validation

๐Ÿ“Š Performance

Benchmarks

  • Average Response Time: < 2s for RAG queries
  • Embedding Generation: ~100ms per chunk
  • Database Queries: < 100ms average
  • Page Load Time: < 3s initial load
  • API Uptime: 99.9% target

Optimization

  • Database indexing on frequently queried fields
  • React Query caching for API responses
  • Batch embedding generation
  • Code splitting and lazy loading
  • CDN for static assets

๐Ÿ”’ Security

Security Features

  • JWT-based authentication
  • Session management with secure cookies
  • Input validation with Zod schemas
  • SQL injection prevention via ORM
  • XSS protection
  • CSRF protection
  • Rate limiting
  • API key management

Reporting Security Issues

Please report security vulnerabilities via GitHub Security Advisories: https://github.com/o9nn/cbase/security/advisories

Do not open public issues for security concerns.


๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines:

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Write tests for new features
  • Update documentation as needed
  • Follow the existing code style
  • Use conventional commits

Code of Conduct

Be respectful, inclusive, and professional. See CODE_OF_CONDUCT.md.


๐Ÿ“œ License

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


๐Ÿ™ Acknowledgments

Inspiration

This project is inspired by Chatbase's legacy RAG learning chatbot system, bringing advanced knowledge training capabilities to modern AI chatbot management.

Technologies

Built with amazing open-source technologies:

  • React, TypeScript, Node.js
  • TailwindCSS, Radix UI, Framer Motion
  • tRPC, Drizzle ORM, MySQL
  • And many more listed in package.json

๐Ÿ“ž Support & Community

Getting Help

Stay Connected


๐Ÿ“ˆ Project Status

Current Version: 2.2.0
Status: Production Ready โœ…
Last Updated: January 31, 2026

Statistics

  • 93% feature complete (Phases 8 & 9 completed)
  • 180+ features implemented
  • 18 API endpoints (4 new URL crawling endpoints added in Phase 9)
  • 8 major pages
  • 5 database tables (added fileUploads, webCrawlJobs)
  • 3,600+ lines of code added for file processing and URL crawling
  • 3 database tables for RAG
  • 1,775 lines of code added in RAG implementation (Phase 7)

๐ŸŽ‰ What's New in v2.2.0

Major Features (Phase 9)

โœจ URL Scraping & Web Crawling

  • Crawl single URLs or entire websites
  • Configurable crawl depth (1-3 levels deep)
  • Max pages limit (5-50 pages)
  • Smart content extraction from HTML
  • HTML to Markdown conversion
  • Robots.txt compliance
  • Same-domain restriction for security
  • SSRF protection with URL validation
  • Automatic RAG processing of crawled content
  • Real-time crawl job status tracking

Previous Features (v2.1.0 - Phase 8)

โœจ File Upload & Processing

  • Upload PDF, DOCX, DOC, TXT, MD files
  • Automatic text extraction
  • Seamless RAG integration
  • File management UI with status tracking

Core Features (v2.0.0)

โœจ Complete RAG knowledge training system
โœจ Advanced vector search with semantic similarity
โœจ Batch training capabilities
โœจ Real-time training job tracking
โœจ Comprehensive analytics dashboard
โœจ Export functionality (CSV, PDF)
โœจ Dark mode UI with purple/indigo theme

Improvements

๐Ÿš€ Enhanced web content processing pipeline ๐Ÿš€ Improved security with SSRF protection ๐Ÿš€ Better error handling for network operations ๐Ÿš€ Enhanced file processing pipeline ๐Ÿš€ Improved security with ownership verification ๐Ÿš€ Better error handling for file operations ๐Ÿš€ Enhanced performance with database optimization
๐Ÿš€ Improved error handling and user feedback
๐Ÿš€ Better documentation with examples
๐Ÿš€ Responsive design for all devices
๐Ÿš€ Accessibility improvements (WCAG 2.1 AA)


๐Ÿ”ฎ Coming Soon

  • ๐Ÿ“… Scheduled auto-retraining
  • ๐ŸŒ Multi-language support
  • ๐Ÿข Team collaboration features
  • ๐Ÿ”Œ Public API and webhooks
  • ๐Ÿ“ฑ Mobile app

โฌ† Back to Top

Made with โค๏ธ by the CBase Team

About

Chatbase Dashboard - AI Chatbot Management Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •