| Branch | Build | Coverage |
|---|---|---|
| master |
Docker
What is Klask?
Klask is a modern, high-performance search engine for source code. Built with Rust and React, it provides fast, accurate code search across multiple Git repositories with advanced filtering and syntax highlighting.
π Modern Architecture (v2.x)
The latest version of Klask uses cutting-edge technologies for performance and developer experience:
Backend
- Rust - High-performance, memory-safe systems programming
- Axum - Modern async web framework
- Tantivy - Full-text search engine (Rust equivalent of Lucene)
- PostgreSQL - Robust relational database
- SQLx - Compile-time SQL verification
Frontend
- React 18 - Modern UI library with concurrent features
- TypeScript - Type-safe JavaScript
- Vite - Lightning-fast build tool
- TailwindCSS - Utility-first CSS framework
- React Query - Powerful data fetching and caching
Features
- β Multi-repository indexing (Git, GitLab, GitHub)
- β Real-time full-text search with Tantivy
- β JWT-based authentication
- β Syntax highlighting for 100+ languages
- β Advanced filtering (branches, projects, file types)
- β Scheduled auto-crawling with cron
- β Admin dashboard with metrics
- β Docker and Kubernetes ready
π¦ Quick Start
Local Development (Docker Compose)
The fastest way to run Klask locally:
# Clone the repository
git clone https://github.com/klask-dev/klask-dev.git
cd klask-dev
# Start all services with docker-compose
docker-compose up -d
# Access Klask at http://localhost:5173
# Backend API at http://localhost:3000
See docker-compose.yml for full configuration.
Manual Development Setup
Prerequisites
- Rust 1.70+ (install via rustup)
- Node.js 18+ and npm
- PostgreSQL 14+
- Docker (optional, for database)
1. Start PostgreSQL Database
# Using Docker (recommended)
docker-compose -f docker-compose.dev.yml up -d
# Or use your own PostgreSQL instance
# Make sure to create a database named 'klask'
2. Start Backend (Rust)
cd klask-rs
# Install dependencies and run migrations
cargo build
sqlx migrate run
# Start the backend server
cargo run --bin klask-rs
# Backend will be available at http://localhost:3000
3. Start Frontend (React)
cd klask-react
# Install dependencies
npm install
# Start the development server
npm run dev
# Frontend will be available at http://localhost:5173
π³ Docker Deployment
Docker Compose (Production)
# Pull and start services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Docker Images
# Backend
docker pull klask/klask-backend:latest
docker run -p 3000:3000 -e DATABASE_URL=postgres://... klask/klask-backend:latest
# Frontend
docker pull klask/klask-frontend:latest
docker run -p 5173:80 klask/klask-frontend:latest
βΈοΈ Kubernetes Deployment (Helm)
Quick Install
# Add Klask Helm repository (if available)
helm repo add klask https://charts.klask.dev
helm repo update
# Install with default values
helm install klask klask/klask
# Install with custom values
helm install klask klask/klask -f my-values.yaml
Basic Configuration Example
Create a values.yaml:
backend:
replicaCount: 2
image:
repository: klask/klask-backend
tag: "2.1.0"
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
frontend:
replicaCount: 2
image:
repository: klask/klask-frontend
tag: "2.1.0"
postgresql:
enabled: true
auth:
username: klask
password: changeme
database: klask
ingress:
enabled: true
className: nginx
hosts:
- host: klask.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: klask-tls
hosts:
- klask.example.com
Then install:
helm install klask ./charts/klask -f values.yaml
See full Helm documentation: charts/klask/README.md
π οΈ Development
Project Structure
klask-dev/
βββ klask-rs/ # Rust backend (Axum + Tantivy + PostgreSQL)
β βββ src/
β β βββ api/ # REST API endpoints
β β βββ models/ # Database models
β β βββ services/ # Business logic (crawler, search, etc.)
β β βββ repositories/ # Database queries
β βββ migrations/ # SQL migrations (SQLx)
β βββ Cargo.toml
β
βββ klask-react/ # React frontend (TypeScript + Vite + TailwindCSS)
β βββ src/
β β βββ api/ # API client (React Query)
β β βββ components/ # Reusable UI components
β β βββ features/ # Feature modules (search, admin, etc.)
β β βββ hooks/ # Custom React hooks
β βββ package.json
β
βββ charts/klask/ # Helm chart for Kubernetes deployment
βββ .claude/ # AI-assisted development tools
βββ docker-compose.yml # Local development environment
Running Tests
# Backend tests (Rust)
cd klask-rs
cargo test
# Frontend tests (React)
cd klask-react
npm test
# Integration tests
npm run test:integration
Building for Production
# Backend
cd klask-rs
cargo build --release
# Frontend
cd klask-react
npm run build
# Docker images
docker build -t klask/klask-backend:latest -f klask-rs/Dockerfile .
docker build -t klask/klask-frontend:latest -f klask-react/Dockerfile .
π Documentation
- Development Guide - Comprehensive guide for contributors
- Helm Deployment - Kubernetes deployment guide
- API Documentation - REST API reference
- Architecture - System architecture overview
π€ Contributing
Contributions are welcome! Please read our contributing guide before submitting pull requests.
Development Workflow
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
cargo test && npm test) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
π Links
- Website: klask.dev
- Documentation: docs.klask.dev
- Issue Tracker: GitHub Issues
- Discussions: GitHub Discussions
π Acknowledgments
Built with powerful open-source technologies: