ロボット制御、データ収集、機械学習、チャットボットを統合したWebアプリケーション
- リアルタイムジョイスティック制御
- カメラフィード表示
- ロボットステータス監視
- ナビゲーション機能
- Unity/実機の切り替え対応
- ロボットデータのリアルタイム記録
- 選択的データ保存(チェックボックス)
- 画像の効率的な保存(ファイルシステム)
- 記録制御(開始/一時停止/保存/破棄/終了)
- PyTorchによる学習パイプライン
- リアルタイム学習曲線表示
- データセット管理
- モデル評価機能
- RAG(Retrieval-Augmented Generation)
- LLM統合
- Webアプリに関するQA機能
- Framework: Vue.js 3 (Composition API + TypeScript)
- Build Tool: Vite
- State Management: Pinia
- UI Library: TailwindCSS (optional)
- Charts: Chart.js / ECharts
- Framework: FastAPI (Python 3.10+)
- ORM: SQLAlchemy
- Migration: Alembic
- Async: asyncio, asyncpg
- ML: PyTorch
- LLM: OpenAI API / LangChain
- Database: PostgreSQL 15
- Message Broker: Eclipse Mosquitto (MQTT)
- Containerization: Docker & Docker Compose
- Communication: WebSocket, MQTT, REST API
robot-ml-web-app/
├── frontend/ # Vue.js frontend
├── backend/ # FastAPI backend
├── database/ # Database migrations & init scripts
├── mqtt-broker/ # MQTT broker configuration
├── unity-simulator/ # Unity simulator (optional)
├── data/ # Data storage
├── logs/ # Application logs
├── docs/ # Documentation
├── tests/ # Tests
└── scripts/ # Utility scripts
詳細なディレクトリ構成は SYSTEM_DESIGN.md を参照してください。
- Docker & Docker Compose
- Node.js 18+ (for local frontend development)
- Python 3.10+ (for local backend development)
-
Clone the repository
git clone https://github.com/akinami3/robot-ml-web-app.git cd robot-ml-web-app -
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Start all services with Docker Compose
docker-compose up -d
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Run migrations
alembic upgrade head
# Start development server
uvicorn app.main:app --reloadcd frontend
npm install
npm run dev- ヘッダーの「シミュレーション起動」ボタンをクリック
- Unity シミュレータが起動します
- MQTT接続状態がヘッダーアイコンで確認できます
- データベースタブに移動
- 記録するデータ種別を選択(チェックボックス)
- 「開始」ボタンで記録開始
- 「一時停止」で中断、「保存」で確定
- 機械学習タブに移動
- データセットを選択
- モデル設定を調整
- 「トレーニング開始」
- リアルタイムで学習曲線が表示されます
- Chatbotタブに移動
- 質問を入力
- RAGベースのAIが回答します
FastAPI の自動生成ドキュメントが利用可能です:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
詳細な API 仕様は SYSTEM_DESIGN.md を参照してください。
cd backend
pytest
pytest --cov=app tests/ # with coveragecd frontend
npm run test:unit
npm run test:e2eシステムアーキテクチャの詳細は SYSTEM_DESIGN.md を参照してください。
主要な通信フロー:
Frontend ←→ WebSocket ←→ Backend ←→ MQTT ←→ Robot/Unity
↓
PostgreSQL
- CORS設定
- 環境変数による機密情報管理
- SQLインジェクション対策(ORM使用)
- XSS対策(Vue.jsの自動エスケープ)
本番環境では以下を実装してください:
- JWT認証
- HTTPS/WSS
- MQTT over TLS
- API Rate Limiting
MIT License
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Project Link: https://github.com/akinami3/robot-ml-web-app
- FastAPI
- Vue.js
- PyTorch
- Eclipse Mosquitto