-
Notifications
You must be signed in to change notification settings - Fork 0
29 Update package #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
570a6a7
29 Add doc
zucky2021 1be9686
29 Create analysis options yaml
zucky2021 818e75f
29 Create flutter env
zucky2021 7e667f4
29 Create dependencies
zucky2021 12da987
29 Create pubspec
zucky2021 10a3213
29 Built Flutter
zucky2021 e99edb4
29 Update package
zucky2021 3f08733
29 Split tests
zucky2021 122c1a1
29 Modify test timezone
zucky2021 7eb3f88
29 Add fallback to session_id
zucky2021 6542de6
29 Add fallback to session_id
zucky2021 0befbb3
29 Abolition withOpacity
zucky2021 d5678e2
29 Add API timeout
zucky2021 9b1abfc
29 Add ignore to todo
zucky2021 2056f04
29 Del header of get request
zucky2021 04a3d86
29 Modify ignore of flutter related
zucky2021 04db3be
29 Add err handle of env load
zucky2021 43fc843
29 Resolve dispose conflict
zucky2021 9151c20
29 Add err notification
zucky2021 7586a97
29 Fix env var load
zucky2021 4ba2c02
29 Update package
zucky2021 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| .env | ||
|
|
||
| node_modules/ | ||
|
|
||
| todo.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| # モノレポ設計 | ||
|
|
||
| ## 概要 | ||
|
|
||
| 本プロジェクトでは、複数の技術スタック(Python、TypeScript、Dart)を**モノレポ(Monorepo)** 構成で管理しています。 | ||
|
|
||
| ## リポジトリ構成 | ||
|
|
||
| ```text | ||
| ai-chatbot-api/ | ||
| ├── backend/ # Python (FastAPI) | ||
| ├── frontend/ # TypeScript (React + Vite) | ||
| ├── flutter/ # Dart (Flutter) | ||
| ├── lambda/ # Python (AWS CDK + Lambda) | ||
| ├── localstack/ # Shell (ローカルAWS環境) | ||
| └── docs/ # ドキュメント | ||
| ``` | ||
|
|
||
| ## 選定理由 | ||
|
|
||
| ### モノレポを選択した理由 | ||
|
|
||
| | 観点 | 判断 | 理由 | | ||
| | ------------------------ | ------------- | ------------------------------------------ | | ||
| | **プロジェクトの関連性** | ✅ 高い | 同一のチャットボットアプリケーションを構成 | | ||
| | **開発チーム** | ✅ 同一 | 個人開発(学習目的) | | ||
| | **リリースサイクル** | ✅ 統一的 | 同時にデプロイ可能 | | ||
| | **セキュリティ要件** | ✅ 同一 | 特別な分離要件なし | | ||
| | **リポジトリサイズ** | ✅ 小〜中規模 | 巨大なバイナリなし | | ||
| | **目的** | ✅ 学習・実験 | シンプルな構成が望ましい | | ||
|
|
||
| ### 比較検討した選択肢 | ||
|
|
||
| #### 1. モノレポ(直接追加)✅ 採用 | ||
|
|
||
| ```text | ||
| ai-chatbot-api/ | ||
| ├── backend/ | ||
| ├── frontend/ | ||
| ├── flutter/ # 直接追加 | ||
| └── ... | ||
| ``` | ||
|
|
||
| | メリット | デメリット | | ||
| | ---------------------------- | ----------------------------- | | ||
| | 単一リポジトリで管理が簡単 | リポジトリサイズが増加 | | ||
| | 共通設定・ドキュメントを統一 | 言語ごとのツールが混在 | | ||
| | 関連する変更を1コミットで | CI/CDの設定が複雑になる可能性 | | ||
| | 学習コストが最小 | - | | ||
|
|
||
| #### 2. Git Submodule ❌ 不採用 | ||
|
|
||
| ```text | ||
| ai-chatbot-api/ | ||
| ├── flutter/ # ← 別リポジトリへの参照 | ||
| └── .gitmodules | ||
| ``` | ||
|
|
||
| | メリット | デメリット | | ||
| | ------------------------ | ------------------------------------ | | ||
| | リポジトリの独立性が高い | 操作が複雑(学習コスト高) | | ||
| | 特定バージョンを固定可能 | `--recursive`を忘れると不完全なclone | | ||
| | 権限を分けられる | detached HEAD問題が発生しやすい | | ||
|
|
||
| **不採用理由**: 個人開発では複雑さに見合うメリットがない | ||
|
|
||
| #### 3. Git Subtree ❌ 不採用 | ||
|
|
||
| ```text | ||
| ai-chatbot-api/ | ||
| ├── flutter/ # ← コードがコピーされている | ||
| └── (履歴が統合) | ||
| ``` | ||
|
|
||
| | メリット | デメリット | | ||
| | ------------------------ | -------------------- | | ||
| | 通常のcloneでOK | 双方向同期が面倒 | | ||
| | サブモジュールより直感的 | 履歴が混在する可能性 | | ||
|
|
||
| **不採用理由**: 別リポジトリを維持する必要がなく、オーバーヘッド | ||
|
|
||
| #### 4. 完全に独立したリポジトリ ❌ 不採用 | ||
|
|
||
| ```text | ||
| github.com/user/ai-chatbot-api | ||
| github.com/user/ai-chatbot-flutter | ||
| ``` | ||
|
|
||
| | メリット | デメリット | | ||
| | -------------- | ------------------ | | ||
| | 最もシンプル | 関連する変更が分散 | | ||
| | 自由に実験可能 | 共通設定の重複 | | ||
|
|
||
| **不採用理由**: 同一アプリケーションのため統一管理が望ましい | ||
|
|
||
| ## モノレポの運用方針 | ||
|
|
||
| ### ディレクトリごとの独立性 | ||
|
|
||
| 各ディレクトリは独立した依存関係管理を持ちます: | ||
|
|
||
| | ディレクトリ | 言語 | 依存管理 | | ||
| | ------------ | ---------- | --------------------- | | ||
| | `backend/` | Python | `pyproject.toml` (uv) | | ||
| | `frontend/` | TypeScript | `package.json` (pnpm) | | ||
| | `flutter/` | Dart | `pubspec.yaml` (pub) | | ||
| | `lambda/` | Python | `pyproject.toml` (uv) | | ||
|
|
||
| ### CI/CD の分離 | ||
|
|
||
| GitHub Actions でパスフィルターを使用し、変更があった部分のみビルド: | ||
|
|
||
| ```yaml | ||
| # .github/workflows/backend.yml | ||
| on: | ||
| push: | ||
| paths: | ||
| - 'backend/**' | ||
|
|
||
| # .github/workflows/flutter.yml | ||
| on: | ||
| push: | ||
| paths: | ||
| - 'flutter/**' | ||
| ``` | ||
|
|
||
| ### 開発環境 | ||
|
|
||
| 開発者は必要なプロジェクトのみセットアップ可能: | ||
|
|
||
| ```bash | ||
| # バックエンドのみ開発 | ||
| cd backend && uv sync | ||
|
|
||
| # Flutterのみ開発 | ||
| cd flutter && flutter pub get | ||
|
|
||
| # 全体を起動(Docker Compose) | ||
| make up | ||
| ``` | ||
|
|
||
| ## モノレポが適さなくなるケース | ||
|
|
||
| 以下の状況が発生した場合、リポジトリ分割を検討: | ||
|
|
||
| 1. **チームの分離**: 異なるチームが独立してリリースする必要がある | ||
| 2. **セキュリティ要件**: 機密コードの分離が必要 | ||
| 3. **リポジトリサイズ**: cloneに数分以上かかるようになった | ||
| 4. **ライセンス**: 異なるライセンスのコードが混在 | ||
|
|
||
| ## 参考資料 | ||
|
|
||
| - [Monorepo vs Polyrepo](https://monorepo.tools/) | ||
| - [Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) | ||
| - [Git Subtree](https://www.atlassian.com/git/tutorials/git-subtree) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Miscellaneous | ||
| *.class | ||
| *.log | ||
| *.pyc | ||
| *.swp | ||
| .DS_Store | ||
| .atom/ | ||
| .buildlog/ | ||
| .history | ||
| .svn/ | ||
| migrate_working_dir/ | ||
|
|
||
| # IntelliJ related | ||
| *.iml | ||
| *.ipr | ||
| *.iws | ||
| .idea/ | ||
|
|
||
| # Flutter/Dart/Pub related | ||
| **/doc/api/ | ||
| **/ios/Flutter/.last_build_id | ||
| .dart_tool/ | ||
| .packages | ||
| .package-config.json | ||
| .flutter-plugins | ||
| .flutter-plugins-dependencies | ||
| .flutter_build/ | ||
| flutter_export_environment.sh | ||
| *.dill | ||
| .pub-cache/ | ||
| .pub/ | ||
| /build/ | ||
|
|
||
| # Symbolication related | ||
| app.*.symbols | ||
|
|
||
| # Obfuscation related | ||
| app.*.map.json | ||
|
|
||
| # Android Studio will place build artifacts here | ||
| /android/.gradle/ | ||
| /android/app/build/ | ||
| /android/app/debug | ||
| /android/app/profile | ||
| /android/app/release | ||
|
|
||
| # iOS/macOS | ||
| **/GeneratedPluginRegistrant.* | ||
| **/ios/Flutter/Flutter.framework | ||
| **/ios/Flutter/Flutter.podspec | ||
| **/ios/Pods/ | ||
| **/ios/.symlinks/ | ||
| **/macos/Pods/ | ||
| **/macos/.symlinks/ | ||
|
|
||
| # Environment variables | ||
| .env | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.