# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: StarHub
spec:
    description: Professional GitHub Stars Management Tool - Organize your GitHub Star collection with AI-powered smart classification
    coverImage: https://github.com/hujinghaoabcd/StarHub/raw/main/public/screenshot-02.png
    icon: https://raw.githubusercontent.com/hujinghaoabcd/StarHub/refs/heads/main/public/logo.svg
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: Domain for your StarHub instance
        - key: CLIENT_ID
          type: STRING
          name: GitHub OAuth Client ID
          description: GitHub OAuth Application Client ID. Create one at https://github.com/settings/developers
        - key: CLIENT_SECRET
          type: STRING
          name: GitHub OAuth Client Secret
          description: GitHub OAuth Application Client Secret. Required for OAuth token exchange.
    tags:
        - GitHub
        - Tools
        - AI
        - Management
    readme: |
        # StarHub

        Professional GitHub Stars management application designed for developers. Organize your GitHub Star collection and never lose track of great projects.

        ## Features

        - **Smart Tag System**: Create unlimited custom tags with Emoji icons and color coding
        - **AI Auto-Classification**: One-click intelligent categorization with support for multiple AI providers (OpenAI, Claude, DeepSeek, Qwen, Zhipu AI)
        - **Lightning-Fast Search**: Multi-dimensional search with millisecond response based on IndexedDB
        - **README Preview**: Quick project overview without leaving the app
        - **Dark Mode & Multi-language**: Carefully designed themes with full Chinese/English bilingual support
        - **PWA Support**: Install to desktop for native-like offline experience

        ## Configuration

        ### Step 1: Create GitHub OAuth App

        1. Visit [GitHub Developer Settings](https://github.com/settings/developers)
        2. Click **New OAuth App**
        3. Fill in application information:
           - **Application name**: `StarHub` (or any name)
           - **Homepage URL**: Your deployed domain (e.g., `https://your-starhub.zeabur.app`)
           - **Authorization callback URL**: `https://your-starhub.zeabur.app/#/login`
        4. Click **Register application**
        5. Copy the **Client ID** and **Client Secret**

        ### Step 2: Configure Environment Variables

        During deployment, you'll need to provide:
        - **CLIENT_ID**: Your GitHub OAuth Application Client ID
        - **CLIENT_SECRET**: Your GitHub OAuth Application Client Secret

        > **Important**: Make sure to update the Authorization callback URL in your GitHub OAuth App settings after deployment with your actual domain.

        ### Step 3: Configure AI Services (Optional)

        After deployment, you can configure AI services in the Settings page:
        1. Open your deployed StarHub instance
        2. Login with your GitHub account
        3. Navigate to the **Settings** page
        4. Configure your preferred AI provider and API Key for intelligent classification

        ## Supported AI Providers

        - **OpenAI** (gpt-4o-mini) - Cost-effective, recommended
        - **Claude** (claude-3-5-sonnet) - Strong understanding capability
        - **DeepSeek** (deepseek-chat) - Fast Chinese model
        - **Qwen** (qwen-plus) - Alibaba Cloud, Chinese-friendly
        - **Zhipu AI** (glm-4-flash) - Chinese model with free quota

        ## Source

        [GitHub Repository](https://github.com/hujinghaoabcd/StarHub)
    services:
        - name: starhub
          icon: https://raw.githubusercontent.com/hujinghaoabcd/StarHub/refs/heads/main/public/logo.svg
          template: PREBUILT
          spec:
            source:
                source: GITHUB
                repo: 1127564455
                branch: zeabur-deploy
            ports:
                - id: web
                  port: 7001
                  type: HTTP
            env:
                CLIENT_ID:
                    default: ${CLIENT_ID}
                CLIENT_SECRET:
                    default: ${CLIENT_SECRET}
                VITE_CLIENT_ID:
                    default: ${CLIENT_ID}
          domainKey: PUBLIC_DOMAIN
localization:
    zh-TW:
        description: 專業 GitHub Stars 管理工具 - 透過 AI 智慧分類整理你的 GitHub Star 收藏
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: 網域
              description: 你的 StarHub 網域
            - key: CLIENT_ID
              type: STRING
              name: GitHub OAuth Client ID
              description: GitHub OAuth 應用程式 Client ID。請至 https://github.com/settings/developers 建立
            - key: CLIENT_SECRET
              type: STRING
              name: GitHub OAuth Client Secret
              description: GitHub OAuth 應用程式 Client Secret。OAuth token 交換所需。
        readme: |
            # StarHub

            專為開發者設計的 GitHub Stars 管理應用程式。整理你的 GitHub Star 收藏，不再遺失優質專案。

            ## 功能特色

            - **智慧標籤系統**：建立無限制的自訂標籤，支援 Emoji 圖示和色彩編碼
            - **AI 自動分類**：一鍵智慧分類，支援多種 AI 提供商（OpenAI、Claude、DeepSeek、Qwen、智譜 AI）
            - **閃電般快速搜尋**：基於 IndexedDB 的多維度搜尋，毫秒級回應
            - **README 預覽**：無需離開應用程式即可快速瀏覽專案概述
            - **深色模式與多語言**：精心設計的主題，完整支援中英雙語
            - **PWA 支援**：安裝至桌面，提供原生般的離線體驗

            ## 設定方式

            ### 步驟 1：建立 GitHub OAuth 應用程式

            1. 前往 [GitHub Developer Settings](https://github.com/settings/developers)
            2. 點擊 **New OAuth App**
            3. 填寫應用程式資訊：
               - **Application name**：`StarHub`（或任何名稱）
               - **Homepage URL**：你的部署網域（例如 `https://your-starhub.zeabur.app`）
               - **Authorization callback URL**：`https://your-starhub.zeabur.app/#/login`
            4. 點擊 **Register application**
            5. 複製 **Client ID** 和 **Client Secret**

            ### 步驟 2：設定環境變數

            部署時需要提供：
            - **CLIENT_ID**：你的 GitHub OAuth 應用程式 Client ID
            - **CLIENT_SECRET**：你的 GitHub OAuth 應用程式 Client Secret

            > **重要**：部署完成後，請記得使用實際網域更新 GitHub OAuth App 設定中的 Authorization callback URL。

            ### 步驟 3：設定 AI 服務（選填）

            部署完成後，你可以在設定頁面配置 AI 服務：
            1. 開啟你部署的 StarHub 實例
            2. 使用你的 GitHub 帳號登入
            3. 前往「**設定**」頁面
            4. 配置你偏好的 AI 提供商和 API 金鑰以進行智慧分類

            ## 支援的 AI 提供商

            - **OpenAI** (gpt-4o-mini) - 經濟實惠，推薦使用
            - **Claude** (claude-3-5-sonnet) - 強大的理解能力
            - **DeepSeek** (deepseek-chat) - 快速的中文模型
            - **Qwen** (qwen-plus) - 阿里雲，對中文友善
            - **智譜 AI** (glm-4-flash) - 中文模型，提供免費額度

            ## 原始碼

            [GitHub Repository](https://github.com/hujinghaoabcd/StarHub)
