85 lines
2.3 KiB
Markdown
85 lines
2.3 KiB
Markdown
# BatchTube — Tauri Desktop App
|
|
|
|
## Architecture
|
|
|
|
```
|
|
batchtube-tauri/
|
|
├── src-tauri/ # Rust/Tauri shell
|
|
│ ├── src/main.rs # Spawns Python backend, manages window
|
|
│ ├── Cargo.toml
|
|
│ ├── tauri.conf.json
|
|
│ └── icons/ # App icons
|
|
├── backend/ # Existing Python FastAPI app (unchanged)
|
|
│ ├── api_server.py
|
|
│ ├── worker.py
|
|
│ ├── database.py
|
|
│ ├── extractors.py
|
|
│ ├── config.py
|
|
│ ├── web/ # Frontend HTML/CSS/JS
|
|
│ └── batchtube-server.spec # PyInstaller spec
|
|
├── .github/workflows/ # Cross-platform CI/CD
|
|
│ └── build.yml
|
|
├── package.json
|
|
├── rollback.sh # Revert to NSIS installer if needed
|
|
└── README.md
|
|
```
|
|
|
|
## How It Works
|
|
|
|
1. Tauri starts → spawns `batchtube-server` sidecar (PyInstaller bundle)
|
|
2. Rust polls `http://localhost:8765/api/health` every 500ms
|
|
3. When server ready → shows webview window loading `http://localhost:8765`
|
|
4. User sees the existing BatchTube web UI inside a native window
|
|
5. On close → Tauri kills the sidecar process
|
|
|
|
## Build
|
|
|
|
### Prerequisites
|
|
- Rust (stable)
|
|
- Node.js 22+
|
|
- Python 3.11+
|
|
- PyInstaller: `pip install pyinstaller`
|
|
|
|
### Development
|
|
```bash
|
|
# Start Python backend first
|
|
cd backend && python api_server.py &
|
|
# Then start Tauri dev mode
|
|
npm run dev
|
|
```
|
|
|
|
### Production Build
|
|
```bash
|
|
# Bundle Python backend
|
|
cd backend && pyinstaller batchtube-server.spec
|
|
# Build Tauri app
|
|
npm run build
|
|
```
|
|
|
|
### Cross-Platform (CI/CD)
|
|
Push a tag `v1.x.x` to trigger GitHub Actions build for:
|
|
- Windows (.exe + .msi)
|
|
- macOS (.dmg — Intel + Apple Silicon)
|
|
- Linux (.AppImage + .deb)
|
|
|
|
## Rollback Plan
|
|
|
|
If Tauri build fails at any point:
|
|
```bash
|
|
bash rollback.sh
|
|
```
|
|
This reverts to the `v1.0-pre-tauri` git tag.
|
|
The original NSIS Windows installer remains at `BatchTube App/BatchTube-Windows-Build.zip`.
|
|
|
|
## Pricing Integration
|
|
|
|
License validation happens at app startup via `http://localhost:8765/api/license`.
|
|
ThriveCart webhook at `https://n8n.intentures.org/webhook/thrivecart` handles purchase events.
|
|
|
|
| Tier | Price | Limit |
|
|
|------|-------|-------|
|
|
| Free | $0 | 5 videos/batch |
|
|
| Creator | $9/mo | 100/day, 1080p |
|
|
| Pro | $19/mo | Unlimited, 4K |
|
|
| Lifetime | $97 | Unlimited, 4K |
|