🎬 火宝短剧 - 基于AI的一站式短剧生成平台 《一句话生成完整短剧,从剧本到成片全自动化》 Huobao Drama - An AI-Powered End-to-End Short Drama Generator "One Sentence to Complete Drama: Fully Automated from Script to Final Video"
TypeScript
docs(license): 采用 CC BY-NC-SA 4.0,README 补日/韩版本
Connore489ef0b5c9d
diff --git a/LICENSE b/LICENSEnew file mode 100644index 0000000..7cdbe0b--- /dev/null+++ b/LICENSE@@ -0,0 +1,438 @@+Attribution-NonCommercial-ShareAlike 4.0 International++=======================================================================++Creative Commons Corporation ("Creative Commons") is not a law firm and+does not provide legal services or legal advice. Distribution of+Creative Commons public licenses does not create a lawyer-client or+other relationship. Creative Commons makes its licenses and related+information available on an "as-is" basis. Creative Commons gives no+warranties regarding its licenses, any material licensed under their+terms and conditions, or any related information. Creative Commons+disclaims all liability for damages resulting from their use to the+fullest extent possible.++Using Creative Commons Public Licenses++Creative Commons public licenses provide a standard set of terms and+conditions that creators and other rights holders may use to share+original works of authorship and other material subject to copyright+and certain other rights specified in the public license below. The+following considerations are for informational purposes only, are not+exhaustive, and do not form part of our licenses.++ Considerations for licensors: Our public licenses are+ intended for use by those authorized to give the public+ permission to use material in ways otherwise restricted by+ copyright and certain other rights. Our licenses are+ irrevocable. Licensors should read and understand the terms+ and conditions of the license they choose before applying it.+ Licensors should also secure all rights necessary before+ applying our licenses so that the public can reuse the+ material as expected. Licensors should clearly mark any+ material not subject to the license. This includes other CC-+ licensed material, or material used under an exception or+ limitation to copyright. More considerations for licensors:+ wiki.creativecommons.org/Considerations_for_licensors++ Considerations for the public: By using one of our public+ licenses, a licensor grants the public permission to use the+ licensed material under specified terms and conditions. If+ the licensor's permission is not necessary for any reason--for+ example, because of any applicable exception or limitation to+ copyright--then that use is not regulated by the license. Our+ licenses grant only permissions under copyright and certain+ other rights that a licensor has authority to grant. Use of+ the licensed material may still be restricted for other+ reasons, including because others have copyright or other+ rights in the material. A licensor may make special requests,+ such as asking that all changes be marked or described.+ Although not required by our licenses, you are encouraged to+ respect those requests where reasonable. More considerations+ for the public:+ wiki.creativecommons.org/Considerations_for_licensees++=======================================================================++Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International+Public License++By exercising the Licensed Rights (defined below), You accept and agree+to be bound by the terms and conditions of this Creative Commons+Attribution-NonCommercial-ShareAlike 4.0 International Public License+("Public License"). To the extent this Public License may be+interpreted as a contract, You are granted the Licensed Rights in+consideration of Your acceptance of these terms and conditions, and the+Licensor grants You such rights in consideration of benefits the+Licensor receives from making the Licensed Material available under+these terms and conditions.+++Section 1 -- Definitions.++ a. Adapted Material means material subject to Copyright and Similar+ Rights that is derived from or based upon the Licensed Material+ and in which the Licensed Material is translated, altered,+ arranged, transformed, or otherwise modified in a manner requiring+ permission under the Copyright and Similar Rights held by the+ Licensor. For purposes of this Public License, where the Licensed+ Material is a musical work, performance, or sound recording,+ Adapted Material is always produced where the Licensed Material is+ synched in timed relation with a moving image.++ b. Adapter's License means the license You apply to Your Copyright+ and Similar Rights in Your contributions to Adapted Material in+ accordance with the terms and conditions of this Public License.++ c. BY-NC-SA Compatible License means a license listed at+ creativecommons.org/compatiblelicenses, approved by Creative+ Commons as essentially the equivalent of this Public License.++ d. Copyright and Similar Rights means copyright and/or similar rights+ closely related to copyright including, without limitation,+ performance, broadcast, sound recording, and Sui Generis Database+ Rights, without regard to how the rights are labeled or+ categorized. For purposes of this Public License, the rights+ specified in Section 2(b)(1)-(2) are not Copyright and Similar+ Rights.++ e. Effective Technological Measures means those measures that, in the+ absence of proper authority, may not be circumvented under laws+ fulfilling obligations under Article 11 of the WIPO Copyright+ Treaty adopted on December 20, 1996, and/or similar international+ agreements.++ f. Exceptions and Limitations means fair use, fair dealing, and/or+ any other exception or limitation to Copyright and Similar Rights+ that applies to Your use of the Licensed Material.++ g. License Elements means the license attributes listed in the name+ of a Creative Commons Public License. The License Elements of this+ Public License are Attribution, NonCommercial, and ShareAlike.++ h. Licensed Material means the artistic or literary work, database,+ or other material to which the Licensor applied this Public+ License.++ i. Licensed Rights means the rights granted to You subject to the+ terms and conditions of this Public License, which are limited to+ all Copyright and Similar Rights that apply to Your use of the+ Licensed Material and that the Licensor has authority to license.++ j. Licensor means the individual(s) or entity(ies) granting rights+ under this Public License.++ k. NonCommercial means not primarily intended for or directed towards+ commercial advantage or monetary compensation. For purposes of+ this Public License, the exchange of the Licensed Material for+ other material subject to Copyright and Similar Rights by digital+ file-sharing or similar means is NonCommercial provided there is+ no payment of monetary compensation in connection with the+ exchange.++ l. Share means to provide material to the public by any means or+ process that requires permission under the Licensed Rights, such+ as reproduction, public display, public performance, distribution,+ dissemination, communication, or importation, and to make material+ available to the public including in ways that members of the+ public may access the material from a place and at a time+ individually chosen by them.++ m. Sui Generis Database Rights means rights other than copyright+ resulting from Directive 96/9/EC of the European Parliament and of+ the Council of 11 March 1996 on the legal protection of databases,+ as amended and/or succeeded, as well as other essentially+ equivalent rights anywhere in the world.++ n. You means the individual or entity exercising the Licensed Rights+ under this Public License. Your has a corresponding meaning.+++Section 2 -- Scope.++ a. License grant.++ 1. Subject to the terms and conditions of this Public License,+ the Licensor hereby grants You a worldwide, royalty-free,+ non-sublicensable, non-exclusive, irrevocable license to+ exercise the Licensed Rights in the Licensed Material to:++ a. reproduce and Share the Licensed Material, in whole or+ in part, for NonCommercial purposes only; and++ b. produce, reproduce, and Share Adapted Material for+ NonCommercial purposes only.++ 2. Exceptions and Limitations. For the avoidance of doubt, where+ Exceptions and Limitations apply to Your use, this Public+ License does not apply, and You do not need to comply with+ its terms and conditions.++ 3. Term. The term of this Public License is specified in Section+ 6(a).++ 4. Media and formats; technical modifications allowed. The+ Licensor authorizes You to exercise the Licensed Rights in+ all media and formats whether now known or hereafter created,+ and to make technical modifications necessary to do so. The+ Licensor waives and/or agrees not to assert any right or+ authority to forbid You from making technical modifications+ necessary to exercise the Licensed Rights, including+ technical modifications necessary to circumvent Effective+ Technological Measures. For purposes of this Public License,+ simply making modifications authorized by this Section 2(a)+ (4) never produces Adapted Material.++ 5. Downstream recipients.++ a. Offer from the Licensor -- Licensed Material. Every+ recipient of the Licensed Material automatically+ receives an offer from the Licensor to exercise the+ Licensed Rights under the terms and conditions of this+ Public License.++ b. Additional offer from the Licensor -- Adapted Material.+ Every recipient of Adapted Material from You+ automatically receives an offer from the Licensor to+ exercise the Licensed Rights in the Adapted Material+ under the conditions of the Adapter's License You apply.++ c. No downstream restrictions. You may not offer or impose+ any additional or different terms or conditions on, or+ apply any Effective Technological Measures to, the+ Licensed Material if doing so restricts exercise of the+ Licensed Rights by any recipient of the Licensed+ Material.++ 6. No endorsement. Nothing in this Public License constitutes or+ may be construed as permission to assert or imply that You+ are, or that Your use of the Licensed Material is, connected+ with, or sponsored, endorsed, or granted official status by,+ the Licensor or others designated to receive attribution as+ provided in Section 3(a)(1)(A)(i).++ b. Other rights.++ 1. Moral rights, such as the right of integrity, are not+ licensed under this Public License, nor are publicity,+ privacy, and/or other similar personality rights; however, to+ the extent possible, the Licensor waives and/or agrees not to+ assert any such rights held by the Licensor to the limited+ extent necessary to allow You to exercise the Licensed+ Rights, but not otherwise.++ 2. Patent and trademark rights are not licensed under this+ Public License.++ 3. To the extent possible, the Licensor waives any right to+ collect royalties from You for the exercise of the Licensed+ Rights, whether directly or through a collecting society+ under any voluntary or waivable statutory or compulsory+ licensing scheme. In all other cases the Licensor expressly+ reserves any right to collect such royalties, including when+ the Licensed Material is used other than for NonCommercial+ purposes.+++Section 3 -- License Conditions.++Your exercise of the Licensed Rights is expressly made subject to the+following conditions.++ a. Attribution.++ 1. If You Share the Licensed Material (including in modified+ form), You must:++ a. retain the following if it is supplied by the Licensor+ with the Licensed Material:++ i. identification of the creator(s) of the Licensed+ Material and any others designated to receive+ attribution, in any reasonable manner requested by+ the Licensor (including by pseudonym if+ designated);++ ii. a copyright notice;++ iii. a notice that refers to this Public License;++ iv. a notice that refers to the disclaimer of+ warranties;++ v. a URI or hyperlink to the Licensed Material to the+ extent reasonably practicable;++ b. indicate if You modified the Licensed Material and+ retain an indication of any previous modifications; and++ c. indicate the Licensed Material is licensed under this+ Public License, and include the text of, or the URI or+ hyperlink to, this Public License.++ 2. You may satisfy the conditions in Section 3(a)(1) in any+ reasonable manner based on the medium, means, and context in+ which You Share the Licensed Material. For example, it may be+ reasonable to satisfy the conditions by providing a URI or+ hyperlink to a resource that includes the required+ information.+ 3. If requested by the Licensor, You must remove any of the+ information required by Section 3(a)(1)(A) to the extent+ reasonably practicable.++ b. ShareAlike.++ In addition to the conditions in Section 3(a), if You Share+ Adapted Material You produce, the following conditions also apply.++ 1. The Adapter's License You apply must be a Creative Commons+ license with the same License Elements, this version or+ later, or a BY-NC-SA Compatible License.++ 2. You must include the text of, or the URI or hyperlink to, the+ Adapter's License You apply. You may satisfy this condition+ in any reasonable manner based on the medium, means, and+ context in which You Share Adapted Material.++ 3. You may not offer or impose any additional or different terms+ or conditions on, or apply any Effective Technological+ Measures to, Adapted Material that restrict exercise of the+ rights granted under the Adapter's License You apply.+++Section 4 -- Sui Generis Database Rights.++Where the Licensed Rights include Sui Generis Database Rights that+apply to Your use of the Licensed Material:++ a. for the avoidance of doubt, Section 2(a)(1) grants You the right+ to extract, reuse, reproduce, and Share all or a substantial+ portion of the contents of the database for NonCommercial purposes+ only;++ b. if You include all or a substantial portion of the database+ contents in a database in which You have Sui Generis Database+ Rights, then the database in which You have Sui Generis Database+ Rights (but not its individual contents) is Adapted Material,+ including for purposes of Section 3(b); and++ c. You must comply with the conditions in Section 3(a) if You Share+ all or a substantial portion of the contents of the database.++For the avoidance of doubt, this Section 4 supplements and does not+replace Your obligations under this Public License where the Licensed+Rights include other Copyright and Similar Rights.+++Section 5 -- Disclaimer of Warranties and Limitation of Liability.++ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.++ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.++ c. The disclaimer of warranties and limitation of liability provided+ above shall be interpreted in a manner that, to the extent+ possible, most closely approximates an absolute disclaimer and+ waiver of all liability.+++Section 6 -- Term and Termination.++ a. This Public License applies for the term of the Copyright and+ Similar Rights licensed here. However, if You fail to comply with+ this Public License, then Your rights under this Public License+ terminate automatically.++ b. Where Your right to use the Licensed Material has terminated under+ Section 6(a), it reinstates:++ 1. automatically as of the date the violation is cured, provided+ it is cured within 30 days of Your discovery of the+ violation; or++ 2. upon express reinstatement by the Licensor.++ For the avoidance of doubt, this Section 6(b) does not affect any+ right the Licensor may have to seek remedies for Your violations+ of this Public License.++ c. For the avoidance of doubt, the Licensor may also offer the+ Licensed Material under separate terms or conditions or stop+ distributing the Licensed Material at any time; however, doing so+ will not terminate this Public License.++ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public+ License.+++Section 7 -- Other Terms and Conditions.++ a. The Licensor shall not be bound by any additional or different+ terms or conditions communicated by You unless expressly agreed.++ b. Any arrangements, understandings, or agreements regarding the+ Licensed Material not stated herein are separate from and+ independent of the terms and conditions of this Public License.+++Section 8 -- Interpretation.++ a. For the avoidance of doubt, this Public License does not, and+ shall not be interpreted to, reduce, limit, restrict, or impose+ conditions on any use of the Licensed Material that could lawfully+ be made without permission under this Public License.++ b. To the extent possible, if any provision of this Public License is+ deemed unenforceable, it shall be automatically reformed to the+ minimum extent necessary to make it enforceable. If the provision+ cannot be reformed, it shall be severed from this Public License+ without affecting the enforceability of the remaining terms and+ conditions.++ c. No term or condition of this Public License will be waived and no+ failure to comply consented to unless expressly agreed to by the+ Licensor.++ d. Nothing in this Public License constitutes or may be interpreted+ as a limitation upon, or waiver of, any privileges and immunities+ that apply to the Licensor or You, including from the legal+ processes of any jurisdiction or authority.++=======================================================================++Creative Commons is not a party to its public+licenses. Notwithstanding, Creative Commons may elect to apply one of+its public licenses to material it publishes and in those instances+will be considered the “Licensor.” The text of the Creative Commons+public licenses is dedicated to the public domain under the CC0 Public+Domain Dedication. Except for the limited purpose of indicating that+material is shared under a Creative Commons public license or as+otherwise permitted by the Creative Commons policies published at+creativecommons.org/policies, Creative Commons does not authorize the+use of the trademark "Creative Commons" or any other trademark or logo+of Creative Commons without its prior written consent including,+without limitation, in connection with any unauthorized modifications+to any of its public licenses or any other arrangements,+understandings, or agreements concerning use of licensed material. For+the avoidance of doubt, this paragraph does not form part of the+public licenses.++Creative Commons may be contacted at creativecommons.org.+diff --git a/README.ja.md b/README.ja.mdnew file mode 100644index 0000000..44cd748--- /dev/null+++ b/README.ja.md@@ -0,0 +1,517 @@+# 🎬 Huobao Drama - AI ショートドラマ生成プラットフォーム++<div align="center">++**TypeScript フルスタックの AI ショートドラマ自動制作プラットフォーム**++[](https://nodejs.org)+[](https://vuejs.org)+[](https://creativecommons.org/licenses/by-nc-sa/4.0/)++[English](README.md) | [简体中文](README.zh-CN.md) | **日本語** | [한국어](README.ko.md)++[機能](#-機能) • [クイックスタート](#-クイックスタート) • [デプロイ](#-デプロイ)++<h2>🔑 <a href="https://api.firemux.com">Huobao API Key を取得 👉 今すぐ見る</a></h2>++**テキスト・画像・動画のすべての AI 機能を、1 つの Key で有効化**++デプロイ後、「設定 → 火宝クイック設定」に Key を貼るだけで、3 つの推奨設定をワンクリックで書き込み++</div>++---++## 📖 プロジェクト概要++Huobao Drama は AI ベースのショートドラマ自動制作プラットフォームです。脚本生成、キャラクターデザイン、分镜制作から動画合成まで、全工程を自動化します。++### 🎯 コアバリュー++- **🤖 AI 駆動**:大規模言語モデルで脚本を解析し、キャラクター・シーン・分镜情報を抽出+- **🎨 インテリジェント制作**:AI 画像生成でキャラクター形象とシーン背景を作成+- **📹 動画生成**:テキスト→動画・画像→動画モデルで分镜動画を自動生成+- **🔄 ワークフロー**:アイデアから完成作品までのショートドラマ制作をワンストップで完結++### 🛠️ 技術アーキテクチャ++```+frontend/ — Nuxt 3 + Vue 3 + TypeScript (純粋 CSS、UI フレームワークなし)+backend/ — Hono + Drizzle ORM + Mastra AI Agents + better-sqlite3+backend/workspace/skills/ — Agent スキル定義 (SKILL.md、UI からオンライン編集可能)+desktop/ — Electron デスクトップ版(メインプロセス + esbuild バンドル + electron-builder で dmg/exe)+data/ — 生成アセットと SQLite データベース+```++> 🔥 **AI 制作費節約攻略|Kuailema & Seedance 提携限定割引** 👉 [詳しく見る](https://aiad.dfycloud.com/)++---++## ✨ 機能++### 🎭 キャラクター管理++- ✅ AI によるキャラクター形象生成+- ✅ キャラクターの一括生成+- ✅ キャラクター画像のアップロードと管理++### 🎬 動画タスク++- ✅ AI による動画タスクの自動生成+- ✅ シーン説明と動画プロンプトの生成+- ✅ タスク単位の一括動画生成++### 🎥 動画生成++- ✅ テキスト→動画の自動生成+- ✅ FFmpeg によるショット単位の合成と字幕処理+- ✅ エピソード全体の結合と書き出し++### 📦 アセット管理++- ✅ 素材ライブラリの一元管理+- ✅ ローカルストレージ対応+- ✅ タスク進捗トラッキング++### 🤖 AI Agents++4 つの Mastra Agent を内蔵。データベース設定と Skill 拡張に対応:++| Agent | 役割 |+|---|---|+| `script_rewriter` | 小説 → フォーマット済み脚本へのリライト |+| `extractor` | キャラクター / シーン / 小道具のインテリジェント抽出と重複排除 |+| `storyboard_breaker` | 脚本 → 分镜シーケンスへの分解 |+| `prompt_generator` | キャラクター/シーン/小道具の画像プロンプト + 分镜動画プロンプト生成 |++### 🌐 多言語 UI++インターフェースは **中文 / English / 日本語 / 한국어** を内蔵し、AI 生成コンテンツの言語をグローバルに設定できます。++### 🔌 マルチプロバイダー対応++| タイプ | 対応プロバイダー |+|---|---|+| **テキスト** | OpenAI(互換 API)、Gemini |+| **画像** | OpenAI、Gemini、Volcano Engine |+| **動画** | Volcano Engine Seedance 2.0(Standard / Fast / Mini)、MiniMax H3、Alibaba Bailian Wan 3.0(Prime / Standard) |++---++## 🚀 クイックスタート++### 📋 動作環境++| ソフトウェア | バージョン | 説明 |+|---|---|---|+| **Node.js** | 20+ | フロントエンド・バックエンド実行環境 |+| **npm** | 9+ | パッケージマネージャー |++> **データベース不要**:SQLite 内蔵(プロジェクトのデータディレクトリに単一ファイル)。データベースサーバーのインストールは不要です。+> **FFmpeg 不要**:`ffmpeg-static` / `ffprobe-static` npm パッケージにバイナリを内蔵。すぐに使えます。++### ⚙️ 環境変数++設定ファイルは不要。環境変数で設定します(すべてデフォルト値あり、ローカル開発はゼロ設定で起動可能):++| 変数 | デフォルト値 | 説明 |+|---|---|---|+| `SQLITE_PATH` | `<リポジトリ>/data/huobao.sqlite3` | SQLite データベースファイルの場所 |+| `PORT` | `5679` | バックエンドサービスのポート |+| `STORAGE_PATH` | `<リポジトリ>/data/static` | 生成ファイルの保存ディレクトリ |+| `HUOBAO_DATA_DIR` | — | デスクトップ版で Electron メインプロセスが注入(userData データルート) |+| `WORKSPACE_PATH` | `backend/workspace` | Agent スキル/プロンプトディレクトリ(デスクトップ版は userData の書き込み可能なコピー) |+| `FRONTEND_DIST` | `frontend/dist` | フロントエンド静的ビルドディレクトリ |+| `FFMPEG_BIN` / `FFPROBE_BIN` | npm 内蔵バイナリ | カスタム ffmpeg/ffprobe の実行ファイルパス |+| `PUBLIC_BASE_URL` | — | Seedance がローカル参照リソースを使う際に必要な公開 URL(サーバーデプロイ用) |++> **説明**:AI サービスの API Key、Base URL、モデルパラメータはすべて Web UI の「設定」ページで設定してデータベースに保存します。設定ファイルや環境変数では管理しません。++### 📥 インストール++```bash+# リポジトリをクローン+git clone https://github.com/chatfire-AI/huobao-drama.git+cd huobao-drama++# バックエンドの依存をインストール+cd backend && npm install++# フロントエンドの依存をインストール+cd ../frontend && npm install+```++### 🎯 起動++#### 方法 1:開発モード(推奨)++フロントエンドとバックエンドを分離し、ホットリロード対応:++```bash+# ターミナル 1:バックエンド+cd backend+npm run dev++# ターミナル 2:フロントエンド+cd frontend+npm run dev+```++- フロントエンド:`http://localhost:3013`+- バックエンド API:`http://localhost:5679/api/v1`+- フロントエンドは `/api` と `/static` をバックエンドへ自動プロキシ++#### 方法 2:シングルサービスモード++バックエンドが API とフロントエンド静的ファイルの両方を提供:++```bash+# 1. フロントエンドをビルド+cd frontend && npm run generate++# 2. ビルド成果物をバックエンドが読むディレクトリへコピー+# (generate の出力は .output/public、バックエンドは frontend/dist を読む)+cp -r .output/public dist++# 3. バックエンドを起動+cd ../backend && npm start+```++アクセス:`http://localhost:5679`++### 🗄️ データベース++SQLite 内蔵(`better-sqlite3` + WAL モード)。初回起動時にテーブルを自動作成(冪等な DDL リプレイ + シードデータ)。デフォルトのファイルは `data/huobao.sqlite3`、`SQLITE_PATH` で変更可能。デスクトップ版はユーザーデータディレクトリ(`~/Library/Application Support/HuobaoDrama/data/`)に保存します。++旧 MySQL からのデータ移行:++**起動時の自動移行(推奨)**:MySQL が明示的に設定されており(`DATABASE_URL` または `MYSQL_HOST`)、SQLite が空の場合、バックエンド起動時に自動検出して全テーブルを一度だけインポートします(テーブルごとの行数検証、単一トランザクションの原子書き込み、失敗時は自動ロールバックして次回起動時に再試行、成功後は `.mysql-imported` マーカーを書き込み重複を防止)。`MYSQL_AUTO_IMPORT=false` で無効化できます。++```bash+# 手動実行も可能(対象 DB が空でない場合は --force が必要、書き込み前に自動バックアップ)+cd backend && npx tsx scripts/import-mysql-to-sqlite.ts+```++> 移行はデータベースの行のみをカバーします。旧デプロイの `data/static/` 配下の画像・動画などのメディアファイルは手動でコピーしてください。コピーしないと過去の素材にアクセスできません。++### 🔑 初回利用:AI サービスの設定++起動後、すべての AI 機能(テキスト/画像/動画)を使うには、先にモデルサービスの設定が必要です。未設定の場合、ページ上部にバナーで案内されます:++1. 「設定」ページを開く+2. 「火宝クイック設定」に Huobao API Key を貼る([api.firemux.com で取得](https://api.firemux.com))。テキスト・画像・動画の 3 つの推奨設定をワンクリックで書き込み+3. または「手動テンプレート」でプロバイダーごとに追加。接続テストに対応++設定が完了するとバナーは自動で消え、エピソード制作を開始できます。++---++## 📦 デプロイ++### 🖥️ デスクトップアプリ(推奨)++ダブルクリックでインストール、すぐに使えるデスクトップ版(macOS + Windows)。データベース(SQLite)、生成メディア、Agent スキルはすべてユーザーデータディレクトリに保存され、アプリをアンインストールしてもデータに影響しません。++```bash+# ワンコマンドパッケージ(フロントエンド generate → バックエンド esbuild → electron-builder)+npm run dist # macOS dmg(arm64 + Intel)+npm run dist:win # Windows NSIS インストーラー(win-x64、macOS 上でクロスビルド可能)++# 成果物+# desktop/release/HuobaoDrama-<バージョン>-arm64.dmg (Apple Silicon)+# desktop/release/HuobaoDrama-<バージョン>.dmg (Intel)+# desktop/release/HuobaoDrama Setup <バージョン>.exe (Windows)+```++インストール時の注意:++- macOS 未署名パッケージは初回起動時に右クリック → 開く、または `xattr -cr /Applications/HuobaoDrama.app` を実行+- Windows 未署名パッケージは SmartScreen で「詳細情報 → 実行」を選択+- ユーザーデータディレクトリ:`~/Library/Application Support/HuobaoDrama/`(データベース、生成メディア、オンライン編集したスキルのコピー)+- FFmpeg/FFprobe バイナリ内蔵。システムへのインストール不要+- Electron は 37.x に固定:better-sqlite3 の win32 プリビルドがこの ABI までしか対応していないため(クロスパッケージでコンパイル不要にする鍵)+- アプリ内の外部リンク(「api.firemux.com で Key を取得」など)はシステムブラウザで直接開きます++#### 🔄 アプリ内更新(Apple 署名不要)++デスクトップ版には更新機能を内蔵(Tauri と同種の方式:macOS はディレクトリ置換 / Windows はサイレントインストール、ローカルで sha256 検証)。新バージョンのリリース手順:++```bash+# 1. desktop/package.json の version を変更してパッケージ+npm run dist # macOS(dmg + 更新用 zip を出力)+npm run dist:win # Windows(Setup.exe を出力)++# 2. バージョンマニフェスト release/latest.json を生成(各プラットフォームの sha256 を含む)+cd desktop && npm run feed++# 3. 公開:latest.json + インストーラー + zip を GitHub Release にアップロード(タグは v1.0.1 形式)+```++インストール済みのクライアントは起動後にマニフェストを自動チェックし(「設定 → 关于更新」から手動チェックも可能)、新バージョンを検出するとダウンロードとインストールを促します。マニフェストの URL は `HUOBAO_UPDATE_FEED` 環境変数で変更可能です。++デスクトップ版の開発デバッグ:++```bash+npm run build:frontend # フロントエンド静的成果物(frontend/.output/public)+cd desktop && npm run dev # バックエンドをバンドルして Electron ウィンドウで実行+```++> 既知の制限:Seedance 動画モデルがローカル参照リソースを使うには `PUBLIC_BASE_URL` の公開アドレスが必要です。デスクトップ版には公開エントリがないため、このシナリオでは明確なエラーメッセージが表示されます。テキスト→動画・画像生成など他の機能には影響しません。++---++### 🏭 サーバーデプロイ++```bash+# 1. フロントエンドをビルド+cd frontend && npm run generate++# 2. ビルド成果物をコピー(generate の出力は frontend/.output/public、バックエンドは+# frontend/dist を読む。この手順を省くと API は動くがページが 404 になる)+cp -r .output/public dist && cd ..++# 3. バックエンドを起動+cd backend && npm start+```++サーバーにアップロードするファイル:++```+backend/ # バックエンドソース + node_modules+backend/workspace/skills/ # Agent スキルファイル+frontend/dist/ # フロントエンドビルド成果物+data/ # データディレクトリ(初回実行時に自動作成)+```++#### Nginx リバースプロキシ++```nginx+server {+ listen 80;+ server_name your-domain.com;++ # 参照動画/音声アップロードは最大 50MB+ client_max_body_size 100m;++ # 生成画像/動画はディスクから直接配信(Node を経由しない):+ # sendfile ゼロコピー + 長期キャッシュ+ # (ファイルは uuid 命名で内容不変のため immutable キャッシュが安全)+ location /static/ {+ alias /path/to/huobao-drama/data/static/;+ sendfile on;+ tcp_nopush on;+ expires 1y;+ add_header Cache-Control "public, immutable";+ }++ location / {+ proxy_pass http://localhost:5679;+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ }+}+```++> メディア読み込みの最適化:画像生成時にバックエンドが 400px サムネイル(`*_thumb.webp`)を自動生成してリストページで使用し、動画はポスターフレーム(`*_poster.jpg`)をカバーとして抽出します。フロントエンドは画像を開く/再生する時だけ元ファイルを読み込みます。過去の既存ファイルは `backend/` で `npm run backfill-artwork` を実行して一括補完できます。++### 🐳 Docker デプロイ(アプリ内更新付き)++リポジトリルートにオールインワンの `Dockerfile`(フロントエンド generate + バックエンド依存/ランタイムの 3 ステージ。バックエンドはサーバーデプロイと同様に tsx で実行)と `docker-compose.yml`(アプリ + Watchtower)を用意:++```bash+# 1. 環境を設定(Watchtower トークン。app と watchtower の両側で一致必須)+cp .env.example .env # WATCHTOWER_TOKEN を変更++# 2. ビルドして起動(リリース時にバージョンを注入し、「关于更新」での比較に使用)+HUOBAO_VERSION=1.0.0 docker compose up -d --build++# 3. http://localhost:5679 にアクセス+```++- **データ永続化**:名前付きボリューム `huobao-data` を `/app/data` にマウント(SQLite + 生成画像/動画 + workspace/skills)。イメージ更新でもデータを失いません+- **アプリ内更新**:compose に [Watchtower](https://containrrr.dev/watchtower/) sidecar を同梱(`--label-enable` でラベル付きコンテナのみ更新、`--cleanup` で旧イメージ削除、毎日セルフチェック)。「設定 → 关于更新」で新バージョンの確認と「今すぐ更新」が可能。バックエンドが Watchtower HTTP API 経由でトリガーし、新イメージを pull してコンテナを再構築。数分後にページを更新すれば完了です+- **手動モード**:`docker-compose.yml` から app の `HUOBAO_WATCHTOWER_*` の 2 つの環境変数(または watchtower サービス全体)を削除すると、「关于更新」は新バージョン通知 + 手動コマンド `docker compose pull && docker compose up -d` に退化します+- **イメージの公開**:`docker build --build-arg HUOBAO_VERSION=x.y.z -t ghcr.io/chatfire-ai/huobao-drama:x.y.z -t ghcr.io/chatfire-ai/huobao-drama:latest . && docker push …`。バージョンマニフェストはデスクトップ版と GitHub Releases の `latest.json` を共用(`HUOBAO_UPDATE_FEED` で上書き可能)++---++## 🎨 技術スタック++### バックエンド++- **ランタイム**:Node.js 20++- **Web フレームワーク**:Hono+- **ORM**:Drizzle ORM + better-sqlite3(WAL モード)+- **AI Agent**:Mastra + AI SDK(OpenAI 互換)+- **動画処理**:FFmpeg(fluent-ffmpeg + 内蔵バイナリ)+- **画像処理**:Sharp++### デスクトップ++- **シェル**:Electron(utilityProcess がバックエンドをホスト、BrowserWindow は同一オリジンで読み込み)+- **パッケージ**:esbuild(バックエンド単一ファイルバンドル)+ electron-builder(dmg arm64/x64、NSIS win-x64)++### フロントエンド++- **フレームワーク**:Nuxt 3(SPA モード)+- **言語**:Vue 3 + TypeScript+- **ルーティング**:ファイルルーティング(Vue Router 4)+- **スタイル**:純粋 CSS + CSS Variables+- **アイコン**:Lucide Vue+- **i18n**:vue-i18n(中文 / English / 日本語 / 한국어)++---++## 📝 よくある質問++### Q: デスクトップ版のデータはどこに保存されますか?++A: `~/Library/Application Support/HuobaoDrama/data/`(SQLite データベース + 生成画像/動画)。オンライン編集したスキルのコピーは同階層の `workspace/` ディレクトリにあります。開発モードではリポジトリの `data/` ディレクトリを使用します。++### Q: 旧 MySQL データを SQLite に移行するには?++A: MySQL に接続できる状態(環境変数または `backend/.env`)を保ち、`cd backend && npx tsx scripts/import-mysql-to-sqlite.ts` を実行。スクリプトが自動でテーブルを作成し、テーブルごとにインポートして行数を検証します(対象 DB が空でない場合は `--force` が必要。書き込み前に自動バックアップ)。++### Q: FFmpeg が未インストール/見つからない?++A: インストール不要です。プロジェクトに `ffmpeg-static` / `ffprobe-static` バイナリを内蔵(デスクトップ版も同梱)。システム `PATH` の FFmpeg と競合することもありません。`FFMPEG_BIN`/`FFPROBE_BIN` で明示的に指定することも可能です。++### Q: ページ上部に「モデル未設定」と表示される?++A: 初回デプロイ時の正常な案内です。「設定」ページで「火宝クイック設定」に API Key を貼ってワンクリックで書き込むか、「手動テンプレート」でプロバイダーを追加してください。テキスト・画像・動画の 3 類すべてに有効な設定があるとバナーは自動で消えます。++### Q: フロントエンドがバックエンド API に接続できない?++A: バックエンドが起動しているか、ポートが正しいかを確認してください。開発モードのプロキシ設定は `frontend/nuxt.config.ts` にあります。++### Q: データベーステーブルが作成されない?++A: バックエンドは初回起動時に全テーブルを自動作成します。ログで初期化が成功したか確認してください。++---++## 📋 更新履歴++### v4.0.0 (2026-08)++#### 🖥️ デスクトップアプリ + データベース移行++- Electron デスクトップ版(macOS dmg、arm64/x64 デュアルアーキテクチャ)+ - ダブルクリックでインストール、すぐ使える:自動ポート選択、シングルインスタンスロック、クラッシュ分離されたバックエンドサブプロセス+ - ユーザーデータ分離:SQLite DB / 生成メディア / スキルコピーはすべて userData ディレクトリに保存+ - FFmpeg/FFprobe を同梱。workspace スキルテンプレートは初回起動時にコピー、アップグレード時は不足分のみ補完して上書きしない+- データベースを MySQL から SQLite へ完全移行(better-sqlite3 + WAL)+ - ビジネスコードの変更ゼロ(Drizzle クエリ層は本質的に移植可能)、冪等な DDL リプレイ+ - 一度きりのインポートスクリプト `import-mysql-to-sqlite.ts` を追加(テーブルごとの行数検証 + 自動バックアップ)+- バックエンドを esbuild で単一ファイルにバンドル(externals:sharp/better-sqlite3/ffmpeg バイナリパッケージ)+- Docker/MySQL デプロイを削除(git 履歴から復元可能)++### v3.0.0 (2026-08)++#### 🚀 デプロイと体験の最適化++- Docker デプロイ対応の整備+ - MySQL / アプリのヘルスチェック。データベース準備完了を待ってからアプリ起動+ - データベース初期化にリトライを追加。コンテナオーケストレーションでの初回デプロイが無人で完了+ - システム FFmpeg 依存を削除し、内蔵バイナリに全面移行+ - Agent skills ディレクトリの volume 永続化(設定ページでのオンライン編集が失われない)+ - `docker/init.sql` とエクスポートスクリプトを追加(DBA レビュー / 事前テーブル作成)+- 初回利用ガイド+ - AI サービス未設定時にサイト上部にバナーを表示し設定ページへ誘導+ - 設定ページに「火宝クイック設定」を追加:1 つの Key でテキスト/画像/動画の 3 つの推奨設定を書き込み+ - モデル未設定エラーの中国語化と設定ページへの誘導+- 動画モデルのデフォルトを Seedance 2.0 Fast に変更+- プロバイダー集約:OpenAI / Gemini / Volcano Engine のみ残存+- ワークベンチ:タスクリストドロワー、パイプライン大セクション状態、選択的結合(結合前に動画ファイルの存在を検証)+- 素材ライブラリ刷新、@メンション最適化、エピソードリスト再構築++### v2.0.0 (2026-04)++#### 🚀 大型アップデート++- プロジェクトを TypeScript 技術スタックへ全面移行+ - バックエンド:Hono + Drizzle ORM + mysql2+ - フロントエンド:Nuxt 3 + Vue 3+ - AI Agent:Mastra フレームワーク+- エピソードワークベンチ UI と制作フローを刷新+ - よりコンパクトなコンソールレイアウト+ - 分镜編集エリアを刷新+ - ショット画像、動画、合成、書き出し画面を刷新+- Docker デプロイ対応を追加。フロントエンドとバックエンドを単一イメージに統合+- ランタイム Skill ロード機構を追加+- マルチプロバイダーメディアアダプターを拡張+ - 画像:OpenAI、Gemini、Volcano Engine、Alibaba+ - 動画:Volcano Engine/Seedance、Vidu、Alibaba+- ローカルファイル処理と参照画像のオンデマンドトランスコードを最適化++### v1.0.4 (2026-01-27)++- ローカルストレージ戦略を導入し、外部リソースリンク切れを回避+- Base64 参照画像の埋め込み転送+- ショット切り替え時の状態リセット問題を修正+- シーンのチャプターへの移行を追加++### v1.0.3 (2026-01-16)++- データベース同時アクセス性能を最適化+- Docker クロスプラットフォームで host.docker.internal に対応++### v1.0.2 (2026-01-14)++- 動画生成 API レスポンスの解析問題を修正+- OpenAI Sora 動画エンドポイント設定を追加+- エラーハンドリングとログ出力を最適化++---++## 📄 ライセンス++本プロジェクトは **[CC BY-NC-SA 4.0](LICENSE)**(表示-非営利-継承 4.0 国際)ライセンスを採用しています。++- ✅ 個人利用、学習・研究、非営利プロジェクトでの使用は自由です+- ✅ 改変と再配布は可能ですが、クレジット表示と同一ライセンスでの共有が必要です+- ❌ **商用利用は禁止**——作者の書面による許可なく、本プロジェクトの全部または一部をいかなる商業目的(有料サービス、商用デプロイ、転売など)にも使用することはできません++ライセンス全文は [LICENSE](LICENSE) を参照してください。++---++## 🤝 コントリビューション++Issue と Pull Request を歓迎します!++1. 本プロジェクトを Fork+2. フィーチャーブランチを作成(`git checkout -b feature/AmazingFeature`)+3. 変更をコミット(`git commit -m 'Add some AmazingFeature'`)+4. ブランチをプッシュ(`git push origin feature/AmazingFeature`)+5. Pull Request を作成++よく使うチェックコマンド:++```bash+cd backend && npm run typecheck+cd ../frontend && npm run build+```++---++## ☕ 寄付のお願い++このプロジェクトが役に立ったら、QR コードで作者にコーヒーを一杯おごってください ☕。あなたの支援が継続的な更新の原動力です!++<div align="center">+ <img src="donate.png" alt="Alipay 寄付 QR コード" width="240" />+</div>++---++> _"AI にもっと創造的なことを手伝ってもらおう"_++## 🔗 関連リンク++本プロジェクトは [LINUX DO](https://linux.do/) コミュニティからリンクの承認を得ています。++- [LINUX DO](https://linux.do/) — 真のオープンソース精神、共に作り共有する技術コミュニティ++---diff --git a/README.ko.md b/README.ko.mdnew file mode 100644index 0000000..e7ace35--- /dev/null+++ b/README.ko.md@@ -0,0 +1,517 @@+# 🎬 Huobao Drama - AI 숏드라마 생성 플랫폼++<div align="center">++**TypeScript 풀스택 기반 AI 숏드라마 자동 제작 플랫폼**++[](https://nodejs.org)+[](https://vuejs.org)+[](https://creativecommons.org/licenses/by-nc-sa/4.0/)++[English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | **한국어**++[기능](#-기능) • [빠른 시작](#-빠른-시작) • [배포](#-배포)++<h2>🔑 <a href="https://api.firemux.com">Huobao API Key 받기 👉 바로 보기</a></h2>++**텍스트 · 이미지 · 영상 모든 AI 기능, Key 하나로 활성화**++배포 후 「설정 → 火宝快捷 설정」에 Key 를 붙여넣으면 추천 설정 3개가 한 번에 입력됩니다++</div>++---++## 📖 프로젝트 소개++Huobao Drama는 AI 기반 숏드라마 자동 제작 플랫폼으로, 각본 생성, 캐릭터 디자인, 스토리보드 제작부터 영상 합성까지 전 과정을 자동화합니다.++### 🎯 핵심 가치++- **🤖 AI 기반**:대규모 언어 모델로 각본을 분석하여 캐릭터, 장면, 스토리보드 정보를 추출+- **🎨 지능형 창작**:AI 이미지 생성으로 캐릭터 이미지와 장면 배경 제작+- **📹 영상 생성**:텍스트→영상 및 이미지→영상 모델로 스토리보드 영상 자동 생성+- **🔄 워크플로**:아이디어부터 완성 영상까지 숏드라마 제작 전 과정을 한 곳에서 완료++### 🛠️ 기술 아키텍처++```+frontend/ — Nuxt 3 + Vue 3 + TypeScript (순수 CSS, UI 프레임워크 없음)+backend/ — Hono + Drizzle ORM + Mastra AI Agents + better-sqlite3+backend/workspace/skills/ — Agent 스킬 정의 (SKILL.md, UI에서 온라인 편집 가능)+desktop/ — Electron 데스크톱 버전 (메인 프로세스 + esbuild 번들 + electron-builder로 dmg/exe 생성)+data/ — 생성된 에셋과 SQLite 데이터베이스+```++> 🔥 **AI 제작 비용 절약 공략|Kuailema & Seedance 제휴 전용 할인** 👉 [자세히 보기](https://aiad.dfycloud.com/)++---++## ✨ 기능++### 🎭 캐릭터 관리++- ✅ AI 캐릭터 이미지 생성+- ✅ 캐릭터 일괄 생성+- ✅ 캐릭터 이미지 업로드 및 관리++### 🎬 영상 작업++- ✅ AI 영상 작업 자동 생성+- ✅ 장면 설명 및 영상 프롬프트 생성+- ✅ 작업별 영상 일괄 생성++### 🎥 영상 생성++- ✅ 텍스트→영상 자동 생성+- ✅ FFmpeg 샷 단위 합성 및 자막 처리+- ✅ 에피소드 전체 병합 및 납출++### 📦 에셋 관리++- ✅ 소재 라이브러리 통합 관리+- ✅ 로컬 스토리지 지원+- ✅ 작업 진행 상황 추적++### 🤖 AI Agents++4개의 Mastra Agent 내장, 데이터베이스 설정과 Skill 확장 지원:++| Agent | 역할 |+|---|---|+| `script_rewriter` | 소설 → 형식화된 각본 리라이팅 |+| `extractor` | 캐릭터 / 장면 / 소품 지능형 추출 및 중복 제거 |+| `storyboard_breaker` | 각본 → 스토리보드 시퀀스 분해 |+| `prompt_generator` | 캐릭터/장면/소품 이미지 프롬프트 + 스토리보드 영상 프롬프트 생성 |++### 🌐 다국어 UI++인터페이스는 **中文 / English / 日本語 / 한국어** 4개 언어를 내장하고, AI 생성 콘텐츠의 언어를 전역으로 설정할 수 있습니다.++### 🔌 멀티 프로바이더 지원++| 유형 | 지원 프로바이더 |+|---|---|+| **텍스트** | OpenAI(호환 API), Gemini |+| **이미지** | OpenAI, Gemini, Volcano Engine |+| **영상** | Volcano Engine Seedance 2.0(Standard / Fast / Mini), MiniMax H3, Alibaba Bailian Wan 3.0(Prime / Standard) |++---++## 🚀 빠른 시작++### 📋 환경 요구 사항++| 소프트웨어 | 버전 | 설명 |+|---|---|---|+| **Node.js** | 20+ | 프런트엔드/백엔드 실행 환경 |+| **npm** | 9+ | 패키지 관리 도구 |++> **데이터베이스 설치 불필요**:SQLite 내장(프로젝트 데이터 디렉터리의 단일 파일)으로 데이터베이스 서버 설치가 필요 없습니다.+> **FFmpeg 설치 불필요**:`ffmpeg-static` / `ffprobe-static` npm 패키지에 바이너리가 내장되어 바로 사용할 수 있습니다.++### ⚙️ 환경 변수++설정 파일 없이 환경 변수로 설정합니다(모두 기본값이 있어 로컬 개발은 무설정으로 시작 가능):++| 변수 | 기본값 | 설명 |+|---|---|---|+| `SQLITE_PATH` | `<저장소>/data/huobao.sqlite3` | SQLite 데이터베이스 파일 위치 |+| `PORT` | `5679` | 백엔드 서비스 포트 |+| `STORAGE_PATH` | `<저장소>/data/static` | 생성 파일 저장 디렉터리 |+| `HUOBAO_DATA_DIR` | — | 데스크톱 버전에서 Electron 메인 프로세스가 주입(userData 데이터 루트) |+| `WORKSPACE_PATH` | `backend/workspace` | Agent 스킬/프롬프트 디렉터리(데스크톱 버전은 userData의 쓰기 가능한 복사본) |+| `FRONTEND_DIST` | `frontend/dist` | 프런트엔드 정적 빌드 디렉터리 |+| `FFMPEG_BIN` / `FFPROBE_BIN` | npm 내장 바이너리 | 사용자 지정 ffmpeg/ffprobe 실행 파일 경로 |+| `PUBLIC_BASE_URL` | — | Seedance가 로컬 참조 리소스를 사용할 때 필요한 공개 주소(서버 배포용) |++> **설명**:AI 서비스의 API Key, Base URL, 모델 파라미터는 모두 웹 UI의 「설정」 페이지에서 설정하여 데이터베이스에 저장합니다. 설정 파일이나 환경 변수로 관리하지 않습니다.++### 📥 설치++```bash+# 저장소 클론+git clone https://github.com/chatfire-AI/huobao-drama.git+cd huobao-drama++# 백엔드 의존성 설치+cd backend && npm install++# 프런트엔드 의존성 설치+cd ../frontend && npm install+```++### 🎯 실행++#### 방법 1: 개발 모드(권장)++프런트엔드와 백엔드를 분리하여 핫 리로드 지원:++```bash+# 터미널 1: 백엔드+cd backend+npm run dev++# 터미널 2: 프런트엔드+cd frontend+npm run dev+```++- 프런트엔드 주소: `http://localhost:3013`+- 백엔드 API: `http://localhost:5679/api/v1`+- 프런트엔드가 `/api`와 `/static`을 백엔드로 자동 프록시++#### 방법 2: 단일 서비스 모드++백엔드가 API와 프런트엔드 정적 파일을 모두 제공:++```bash+# 1. 프런트엔드 빌드+cd frontend && npm run generate++# 2. 빌드 산출물을 백엔드가 읽는 디렉터리로 복사+# (generate 산출물은 .output/public, 백엔드는 frontend/dist를 읽음)+cp -r .output/public dist++# 3. 백엔드 시작+cd ../backend && npm start+```++접속: `http://localhost:5679`++### 🗄️ 데이터베이스++SQLite 내장(`better-sqlite3` + WAL 모드). 최초 시작 시 테이블 자동 생성(멱등 DDL 재생 + 시드 데이터). 기본 파일은 `data/huobao.sqlite3`이며 `SQLITE_PATH`로 변경 가능. 데스크톱 버전의 데이터는 사용자 데이터 디렉터리(`~/Library/Application Support/HuobaoDrama/data/`)에 저장됩니다.++구버전 MySQL에서 데이터 마이그레이션:++**시작 시 자동 마이그레이션(권장)**: MySQL이 명시적으로 설정되어 있고(`DATABASE_URL` 또는 `MYSQL_HOST`) SQLite가 비어 있으면, 백엔드 시작 시 자동으로 감지하여 모든 테이블을 한 번만 가져옵니다(테이블별 행 수 검증, 단일 트랜잭션 원자적 쓰기, 실패 시 자동 롤백 후 다음 시작 때 재시도, 성공 시 `.mysql-imported` 마커를 기록하여 중복 방지). `MYSQL_AUTO_IMPORT=false`로 비활성화할 수 있습니다.++```bash+# 수동 실행도 가능(대상 DB가 비어 있지 않으면 --force 필요, 쓰기 전 자동 백업)+cd backend && npx tsx scripts/import-mysql-to-sqlite.ts+```++> 마이그레이션은 데이터베이스 행만 포함합니다. 구 배포의 `data/static/` 아래 이미지/영상 등 미디어 파일은 수동으로 복사해야 하며, 그렇지 않으면 기존 소재에 접근할 수 없습니다.++### 🔑 첫 사용: AI 서비스 설정++시작 후 모든 AI 기능(텍스트/이미지/영상)을 사용하려면 먼저 모델 서비스를 설정해야 합니다. 미설정 시 페이지 상단에 배너로 안내합니다:++1. 「설정」 페이지 열기+2. 「火宝快捷 설정」에 Huobao API Key 붙여넣기([api.firemux.com에서 발급](https://api.firemux.com)). 텍스트, 이미지, 영상 추천 설정 3개가 한 번에 입력됩니다+3. 또는 「수동 템플릿」으로 프로바이더별 추가. 연결 테스트 지원++설정이 완료되면 배너가 자동으로 사라지고 에피소드 제작을 시작할 수 있습니다.++---++## 📦 배포++### 🖥️ 데스크톱 앱(권장)++더블클릭 설치로 바로 사용할 수 있는 데스크톱 버전(macOS + Windows). 데이터베이스(SQLite), 생성된 미디어 파일, Agent 스킬은 모두 사용자 데이터 디렉터리에 저장되며 앱을 삭제필필도 데이터에 영향이 없습니다.++```bash+# 원커맨드 패키징(프런트엔드 generate → 백엔드 esbuild → electron-builder)+npm run dist # macOS dmg(arm64 + Intel)+npm run dist:win # Windows NSIS 설치 프로그램(win-x64, macOS에서 크로스 빌드 가능)++# 산출물+# desktop/release/HuobaoDrama-<버전>-arm64.dmg (Apple Silicon)+# desktop/release/HuobaoDrama-<버전>.dmg (Intel)+# desktop/release/HuobaoDrama Setup <버전>.exe (Windows)+```++설치 안내:++- macOS 미서명 패키지는 첫 실행 시 우클릭 → 열기, 또는 `xattr -cr /Applications/HuobaoDrama.app` 실행+- Windows 미서명 패키지는 SmartScreen에서 「추가 정보 → 실행」 선택+- 사용자 데이터 디렉터리: `~/Library/Application Support/HuobaoDrama/`(데이터베이스, 생성된 미디어, 온라인 편집한 스킬 복사본)+- FFmpeg/FFprobe 바이너리 내장, 시스템 설치 불필요+- Electron은 37.x로 고정: better-sqlite3의 win32 프리빌드가 해당 ABI까지만 지원(크로스 패키징 시 컴파일 불필요의 핵심)+- 앱 내 외부 링크(「api.firemux.com에서 Key 받기」 등)는 시스템 브라우저로 바로 열립니다++#### 🔄 앱 내 업데이트(Apple 서명 불필요)++데스크톱 버전에는 업데이터가 내장되어 있습니다(Tauri와 동류 방식: macOS 디렉터리 교체 / Windows 사일런트 설치, 로컬 sha256 검증). 새 버전 릴리스 절차:++```bash+# 1. desktop/package.json의 version을 수정한 후 패키징+npm run dist # macOS(dmg + 업데이트용 zip 산출)+npm run dist:win # Windows(Setup.exe 산출)++# 2. 버전 매니페스트 release/latest.json 생성(플랫폼별 sha256 포함)+cd desktop && npm run feed++# 3. 릴리스: latest.json + 설치 패키지 + zip을 GitHub Release에 업로드(태그는 v1.0.1 형식)+```++설치된 클라이언트는 시작 후 매니페스트를 자동으로 확인하고(「설정 → 정보 및 업데이트」에서 수동 확인도 가능), 새 버전을 발견하면 다운로드 및 설치를 안내합니다. 매니페스트 주소는 `HUOBAO_UPDATE_FEED` 환경 변수로 변경할 수 있습니다.++데스크톱 버전 개발 디버깅:++```bash+npm run build:frontend # 프런트엔드 정적 산출물(frontend/.output/public)+cd desktop && npm run dev # 백엔드 번들 후 Electron 창으로 실행+```++> 알려진 제한: Seedance 영상 모델이 로컬 참조 리소스를 사용하려면 `PUBLIC_BASE_URL` 공개 주소가 필요합니다. 데스크톱 버전에는 공개 진입점이 없어 해당 시나리오에서는 명확한 오류 메시지가 표시됩니다. 텍스트→영상/이미지 생성 등 나머지 기능에는 영향이 없습니다.++---++### 🏭 서버 배포++```bash+# 1. 프런트엔드 빌드+cd frontend && npm run generate++# 2. 빌드 산출물 복사(generate 산출물은 frontend/.output/public, 백엔드는+# frontend/dist를 읽음. 이 단계를 생략하면 API는 정상이지만 페이지가 404)+cp -r .output/public dist && cd ..++# 3. 백엔드 시작+cd backend && npm start+```++서버에 업로드할 파일:++```+backend/ # 백엔드 소스 + node_modules+backend/workspace/skills/ # Agent 스킬 파일+frontend/dist/ # 프런트엔드 빌드 산출물+data/ # 데이터 디렉터리(최초 실행 시 자동 생성)+```++#### Nginx 리버스 프록시++```nginx+server {+ listen 80;+ server_name your-domain.com;++ # 참조 영상/오디오 업로드 최대 50MB+ client_max_body_size 100m;++ # 생성된 이미지/영상은 디스크에서 직접 서빙(Node를 거치지 않음):+ # sendfile 제로 카피 + 장기 캐시+ # (파일은 uuid 명명, 내용 불변이므로 immutable 캐시 안전)+ location /static/ {+ alias /path/to/huobao-drama/data/static/;+ sendfile on;+ tcp_nopush on;+ expires 1y;+ add_header Cache-Control "public, immutable";+ }++ location / {+ proxy_pass http://localhost:5679;+ proxy_set_header Host $host;+ proxy_set_header X-Real-IP $remote_addr;+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;+ }+}+```++> 미디어 로딩 최적화: 이미지 생성 시 백엔드가 목록 페이지용 400px 썸네일(`*_thumb.webp`)을 자동 생성하고, 영상은 포스터 프레임(`*_poster.jpg`)을 커버로 추출합니다. 프런트엔드는 큰 이미지를 열거나 재생할 때만 원본 파일을 로드합니다. 기존 파일은 `backend/`에서 `npm run backfill-artwork`를 실행해 일괄 보완할 수 있습니다.++### 🐳 Docker 배포(앱 내 업데이트 포함)++저장소 루트에 올인원 `Dockerfile`(프런트엔드 generate + 백엔드 의존성/런타임 3단계, 백엔드는 서버 배포와 동일하게 tsx로 실행)과 `docker-compose.yml`(앱 + Watchtower)을 제공합니다:++```bash+# 1. 환경 설정(Watchtower 토큰, app과 watchtower 양쪽이 일치해야 함)+cp .env.example .env # WATCHTOWER_TOKEN 수정++# 2. 빌드 및 시작(릴리스 시 버전을 주입하여 「정보 및 업데이트」 비교에 사용)+HUOBAO_VERSION=1.0.0 docker compose up -d --build++# 3. http://localhost:5679 접속+```++- **데이터 영속화**: 네임드 볼륨 `huobao-data`를 `/app/data`에 마운트(SQLite + 생성된 이미지/영상 + workspace/skills). 이미지 업데이트 시에도 데이터 유지+- **앱 내 업데이트**: compose에 [Watchtower](https://containrrr.dev/watchtower/) 사이드카 포함(`--label-enable`로 라벨이 지정된 컨테이너만 업데이트, `--cleanup`으로 구 이미지 정리, 매일 자체 점검). 「설정 → 정보 및 업데이트」에서 새 버전 확인 및 「지금 업데이트」 가능 — 백엔드가 Watchtower HTTP API를 통해 트리거하여 새 이미지를 가져와 컨테이너를 재생성합니다. 몇 분 후 페이지를 새로고침하면 완료+- **수동 모드**: `docker-compose.yml`에서 app의 `HUOBAO_WATCHTOWER_*` 환경 변수 2개(또는 watchtower 서비스 전체)를 삭제하면 「정보 및 업데이트」는 새 버전 알림 + 수동 명령 `docker compose pull && docker compose up -d`으로 전환됩니다+- **이미지 릴리스**: `docker build --build-arg HUOBAO_VERSION=x.y.z -t ghcr.io/chatfire-ai/huobao-drama:x.y.z -t ghcr.io/chatfire-ai/huobao-drama:latest . && docker push …`. 버전 매니페스트는 데스크톱 버전과 GitHub Releases의 `latest.json`을 공유(`HUOBAO_UPDATE_FEED`로 재정의 가능)++---++## 🎨 기술 스택++### 백엔드++- **런타임**: Node.js 20++- **웹 프레임워크**: Hono+- **ORM**: Drizzle ORM + better-sqlite3(WAL 모드)+- **AI Agent**: Mastra + AI SDK(OpenAI 호환)+- **영상 처리**: FFmpeg(fluent-ffmpeg + 내장 바이너리)+- **이미지 처리**: Sharp++### 데스크톱++- **셸**: Electron(utilityProcess가 백엔드를 호스팅, BrowserWindow는 동일 출처로 로드)+- **패키징**: esbuild(백엔드 단일 파일 번들) + electron-builder(dmg arm64/x64, NSIS win-x64)++### 프런트엔드++- **프레임워크**: Nuxt 3(SPA 모드)+- **언어**: Vue 3 + TypeScript+- **라우팅**: 파일 라우팅(Vue Router 4)+- **스타일**: 순수 CSS + CSS Variables+- **아이콘**: Lucide Vue+- **i18n**: vue-i18n(中文 / English / 日本語 / 한국어)++---++## 📝 자주 묻는 질문++### Q: 데스크톱 버전의 데이터는 어디에 저장되나요?++A: `~/Library/Application Support/HuobaoDrama/data/`(SQLite 데이터베이스 + 생성된 이미지/영상)에 저장되며, 온라인 편집한 스킬의 복사본은 같은 수준의 `workspace/` 디렉터리에 있습니다. 개발 모드에서는 저장소의 `data/` 디렉터리를 사용합니다.++### Q: 구버전 MySQL 데이터를 SQLite로 마이그레이션하려면?++A: MySQL에 연결 가능한 상태(환경 변수 또는 `backend/.env`)를 유지하고 `cd backend && npx tsx scripts/import-mysql-to-sqlite.ts`를 실행하세요. 스크립트가 자동으로 테이블을 생성하고 테이블별로 가져오며 행 수를 검증합니다(대상 DB가 비어 있지 않으면 `--force` 필요, 쓰기 전 자동 백업).++### Q: FFmpeg가 설치되지 않았거나 찾을 수 없다고 나옵니다?++A: 설치할 필요가 없습니다. 프로젝트에 `ffmpeg-static` / `ffprobe-static` 바이너리가 내장되어 있습니다(데스크톱 버전에도 포함). 시스템 `PATH`의 FFmpeg와 충돌하지 않으며, `FFMPEG_BIN`/`FFPROBE_BIN`으로 명시적으로 지정할 수도 있습니다.++### Q: 페이지 상단에 「모델 미설정」이 표시됩니다?++A: 정상적인 첫 배포 안내입니다. 「설정」 페이지에서 「火宝快捷 설정」에 API Key를 붙여넣어 한 번에 입력하거나, 「수동 템플릿」으로 프로바이더를 추가하세요. 텍스트, 이미지, 영상 3가지 모두에 활성화된 설정이 있으면 배너가 자동으로 사라집니다.++### Q: 프런트엔드가 백엔드 API에 연결되지 않습니다?++A: 백엔드가 시작되었는지, 포트가 올바른지 확인하세요. 개발 모드의 프록시 설정은 `frontend/nuxt.config.ts`에 있습니다.++### Q: 데이터베이스 테이블이 생성되지 않았습니다?++A: 백엔드는 최초 시작 시 모든 테이블을 자동으로 생성합니다. 로그에서 초기화 성공 여부를 확인하세요.++---++## 📋 업데이트 로그++### v4.0.0 (2026-08)++#### 🖥️ 데스크톱 앱 + 데이터베이스 마이그레이션++- Electron 데스크톱 버전(macOS dmg, arm64/x64 듀얼 아키텍처)+ - 더블클릭 설치, 즉시 사용: 자동 포트 선택, 단일 인스턴스 잠금, 충돌 분리된 백엔드 서브프로세스+ - 사용자 데이터 분리: SQLite DB / 생성된 미디어 / 스킬 복사본 모두 userData 디렉터리에 저장+ - FFmpeg/FFprobe 포함 배포. workspace 스킬 템플릿은 첫 시작 시 복사, 업그레이드 시 누락분만 보충하고 덮어쓰지 않음+- 데이터베이스를 MySQL에서 SQLite로 완전 마이그레이션(better-sqlite3 + WAL)+ - 비즈니스 코드 변경 제로(Drizzle 쿼리 계층은 본질적으로 이식 가능), 멱등 DDL 재생+ - 1회용 가져오기 스크립트 `import-mysql-to-sqlite.ts` 추가(테이블별 행 수 검증 + 자동 백업)+- 백엔드 esbuild 단일 파일 번들(externals: sharp/better-sqlite3/ffmpeg 바이너리 패키지)+- Docker/MySQL 배포 방식 제거(git 히스토리에서 복구 가능)++### v3.0.0 (2026-08)++#### 🚀 배포 및 경험 최적화++- Docker 배포 준비 개선+ - MySQL / 앱 헬스 체크, 데이터베이스 준비 후 앱 시작+ - 데이터베이스 초기화에 재시도 추가, 컨테이너 오케스트레이션에서 첫 배포 무인 완료+ - 시스템 FFmpeg 의존 제거, 내장 바이너리로 전면 전환+ - Agent skills 디렉터리 볼륨 영속화(설정 페이지 온라인 편집 유실 방지)+ - `docker/init.sql` 및 납출 스크립트 추가(DBA 검토 / 사전 테이블 생성)+- 첫 사용 가이드+ - AI 서비스 미설정 시 사이트 상단 배너로 설정 페이지 안내+ - 설정 페이지에 「火宝快捷 설정」 추가: Key 하나로 텍스트/이미지/영상 추천 설정 3개 입력+ - 모델 미설정 오류의 중국어화 및 설정 페이지 안내+- 영상 모델 기본값을 Seedance 2.0 Fast로 조정+- 프로바이더 통합: OpenAI / Gemini / Volcano Engine만 유지+- 워크벤치: 작업 목록 드로어, 파이프라인 대섹션 상태, 선택적 병합(병합 전 영상 파일 존재 검증)+- 소재 라이브러리 개편, @멘션 최적화, 에피소드 목록 재구성++### v2.0.0 (2026-04)++#### 🚀 대규모 업데이트++- 프로젝트를 TypeScript 기술 스택으로 전면 마이그레이션+ - 백엔드: Hono + Drizzle ORM + mysql2+ - 프런트엔드: Nuxt 3 + Vue 3+ - AI Agent: Mastra 프레임워크+- 에피소드 워크벤치 UI와 제작 플로우 재구축+ - 더 컴팩트한 콘솔 레이아웃+ - 스토리보드 편집 영역 재구축+ - 샷 이미지, 영상, 합성, 납출 화면 재구축+- Docker 배포 지원 추가, 프런트엔드와 백엔드를 단일 이미지로 통합+- 런타임 Skill 로딩 메커니즘 추가+- 멀티 프로바이더 미디어 어댑터 확장+ - 이미지: OpenAI, Gemini, Volcano Engine, Alibaba+ - 영상: Volcano Engine/Seedance, Vidu, Alibaba+- 로컬 파일 처리 및 참조 이미지 온디맨드 트랜스코딩 최적화++### v1.0.4 (2026-01-27)++- 로컬 스토리지 전략 도입으로 외부 리소스 링크 실효 회피+- Base64 참조 이미지 임베디드 전송+- 샷 전환 상태 리셋 문제 수정+- 장면의 챕터 마이그레이션 추가++### v1.0.3 (2026-01-16)++- 데이터베이스 동시 접근 성능 최적화+- Docker 크로스 플랫폼 host.docker.internal 지원++### v1.0.2 (2026-01-14)++- 영상 생성 API 응답 파싱 문제 수정+- OpenAI Sora 영상 엔드포인트 설정 추가+- 오류 처리 및 로그 출력 최적화++---++## 📄 라이선스++이 프로젝트는 **[CC BY-NC-SA 4.0](LICENSE)**(저작자표시-비영리-동일조걳경변경허락 4.0 국제) 라이선스를 채택하고 있습니다.++- ✅ 개인 사용, 학습·연구, 비영리 프로젝트는 자유롭게 사용 가능+- ✅ 수정 및 재배포 가능, 단 저작자 표시와 동일 라이선스로 공유 필요+- ❌ **상업적 사용 금지** — 저작자의 서면 허가 없이 이 프로젝트의 전부 또는 일부를 어떠한 상업적 목적(유료 서비스, 상업 배포, 재판매 등)으로도 사용할 수 없습니다++라이선스 전문은 [LICENSE](LICENSE)를 참조하세요.++---++## 🤝 기여 가이드++Issue와 Pull Request를 환영합니다!++1. 이 프로젝트를 Fork+2. 기능 브랜치 생성(`git checkout -b feature/AmazingFeature`)+3. 변경 사항 커밋(`git commit -m 'Add some AmazingFeature'`)+4. 브랜치 푸시(`git push origin feature/AmazingFeature`)+5. Pull Request 생성++자주 쓰는 검사 명령:++```bash+cd backend && npm run typecheck+cd ../frontend && npm run build+```++---++## ☕ 후원하기++이 프로젝트가 도움이 되었다면, QR 코드로 저작자에게 커피 한 잔을 사주세요 ☕. 여러분의 응원이 지속적인 업데이트의 원동력입니다!++<div align="center">+ <img src="donate.png" alt="Alipay 후원 QR 코드" width="240" />+</div>++---++> _"AI가 더 창의적인 일을 돕게 하자"_++## 🔗 관련 링크++이 프로젝트는 [LINUX DO](https://linux.do/) 커뮤니티의 링크 승인을 받았습니다.++- [LINUX DO](https://linux.do/) — 진정한 오픈소스 정신, 함께 만들고 공유하는 기술 커뮤니티++---diff --git a/README.md b/README.mdindex 9ef052a..96a1610 100644--- a/README.md+++ b/README.md@@ -8,7 +8,7 @@[](https://vuejs.org)[](https://creativecommons.org/licenses/by-nc-sa/4.0/)-**English** | [简体中文](README.zh-CN.md)+**English** | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [한국어](README.ko.md)[Features](#-features) • [Quick Start](#-quick-start) • [Deployment](#-deployment)@@ -465,6 +465,18 @@ A: The backend creates all tables automatically on first launch — check the lo---+## 📄 License++This project is licensed under **[CC BY-NC-SA 4.0](LICENSE)** (Attribution-NonCommercial-ShareAlike 4.0 International).++- ✅ Personal use, learning, and non-commercial projects are welcome+- ✅ Modifications and redistribution allowed under the same license with attribution+- ❌ **Commercial use is prohibited** — you may not use this project, in whole or in part, for any commercial purpose (including paid services, commercial deployments, or resale) without prior written permission from the author++Full license text: see [LICENSE](LICENSE).++---+## 🤝 ContributingIssues and Pull Requests are welcome!diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 5a92d07..2cef106 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -8,7 +8,7 @@[](https://vuejs.org)[](https://creativecommons.org/licenses/by-nc-sa/4.0/)-[English](README.md) | **简体中文**+[English](README.md) | **简体中文** | [日本語](README.ja.md) | [한국어](README.ko.md)[功能特性](#-功能特性) • [快速开始](#-快速开始) • [部署指南](#-部署指南)@@ -462,6 +462,18 @@ A: 后端会在首次启动时自动创建所有表,检查日志确认初始---+## 📄 许可证++本项目采用 **[CC BY-NC-SA 4.0](LICENSE)**(署名-非商业性使用-相同方式共享 4.0 国际)许可证。++- ✅ 个人使用、学习研究、非商业项目均可自由使用+- ✅ 允许修改与再分发,但须署名并以相同许可证共享+- ❌ **禁止商用**——未经作者书面许可,不得将本项目整体或部分用于任何商业目的(包括付费服务、商业部署、转售等)++许可证全文见 [LICENSE](LICENSE)。++---+## 🤝 贡献指南欢迎提交 Issue 和 Pull Request!diff --git a/backend/package.json b/backend/package.jsonindex 31e865f..28755a2 100644--- a/backend/package.json+++ b/backend/package.json@@ -12,7 +12,7 @@},"keywords": [],"author": "",- "license": "ISC",+ "license": "CC BY-NC-SA-4.0","type": "module","dependencies": {"@ai-sdk/google": "^3.0.53",