# OpenAaaS Desktop Client

<p align="right"><a href="./README.md">中文</a> | English</p>

The desktop client for OpenAaaS, providing visual server management, service marketplace browsing, and task submission.

## Tech Stack

| Technology | Purpose |
|------------|---------|
| Tauri 2.0 | Cross-platform desktop framework |
| Vue 3 + TypeScript | Frontend UI and type safety |
| Tailwind CSS | Styling system |
| Pinia | State management |
| `@tauri-apps/plugin-http` | Direct server connection bypassing CORS |

## Features

- **Multi-server management** — Add, remove, register, and switch default servers
- **Service marketplace** — Browse available services across all servers, view real-time load and status
- **Service details** — View usage instructions and real-time load
- **Guided task submission** — Fill in task_prompt and output_prompt, with file upload support (drag-and-drop or click)
- **Auto task polling** — 5-second polling after submission, then 30-second intervals
- **Task details** — View task status, results (Markdown rendering), and download output files
- **Task list** — Filter by status, with server origin indicators
- **Data persistence** — Server configuration and local data stored in localStorage
- **Skeleton screens** — Loading placeholders on all async-loaded areas to prevent blank screens

## Build & Run

Requires Rust 1.85+, Node.js 18+, and [Tauri system dependencies](https://v2.tauri.app/start/prerequisites/).

```bash
cd client-app
npm install
cargo tauri dev      # Development mode
cargo tauri build    # Release build
```

In development mode, Tauri automatically opens a desktop window; frontend code supports hot reload, Rust code changes require a restart.

### Local Development Default Server

To auto-seed a local default server in development mode, copy `.env.example` to `.env.local` and fill in your local credentials:

```bash
cp .env.example .env.local
```

`.env.local` is ignored by git and should not be committed. If `VITE_DEV_SERVER_URL` and `VITE_DEV_SERVER_API_KEY` are not configured, the client will not auto-create a default server.

## Build Artifacts

Release build artifacts are located at `src-tauri/target/release/bundle/`:

| Platform | Artifacts |
|----------|-----------|
| macOS | `.dmg` installer + `.app` bundle |
| Windows | `.msi` installer + `.exe` executable |
| Linux | `.deb` package |

## macOS Installation Note

The app is ad-hoc signed (without an Apple Developer ID). On first launch, macOS may warn **"cannot be opened because the developer cannot be verified."**

To open: Go to **System Settings → Privacy & Security → Security**, then click **"Open Anyway"**.

> 💡 This is preferable to no signing at all, which would show "damaged" and require a terminal command to remove quarantine attributes.
