# HuLa Project Context ## Overview HuLa is a modern, cross-platform Instant Messaging (IM) system. It leverages **Tauri v2** for the application container, **Vite 7** for fast frontend tooling, **Vue 3** for the user interface, and **TypeScript** for type safety. The backend logic is implemented in **Rust**. The project supports: - **Desktop:** Windows, macOS, Linux - **Mobile:** Android, iOS ## Tech Stack ### Frontend - **Framework:** Vue 3 (Composition API) - **Language:** TypeScript - **Build Tool:** Vite 7 - **State Management:** Pinia (with persistence plugins) - **Routing:** Vue Router - **Styling:** UnoCSS, Sass - **UI Libraries:** Naive UI (Desktop), Vant (Mobile) - **I18n:** vue-i18n ### Backend (Rust / Tauri) - **Core:** Tauri v2 - **Database:** SQLite (managed via SeaORM with SQLCipher support) - **Async Runtime:** Tokio - **HTTP Client:** Reqwest - **WebSocket:** tokio-tungstenite - **Audio:** Rodio ## Development Workflow ### Prerequisites - Node.js (v20+ recommended) - pnpm (v10+ recommended) - Rust (latest stable) - Android Studio / Xcode (for mobile development) ### Key Commands | Action | Command | Description | | :--- | :--- | :--- | | **Install Dependencies** | `pnpm install` | Installs Node.js dependencies. | | **Start Desktop Dev** | `pnpm tauri:dev` | Starts the Tauri development server for desktop. | | **Build Desktop** | `pnpm tauri:build` | Builds the production application for desktop (interactive). | | **Commit Changes** | `pnpm commit` | Interactive git commit using Commitizen. | | **Lint/Format** | `pnpm check` | Checks code using Biome. | | **Run Tests** | `pnpm test:run` | Runs unit tests with Vitest. | ### Directory Structure - **`src/`**: Frontend source code. - **`views/`**: Page components. - **`stores/`**: Pinia stores. - **`services/`**: API and service layers (e.g., WebSocket adapter). - **`components/`**: Reusable Vue components. - **`layout/`**: App layout structures. - **`src-tauri/`**: Rust backend source code. - **`src/`**: Main Rust application logic. - **`entity/`**: SeaORM entity definitions. - **`migration/`**: Database migrations. - **`tauri.conf.json`**: Tauri configuration. - **`tauri-plugin-hula/`**: Custom local Tauri plugin. ## Coding Style & Naming Conventions - Indent 2 spaces, LF endings, trim whitespace (see `.editorconfig`). - Format/lint with Biome: `pnpm check` (read-only) / `pnpm check:write` (fixes). Vue templates also use Prettier: `pnpm format:vue` or `pnpm format:all`. - Prefer import aliases: `@/` → `src/`, `~/` → repo root. - Naming: components `PascalCase.vue`, composables `useXxx.ts`, Pinia stores in `src/stores/`. - **Commits:** Use `pnpm commit` to enforce Conventional Commits. - **Styling:** Use UnoCSS utility classes where possible. - **State:** Use Pinia for global state; prefer Composition API `