mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-12-23 08:21:11 +00:00
Some checks failed
CI / build-test (macos-14) (push) Has been cancelled
CI / build-test (ubuntu-24.04) (push) Has been cancelled
CI / build-test (windows-latest) (push) Has been cancelled
JSR Publish / publish (push) Has been cancelled
NPM Package Publish / publish-npm (push) Has been cancelled
claude, gemini, qwen, codex
3.6 KiB
3.6 KiB
Kunkun Project Context
Project Overview
Kunkun is a cross-platform desktop application built with Tauri (Rust + Svelte). It serves as an extensible platform, allowing users to install and run various extensions to add functionality. These extensions can provide UI components, headless commands, or template-based UIs. The project uses a monorepo structure managed by pnpm and Cargo for Node.js/Rust workspaces.
Key features include:
- Cross-platform support (MacOS, Linux, Windows)
- Extensibility via a rich extension system
- Built-in extension store
- Permissions system for extensions
- CLI tools for extension development and management
Technologies Used
- Frontend: Svelte 5, SvelteKit, Tailwind CSS
- Backend/Desktop: Rust (Tauri framework)
- Package Management: pnpm (Node.js), Cargo (Rust)
- Build System: TurboRepo
- Languages: TypeScript, Rust, Svelte
- Database: Drizzle ORM (SQLite)
- UI Library: Custom internal UI library (
@kksh/ui) - API Layer: Custom API library (
@kksh/api)
Project Structure
.
├── apps
│ ├── cli # Kunkun CLI tool
│ ├── create-kunkun # Tool for scaffolding new extensions
│ └── desktop # Main Tauri desktop application
├── packages
│ ├── api # Shared API types and utilities for extensions
│ ├── extensions # Official extensions
│ ├── schema # JSON schemas
│ ├── templates # Extension templates
│ ├── tauri-plugins # Custom Tauri plugins
│ ├── ui # Shared Svelte UI components
│ └── ... # Other shared libraries and tools
├── vendors # Vendored external dependencies
└── ...
Building and Running
Prerequisites
- Node.js >= 22
- pnpm
- Rust toolchain
- Platform-specific dependencies for Tauri (see Tauri docs)
Setup
- Install dependencies:
pnpm install
Development
- Start the development server:
This command uses TurboRepo to run thepnpm devdevscript in all relevant packages/apps.
Building
- Build the project:
This command uses TurboRepo to run thepnpm buildbuildscript in all relevant packages/apps.
Testing
- Run tests:
This command uses TurboRepo to run thepnpm testtestscript in all relevant packages/apps.
Linting and Formatting
-
Lint the code:
pnpm lint -
Format the code:
pnpm format
Running the Desktop App
After building, the desktop app can be run directly or packaged for distribution using Tauri's CLI. Check apps/desktop/src-tauri for Tauri-specific configurations and build commands.
Development Conventions
- Monorepo: The project uses a monorepo structure with pnpm workspaces for Node.js packages and Cargo workspaces for Rust crates.
- Code Style: Prettier is used for code formatting. ESLint is used for linting JavaScript/TypeScript/Svelte files.
- Type Safety: TypeScript is used extensively. Svelte 5's runes are leveraged for state management.
- UI Components: Reusable UI components are developed in
packages/uiusing Tailwind CSS and Svelte. - API: A shared API library (
packages/api) provides types and utilities for both the main app and extensions. - Extensions: Extensions are developed as separate packages within the monorepo (e.g.,
packages/extensions/*). They define their metadata, permissions, and entry points in theirpackage.jsonunder thekunkunkey.