## Summary This PR sets up the complete CI/CD infrastructure for the Chat Switchboard project, implementing automated testing, linting, building, and Docker containerization. ## Changes ### CI/CD Workflows 1. **`.gitea/workflows/backend.yml`** - Backend CI pipeline - Automated Go module initialization - Test execution with coverage reporting - Code linting with golangci-lint - Binary compilation with version tags - Artifact upload for debugging 2. **`.gitea/workflows/frontend.yml`** - Frontend CI pipeline - JavaScript linting with ESLint - CSS validation with Prettier - Standalone HTML build via build.sh - HTML structure validation - Build artifact management 3. **`.gitea/workflows/docker.yml`** - Docker CI pipeline - Backend container building and testing - Frontend container building - Automatic image tagging on tags/branches - Registry push on main branch - Multi-arch manifest creation ### Docker Configuration - `server/Dockerfile` - Multi-stage Go backend container with health checks - `Dockerfile.frontend` - Nginx frontend container with gzip compression - `nginx.conf` - Optimized nginx config with security headers ### Dependencies - `server/go.mod` - Initialized Go module with Gin and godotenv ### Documentation - `docs/CICD_SETUP.md` - Comprehensive CI/CD documentation ## Features - ✅ Auto-trigger on push/PR to main/develop - ✅ Test coverage reporting - ✅ Code quality checks (golangci-lint, ESLint) - ✅ Build artifact management (7-day retention) - ✅ Semantic versioning support (v* tags) - ✅ Multi-stage Docker builds - ✅ Container health checks - ✅ Security headers in nginx - ✅ Gzip compression - ✅ Non-root container execution ## Testing The workflows will automatically run on this PR. Once merged, all future PRs and pushes to main/develop will trigger the appropriate CI checks. ## Acceptance Criteria - ✅ All PRs run CI checks - ✅ Docker images auto-build on tags - ✅ Standalone build generates on each commit ## Next Steps (Manual) 1. Merge this PR to `main` 2. Create `develop` branch: `git checkout main && git checkout -b develop && git push origin develop` 3. Configure branch protection in Gitea (Settings → Branches → Add protection rule for main/develop) 4. Test with a sample PR to verify CI runs ## Breaking Changes None. This is purely infrastructure setup with no impact on existing functionality. Reviewed-on: xcaliber/chat-switchboard#22
🔀 Chat Switchboard
The Plugin-First, Multi-Model AI Platform
Chat Switchboard is a next-generation AI interface that works offline or managed, with a unique plugin architecture and visual workflow builder.
🎯 What Makes Us Different
| Feature | Chat Switchboard | Others |
|---|---|---|
| Works Offline | ✅ Full-featured unmanaged mode | ❌ Backend required |
| Plugin System | ✅ Core features ARE plugins | 🟡 Limited or none |
| Visual Workflows | ✅ Chain multiple AI models | ❌ Single-shot only |
| Multi-Model Routing | ✅ Auto-select best/cheapest | 🟡 Manual only |
| Channels | ✅ User + AI collaboration | 🟡 Users only |
| Self-Hosted | ✅ Easy Docker setup | 🟡 Complex |
Unique Selling Points:
- Workflows - No competitor has visual AI orchestration (like n8n for LLMs)
- Dual-Mode - Privacy-first offline mode OR full collaboration backend
- Plugin-First - Chat, Channels, Notes are ALL plugins (proves extensibility)
- Smart Routing - Automatic model selection for cost/quality optimization
🚀 Quick Start
Option 1: Offline Mode (No Backend)
# Clone and build
git clone https://git.gobha.me/xcaliber/chat-switchboard.git
cd chat-switchboard
./build.sh
# Open in browser
xdg-open standalone/index.html
Configure API:
- Click ⚙️ Settings
- Enter API endpoint (OpenAI, OpenRouter, Venice.ai, Ollama, etc.)
- Add your API key
- Start chatting!
Option 2: Full Backend (Collaboration + Workflows)
# Clone repo
git clone https://git.gobha.me/xcaliber/chat-switchboard.git
cd chat-switchboard
# Configure
cp .env.example .env
# Edit .env with your settings
# Start with Docker
docker-compose up -d
# Access at http://localhost:3000
See GETTING_STARTED.md for detailed instructions.
✨ Core Features
1. 💬 Chat (User → AI)
- Multi-model support (OpenAI, Anthropic, Ollama, etc.)
- Per-conversation model switching
- Streaming responses with stop button
- Export (Markdown, JSON, Plain Text)
- Auto-routing to best/cheapest model (managed mode)
2. 👥 Channels (User → User + AI)
Managed mode only
Multi-user chat rooms where you can @mention AI models:
#general
@alice: What do you think about this design?
@claude: I'd suggest a darker color scheme for better contrast...
@bob: Great idea! @gpt4 can you review the implementation?
@gpt4: I found a potential issue in the error handling...
- Public/private/DM channels
- Real-time updates (WebSocket)
- Threaded conversations
- Reactions and formatting
3. 📝 Notes & Knowledge Bases
- Markdown notes with folders
- Full-text and semantic search
- RAG (Retrieval Augmented Generation) in managed mode
- Link notes to chats
4. 🔄 Workflows ⭐ (UNIQUE FEATURE)
Managed mode only
Visual workflow builder for chaining AI models and tools:
[User Query] → [Web Search] → [GPT-4 Summarize] → [Claude Verify] → [Save to KB]
Use Cases:
- Research Assistant: Search → Summarize → Verify → Save
- Code Review: Fetch PR → Find Bugs → Security Check → Report
- Multi-Model Consensus: Run through 3 models → Vote → Best answer
- Content Factory: Outline → Draft → Edit → SEO → Publish
See WORKFLOWS.md for details.
🔌 Extension System
Everything is a Plugin
Chat Switchboard proves its extensibility by implementing core features as plugins:
Core (Minimal) Plugins (Modular)
├── HTTP Router ├── Chat Engine (Python)
├── WebSocket Hub ├── Channels (Go)
├── Extension Manager ├── RAG Engine (Python)
├── Auth/Users ├── Workflows (Go/Python)
└── PostgreSQL └── Your Custom Plugin...
Frontend Plugins (JavaScript)
// Simple UI extension
window.ChatSwitchboard.registerExtension({
name: 'token-counter',
hooks: {
onMessageSend: (msg) => {
const tokens = estimateTokens(msg);
showToast(`~${tokens} tokens`);
}
}
});
Backend Plugins (Python, Go, Node.js)
# Full-featured extension
from fastapi import FastAPI
app = FastAPI()
@app.post("/tools/web_search")
async def search_web(query: str):
results = duckduckgo_search(query)
return {"results": results}
Create a plugin:
# Use template
cp -r extensions/_template-python extensions/my-plugin
cd extensions/my-plugin
# Edit extension.json, main.py
python main.py
See PLUGIN_SPEC.md for complete guide.
📚 Documentation
- Getting Started - Installation and setup
- Architecture - System design and data flow
- Workflows - Visual workflow builder guide
- Plugin Spec - Extension development
- Roadmap - Development timeline and features
🏗️ Architecture
┌─────────────────────────────────────┐
│ Frontend (Vanilla JS) │
│ - Works offline (LocalStorage) │
│ - Switches to backend if available │
└─────────────┬───────────────────────┘
│
┌─────────┴─────────┐
│ │
[Unmanaged] [Managed Mode]
LocalStorage │
▼
┌────────────────┐
│ Go Backend │
│ - Auth/Users │
│ - WebSocket │
│ - Extensions │
└────────┬───────┘
│
┌─────────────┴──────────────┐
│ │
PostgreSQL Extensions
- Chats, users - Chat (Python)
- Channels - RAG (Python)
- Knowledge - Workflows (Go)
- pgvector - Custom tools...
🛠️ Tech Stack
Frontend
- Vanilla JavaScript - No framework bloat
- LocalStorage - Offline-first
- WebSocket - Real-time updates (managed)
Backend (Managed Mode)
- Go - Core API, routing, WebSocket
- PostgreSQL - Primary storage
- pgvector - Vector embeddings for RAG
- Redis - WebSocket pub/sub (optional)
- Python - AI/ML extensions
- Docker - Easy deployment
🎨 Screenshots
(Coming soon - will add workflow builder, channels, chat interface)
🗺️ Roadmap
Current: Phase 1 - Backend Core ✅
- Frontend (unmanaged mode)
- Go backend with PostgreSQL
- User authentication
- WebSocket server
- Extension manager
Next: Phase 2 - Core Features as Plugins
- Chat Engine (Python)
- Channels (Go)
- Notes (Go)
- RAG Engine (Python)
Future: Phase 3+
- Visual Workflow Builder
- Desktop app (Tauri)
- Extension marketplace
- Mobile PWA
See ROADMAP.md for complete timeline.
🤝 Contributing
We welcome contributions! Here's how:
- Pick a task from ROADMAP.md or GitHub Issues
- Fork the repo
- Create a feature branch
- Submit a PR
Good first issues:
- Frontend UI improvements
- Backend handler implementations
- Example extensions
- Documentation
📖 Example Use Cases
Personal (Unmanaged)
- Privacy-focused AI assistant
- Offline research tool
- Model comparison testing
Team (Managed)
- Collaborative AI workspace
- Shared knowledge bases
- Automated workflows
- Code review pipelines
Enterprise
- Self-hosted AI platform
- Custom model routing
- Compliance and audit logs
- SSO/SAML integration
🆚 Comparison
vs Open WebUI
- ✅ Works offline (unmanaged mode)
- ✅ Visual workflows (they don't have)
- ✅ Plugin-first architecture
- 🟰 Similar RAG features
vs ChatGPT/Claude Desktop
- ✅ Multi-model (not locked to one provider)
- ✅ Self-hosted option
- ✅ Open source
- ✅ Extensible (closed systems)
- 🟰 Similar UX quality
vs LangChain
- ✅ Visual workflow builder (no-code)
- ✅ Multi-model orchestration
- 🟰 Similar capabilities
- ❌ Less Python ecosystem (for now)
Unique Position: LangChain for non-coders + n8n for LLMs + privacy-first design
📄 License
MIT License - build anything, including commercial products.
🙏 Credits
Built with inspiration from:
- Open WebUI (knowledge bases, channels)
- Claude Desktop (thinking blocks)
- n8n (workflow concepts)
- VSCode (plugin architecture)
🔗 Links
- Repository: https://git.gobha.me/xcaliber/chat-switchboard
- Documentation: /docs
- Issues: GitHub Issues
- Discussions: (Coming soon)
Ready to build the future of AI interfaces? Star the repo and let's go! 🚀