Home
Softono

Klask Dev

Open source TypeScript
61
Stars
27
Forks
10
Issues
5
Watchers
3 months
Last Commit

 About Klask Dev

klask.dev is an open source search engine for source code, live demo

Platforms

Web Self-hosted

Languages

TypeScript

Need Help Installing Klask Dev?

We provide expert installation service for this software. Our team will install, configure, and secure Klask Dev on your server. plans start at just $30.

klask.dev

Branch Build Coverage
master CI/CD Pipeline Coverage Status

Docker

Docker Stars Docker pulls Docker build

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


🀝 Contributing

Contributions are welcome! Please read our contributing guide before submitting pull requests.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (cargo test && npm test)
  5. Commit your changes (git commit -m 'feat: add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

πŸ“„ License

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


πŸ”— Links


πŸ™ Acknowledgments

Built with powerful open-source technologies: