A powerful RAG (Retrieval-Augmented Generation) application for intelligent document processing and AI-powered conversations
- Overview
- Features
- Architecture
- Tech Stack
- Getting Started
- Running the Application
- Project Structure
- Development
- Testing
- Environment Variables
- Contributing
- License
DataDot is a comprehensive RAG application that combines a modern Next.js frontend with powerful Python backend services to provide:
- Multi-LLM Support: Integration with OpenAI, Anthropic, Google Gemini, Cohere, and Ollama
- Smart Document Processing: Convert and process PDFs, Word docs, Excel files, images, audio, and more
- Intelligent Chat Interface: Real-time streaming conversations with AI agents
- Workspace Management: Organize documents and conversations by project
- Vector Search: Multiple vector database support (LanceDB, ChromaDB, Pinecone, Qdrant, Weaviate)
- MCP Server: Model Context Protocol server for AI agent integration
- Customizable Themes: Dark/light mode with custom branding
- Internationalization: Multi-language support via i18next
- Built with Next.js 16 (App Router) and React 19
- Real-time chat with streaming responses (SSE + WebSockets)
- Responsive design with mobile support
- Custom theme system with CSS variables
- JWT-based authentication
- Drag-and-drop file uploads
- Text-to-speech and speech-to-text capabilities
- Data visualization with Recharts
- FastAPI with async support
- Multi-user mode with workspace isolation
- Secure authentication with JWT tokens
- Unified LLM interface for multiple providers
- Vector database operations for RAG
- Background job scheduling
- Comprehensive API documentation (OpenAPI/Swagger)
- Support for 9+ file formats (PDF, DOCX, XLSX, EPUB, MBOX, images, audio)
- Audio transcription with OpenAI Whisper
- OCR for images using Tesseract
- Web scraping with depth control
- GitHub/GitLab repository ingestion
- YouTube transcript extraction
- Obsidian Vault processing
- Automatic token counting and text chunking
- Model Context Protocol (MCP) server for AI agent integration
- SSE (Server-Sent Events) transport for real-time communication
- Dynamic configuration updates at runtime
- API key authentication
- Multiple LLM provider support
- Document upload and processing tools
- Vector database query tools
- Workspace management tools
DataDot consists of four main components:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend Server β β Collector β
β (Next.js) ββββββββββΊβ (FastAPI) ββββββββββΊβ (FastAPI) β
β Port 3000 β β Port 3001 β β Port 8888 β
βββββββββββββββββββ ββββββββββ¬βββββββββ βββββββββββββββββββ
β β β
β β β
β ββββββββββ΄βββββββββ β
β β MCP Server β β
β β (FastAPI) β β
β β Port 8080 β β
β ββββββββββ¬βββββββββ β
β β β
v v v
User Interface βββββββββββββββββββ Document Processing
Chat & Workspaces β Vector Database β File Conversion
Theme System β SQLite/Postgresβ OCR & Transcription
AI Agent Integration β Embeddings β Web Scraping
βββββββββββββββββββ
- User uploads document β Frontend β Collector β Processes and returns metadata
- User sends chat message β Frontend β Backend β LLM Provider β Streaming response
- Backend queries documents β Vector DB β Retrieves relevant context β Enhances LLM prompt
- AI agents connect β MCP Server β Backend β Access documents and workspaces
- Framework: Next.js 16 with App Router and Turbopack
- Language: TypeScript 5
- UI: React 19, Tailwind CSS, Radix UI
- State: React Context API
- Streaming: Server-Sent Events (SSE), WebSockets
- Charts: Recharts
- Icons: Phosphor Icons, Lucide React
- Framework: FastAPI 0.110
- Language: Python 3.9+
- Database: SQLAlchemy (SQLite/PostgreSQL)
- Authentication: JWT with passlib/bcrypt
- LLMs: OpenAI, Anthropic, Google Gemini, Cohere, Ollama
- Vectors: LanceDB, ChromaDB, Pinecone, Qdrant, Weaviate
- Background Jobs: APScheduler
- Framework: FastAPI 0.115
- PDF: PyPDF2, PyMuPDF
- Office: python-docx, openpyxl, python-pptx, odfpy
- OCR: pytesseract
- Audio: OpenAI Whisper, ffmpeg
- Web: httpx, BeautifulSoup4, Playwright
- Tokens: tiktoken
- Node.js 18+ and npm
- Python 3.9+
- Git
- Tesseract (for OCR) - Optional but recommended
- FFmpeg (for audio processing) - Optional but recommended
- Docker (for containerized deployment) - Optional
Windows (using Chocolatey):
choco install tesseract ffmpegmacOS (using Homebrew):
brew install tesseract ffmpegLinux (Ubuntu/Debian):
sudo apt-get update
sudo apt-get install tesseract-ocr ffmpeg- Clone the repository
git clone https://github.com/meetpatel006/datadot.git
cd datadot- Install Frontend Dependencies
npm install- Install Backend Server Dependencies
cd server
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
pip install -r requirements.txt
cd ..- Install Collector Dependencies
cd collector
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
pip install -r requirements.txt
# Install Playwright browsers
playwright install chromium
cd ..- Frontend Environment - Create
.env.localin the root directory:
NEXT_PUBLIC_API_BASE=http://localhost:3001/api
NODE_ENV=development- Backend Server Environment - Create
.envin theserver/directory:
# Server Configuration
PORT=3001
HOST=0.0.0.0
WORKERS=1
RELOAD=true
LOG_LEVEL=INFO
# Database
DATABASE_URL=sqlite:///./datadot.db
# Security
JWT_SECRET_KEY=your-secret-key-change-this
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=10080
# Multi-user Mode
MULTI_USER_MODE=true
# LLM Providers (add your API keys)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=...
COHERE_API_KEY=...
# Collector Integration
COLLECTOR_API_URL=http://localhost:8888
COLLECTOR_API_KEY=your-collector-key
# Vector Database (choose one)
VECTOR_DB=lancedb # or chromadb, pinecone, qdrant, weaviate- Collector Environment - Create
.envin thecollector/directory:
# Server Configuration
PORT=8888
HOST=0.0.0.0
NODE_ENV=production
LOG_LEVEL=INFO
# Security
COLLECTOR_API_KEY=your-collector-key
# AI Services
OPENAI_API_KEY=sk-... # For Whisper audio transcription
# External Services (optional)
GITHUB_TOKEN=ghp_...
GITLAB_TOKEN=glpat-...You'll need to run all three services in separate terminals:
Terminal 1 - Frontend:
npm run dev
# Access at http://localhost:3000Terminal 2 - Backend Server:
cd server
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac
python main.py
# API at http://localhost:3001Terminal 3 - Document Collector:
cd collector
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac
python run.py
# API at http://localhost:8888
# Docs at http://localhost:8888/docsFrontend:
npm run build
npm startBackend Services:
# Use production ASGI server with multiple workers
cd server
uvicorn app.main:app --host 0.0.0.0 --port 3001 --workers 4
cd collector
uvicorn app.main:app --host 0.0.0.0 --port 8888 --workers 2The easiest way to run the entire stack:
cd docker
# Copy and configure environment
cp .env.example .env
# Edit .env with your configuration
# Build and start all services
docker compose -f docker-compose.combined.yml up --build
# Or run in detached mode
docker compose -f docker-compose.combined.yml up -d --build
# View logs
docker compose -f docker-compose.combined.yml logs -f
# Stop services
docker compose -f docker-compose.combined.yml downServices will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- Collector API: http://localhost:8888
- MCP Server: http://localhost:8080
- API Documentation: http://localhost:8888/docs
Datadot/
βββ app/ # Next.js App Router pages
β βββ Main/ # Dashboard and home
β βββ workspace/ # Workspace pages
β βββ login/ # Authentication pages
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ WorkspaceChat/ # Chat UI components
β βββ Sidebar/ # Navigation
β βββ Modals/ # Modal dialogs
βββ context/ # React Context providers
β βββ AuthContext.tsx # Authentication state
β βββ ThemeContext.tsx # Theme management
β βββ I18nProvider.tsx # Internationalization
βββ models/ # API client layer
β βββ workspace.ts # Workspace API
β βββ system.ts # System API
β βββ admin.ts # Admin API
βββ utils/ # Helper functions
β βββ paths.ts # Route definitions
β βββ request.ts # HTTP utilities
β βββ constants.ts # App constants
βββ hooks/ # Custom React hooks
βββ types/ # TypeScript definitions
βββ i18n/ # i18next configuration
βββ lib/ # Shared libraries
βββ public/ # Static assets
βββ server/ # Python FastAPI backend
β βββ app/
β β βββ api/ # API endpoints
β β βββ core/ # Configuration
β β βββ crud/ # Database operations
β β βββ models/ # SQLAlchemy models
β β βββ schemas/ # Pydantic schemas
β β βββ services/ # Business logic
β β βββ utils/ # Utilities
β βββ main.py # Entry point
β βββ requirements.txt # Dependencies
βββ collector/ # Document processor
β βββ app/
β β βββ converters/ # File converters
β β βββ extensions/ # External loaders
β β βββ processors/ # Processing logic
β β βββ routes/ # API routes
β β βββ utils/ # Utilities
β βββ run.py # Entry point
β βββ requirements.txt # Dependencies
βββ mcp/ # MCP Server
β βββ app/
β β βββ tools/ # MCP tools
β β βββ prompts/ # MCP prompts
β β βββ config.py # Configuration
β β βββ utils.py # Utilities
β β βββ server.py # MCP server setup
β βββ main.py # Entry point
β βββ requirements.txt # Dependencies
βββ docker/ # Docker configuration
β βββ docker-compose.combined.yml
β βββ .env.example
βββ package.json # Frontend dependencies
βββ next.config.ts # Next.js config
βββ tailwind.config.js # Tailwind config
βββ tsconfig.json # TypeScript config
Frontend:
- Follow existing TypeScript patterns
- Use Tailwind utility classes
- Prefer functional components with hooks
- Use
"use client"directive for client-side features
Backend:
- Follow PEP 8 style guide
- Use type hints for all functions
- Write docstrings for public APIs
- Use async/await for I/O operations
# Frontend
npm run lint
# Backend (if configured)
cd server
ruff check .
cd collector
ruff check .New Frontend Page:
- Create page in
app/directory - Add route helper to
utils/paths.ts - Update navigation in
components/Sidebar/
New API Endpoint:
- Add route in
server/app/api/ - Create service logic in
server/app/services/ - Add schema in
server/app/schemas/
New Document Converter:
- Create converter in
collector/app/converters/ - Add MIME type mapping in
utils/constants.py - Register in processor routing
No test framework currently configured. Test manually:
npm run dev
# Test in browser at http://localhost:3000cd server
pytest # Run all tests
pytest -v # Verbose output
pytest --cov=app tests/ # With coverage
cd ../collector
pytest # Run collector tests| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_API_BASE |
Backend API URL | http://localhost:3001/api |
NODE_ENV |
Environment mode | development |
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
Database connection string | β |
JWT_SECRET_KEY |
Secret for JWT tokens | β |
OPENAI_API_KEY |
OpenAI API key | |
ANTHROPIC_API_KEY |
Anthropic API key | |
COLLECTOR_API_URL |
Collector service URL | β |
MULTI_USER_MODE |
Enable multi-user | β |
| Variable | Description | Required |
|---|---|---|
COLLECTOR_API_KEY |
API authentication key | β |
OPENAI_API_KEY |
For Whisper transcription | |
GITHUB_TOKEN |
GitHub API access | β |
GITLAB_TOKEN |
GitLab API access | β |
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Write clear, descriptive commit messages
- Add tests for new features
- Update documentation as needed
- Follow existing code style and patterns
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js team for the amazing framework
- FastAPI for the excellent Python web framework
- All the open-source libraries that make this project possible
For issues, questions, or contributions:
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with β€οΈ using Next.js, React, and FastAPI