mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-18 06:17:21 +00:00
Resolve merge conflicts in Tauri config
This commit is contained in:
commit
53fa49295a
7 changed files with 5472 additions and 13 deletions
78
QUICK_START_TAURI.md
Normal file
78
QUICK_START_TAURI.md
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# 🚀 Quick Start - Tauri Desktop App
|
||||
|
||||
## Test Your Setup
|
||||
|
||||
Run the desktop app in development mode:
|
||||
|
||||
```bash
|
||||
npm run tauri:dev
|
||||
```
|
||||
|
||||
This will:
|
||||
1. ✅ Build the Rust backend
|
||||
2. ✅ Start Vite dev server on port 5000
|
||||
3. ✅ Open AeThex-OS in a native window with hot-reload
|
||||
|
||||
## Common Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `npm run tauri:dev` | Run desktop app (development) |
|
||||
| `npm run tauri:build` | Build desktop app for production |
|
||||
| `npm run dev:client` | Run web version (frontend only) |
|
||||
| `npm run dev` | Run backend server |
|
||||
|
||||
## What Changed?
|
||||
|
||||
### New Files
|
||||
- `src-tauri/` - Tauri Rust application
|
||||
- `src/main.rs` - Entry point
|
||||
- `src/lib.rs` - Application logic
|
||||
- `tauri.conf.json` - Configuration
|
||||
- `Cargo.toml` - Rust dependencies
|
||||
- `icons/` - Application icons
|
||||
|
||||
### Modified Files
|
||||
- `package.json` - Added Tauri scripts
|
||||
- Configuration points to your Vite build
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **Test the app**: `npm run tauri:dev`
|
||||
2. **Build for your platform**: `npm run tauri:build`
|
||||
3. **Customize icons**: Replace files in `src-tauri/icons/`
|
||||
4. **Add native features**: See [TAURI_SETUP.md](./TAURI_SETUP.md)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Rust not found"
|
||||
```bash
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
source $HOME/.cargo/env
|
||||
```
|
||||
|
||||
### "Dependencies missing" (Linux)
|
||||
```bash
|
||||
sudo apt install libwebkit2gtk-4.1-dev build-essential
|
||||
```
|
||||
|
||||
### First build is slow
|
||||
The first `tauri:dev` or `tauri:build` compiles all Rust dependencies. Subsequent builds are much faster.
|
||||
|
||||
## Platform-Specific Builds
|
||||
|
||||
Build for your current platform:
|
||||
```bash
|
||||
npm run tauri:build
|
||||
```
|
||||
|
||||
Outputs:
|
||||
- **Linux**: `src-tauri/target/release/bundle/deb/` and `.appimage`
|
||||
- **macOS**: `src-tauri/target/release/bundle/dmg/` and `.app`
|
||||
- **Windows**: `src-tauri/target/release/bundle/msi/` and `.exe`
|
||||
|
||||
---
|
||||
|
||||
**Your AeThex-OS is now a desktop app! 🎉**
|
||||
|
||||
See [TAURI_SETUP.md](./TAURI_SETUP.md) for detailed documentation.
|
||||
231
TAURI_SETUP.md
Normal file
231
TAURI_SETUP.md
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
# Tauri Desktop App Setup
|
||||
|
||||
AeThex-OS has been configured to run as a native desktop application using Tauri (Rust + WebView).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### 1. Install Rust
|
||||
```bash
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
source $HOME/.cargo/env
|
||||
```
|
||||
|
||||
### 2. Install System Dependencies
|
||||
|
||||
**Linux (Ubuntu/Debian):**
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y libwebkit2gtk-4.1-dev \
|
||||
build-essential \
|
||||
curl \
|
||||
wget \
|
||||
file \
|
||||
libxdo-dev \
|
||||
libssl-dev \
|
||||
libayatana-appindicator3-dev \
|
||||
librsvg2-dev
|
||||
```
|
||||
|
||||
**macOS:**
|
||||
```bash
|
||||
# Xcode Command Line Tools should be installed
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
- Install [Microsoft Visual Studio C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
|
||||
- Install [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
AeThex-OS/
|
||||
├── client/ # React frontend
|
||||
├── server/ # Node.js backend
|
||||
├── src-tauri/ # Tauri Rust backend
|
||||
│ ├── src/ # Rust source code
|
||||
│ ├── icons/ # App icons
|
||||
│ ├── Cargo.toml # Rust dependencies
|
||||
│ └── tauri.conf.json # Tauri configuration
|
||||
└── dist/public/ # Built frontend (used by Tauri)
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Run Desktop App in Development Mode
|
||||
```bash
|
||||
npm run tauri:dev
|
||||
```
|
||||
|
||||
This will:
|
||||
1. Start the Vite dev server (client)
|
||||
2. Launch the Tauri window with hot-reload
|
||||
|
||||
### Run Web Version (Original)
|
||||
```bash
|
||||
# Terminal 1: Start backend
|
||||
npm run dev
|
||||
|
||||
# Terminal 2: Start frontend
|
||||
npm run dev:client
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
### Build Desktop App
|
||||
```bash
|
||||
npm run tauri:build
|
||||
```
|
||||
|
||||
The built app will be in `src-tauri/target/release/bundle/`:
|
||||
- **Linux**: `.deb`, `.appimage`
|
||||
- **macOS**: `.dmg`, `.app`
|
||||
- **Windows**: `.msi`, `.exe`
|
||||
|
||||
### Build Web Version
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Tauri Configuration (`src-tauri/tauri.conf.json`)
|
||||
|
||||
Key settings:
|
||||
- **Window size**: 1280x800 (configurable)
|
||||
- **Dev URL**: http://localhost:5000 (Vite dev server)
|
||||
- **Build output**: `dist/public` (Vite build output)
|
||||
- **App identifier**: `com.aethex.os`
|
||||
|
||||
### Available Scripts
|
||||
|
||||
- `npm run tauri:dev` - Run desktop app in dev mode
|
||||
- `npm run tauri:build` - Build desktop app
|
||||
- `npm run tauri` - Access Tauri CLI directly
|
||||
|
||||
## Features Enabled
|
||||
|
||||
✅ Hot Module Replacement (HMR) in dev mode
|
||||
✅ System tray support
|
||||
✅ Native window controls
|
||||
✅ Multi-platform builds
|
||||
✅ Auto-updater ready
|
||||
|
||||
## Architecture
|
||||
|
||||
### Hybrid Architecture
|
||||
AeThex-OS uses a **hybrid architecture**:
|
||||
|
||||
1. **Frontend (Client)**: React + Vite - runs in the webview
|
||||
2. **Backend (Server)**: Node.js + Express - can run locally or remotely
|
||||
3. **Desktop (Tauri)**: Rust - provides native APIs and window management
|
||||
|
||||
### Communication Flow
|
||||
|
||||
```
|
||||
User Interface (React)
|
||||
↕
|
||||
Tauri WebView APIs
|
||||
↕
|
||||
Rust Backend (Tauri)
|
||||
↕
|
||||
System APIs (File, Window, etc.)
|
||||
```
|
||||
|
||||
For server communication, the app still uses HTTP/WebSocket to your Node.js backend.
|
||||
|
||||
## Adding Tauri Features
|
||||
|
||||
### Example: Add File System Access
|
||||
|
||||
1. **Enable plugin in Cargo.toml**:
|
||||
```toml
|
||||
[dependencies]
|
||||
tauri-plugin-fs = "2"
|
||||
```
|
||||
|
||||
2. **Register in src-tauri/src/main.rs**:
|
||||
```rust
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
```
|
||||
|
||||
3. **Use in frontend**:
|
||||
```typescript
|
||||
import { readTextFile } from '@tauri-apps/plugin-fs';
|
||||
|
||||
const contents = await readTextFile('file.txt');
|
||||
```
|
||||
|
||||
## Tauri Plugins Available
|
||||
|
||||
- `tauri-plugin-fs` - File system access
|
||||
- `tauri-plugin-shell` - Run shell commands
|
||||
- `tauri-plugin-dialog` - Native dialogs
|
||||
- `tauri-plugin-notification` - System notifications
|
||||
- `tauri-plugin-http` - HTTP client
|
||||
- `tauri-plugin-sql` - Local database
|
||||
- `tauri-plugin-store` - Key-value storage
|
||||
|
||||
## Security
|
||||
|
||||
Tauri apps are more secure than Electron because:
|
||||
- Uses system webview (smaller bundle)
|
||||
- Rust backend (memory safe)
|
||||
- No Node.js in renderer (reduced attack surface)
|
||||
- CSP policies enforced
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Linux: Missing dependencies
|
||||
```bash
|
||||
sudo apt install libwebkit2gtk-4.1-dev
|
||||
```
|
||||
|
||||
### macOS: Code signing issues
|
||||
```bash
|
||||
# For development
|
||||
codesign --force --deep --sign - src-tauri/target/release/bundle/macos/AeThex-OS.app
|
||||
```
|
||||
|
||||
### Windows: WebView2 not found
|
||||
Download and install from: https://developer.microsoft.com/en-us/microsoft-edge/webview2/
|
||||
|
||||
### Port conflicts
|
||||
Change dev port in `src-tauri/tauri.conf.json`:
|
||||
```json
|
||||
"devUrl": "http://localhost:5000"
|
||||
```
|
||||
|
||||
## Distribution
|
||||
|
||||
### Linux
|
||||
- `.deb` - Debian/Ubuntu packages
|
||||
- `.AppImage` - Universal Linux binary
|
||||
|
||||
### macOS
|
||||
- `.app` - Application bundle
|
||||
- `.dmg` - Disk image installer
|
||||
|
||||
### Windows
|
||||
- `.msi` - Windows installer
|
||||
- `.exe` - Portable executable
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. ✅ Tauri configured
|
||||
2. 🔄 Test development mode: `npm run tauri:dev`
|
||||
3. 🔄 Customize app icons in `src-tauri/icons/`
|
||||
4. 🔄 Build for distribution: `npm run tauri:build`
|
||||
5. 🔄 Add Tauri-specific features (system tray, notifications, etc.)
|
||||
|
||||
## Resources
|
||||
|
||||
- [Tauri Documentation](https://tauri.app/)
|
||||
- [Tauri Plugins](https://tauri.app/plugin/)
|
||||
- [Tauri API Reference](https://tauri.app/reference/)
|
||||
- [Tauri Examples](https://github.com/tauri-apps/tauri/tree/dev/examples)
|
||||
189
WEB_VS_DESKTOP.md
Normal file
189
WEB_VS_DESKTOP.md
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
# AeThex-OS: Web vs Desktop Comparison
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
### Web Version (Original)
|
||||
```
|
||||
Browser
|
||||
↓
|
||||
React App (client)
|
||||
↓ HTTP/WebSocket
|
||||
Node.js Server (server)
|
||||
↓
|
||||
Supabase + Database
|
||||
```
|
||||
|
||||
### Desktop Version (Tauri)
|
||||
```
|
||||
Native Window (Tauri)
|
||||
↓
|
||||
WebView (System)
|
||||
↓
|
||||
React App (client)
|
||||
↓ Tauri APIs
|
||||
Rust Backend (Tauri)
|
||||
↓
|
||||
System APIs
|
||||
|
||||
AND/OR
|
||||
|
||||
↓ HTTP/WebSocket
|
||||
Node.js Server (server)
|
||||
↓
|
||||
Supabase + Database
|
||||
```
|
||||
|
||||
## Feature Comparison
|
||||
|
||||
| Feature | Web | Desktop (Tauri) |
|
||||
|---------|-----|-----------------|
|
||||
| **Deployment** | Web server required | Standalone app |
|
||||
| **Installation** | Just open URL | Install on OS |
|
||||
| **Updates** | Instant | App updates |
|
||||
| **File System** | Limited (File API) | Full access |
|
||||
| **Notifications** | Browser permission | Native notifications |
|
||||
| **Performance** | Network dependent | Native + local |
|
||||
| **Offline** | Limited (PWA) | Full offline mode |
|
||||
| **Bundle Size** | N/A (streaming) | ~10-20 MB |
|
||||
| **Cross-platform** | Any browser | Build per OS |
|
||||
| **Security** | Browser sandbox | OS-level security |
|
||||
|
||||
## When to Use Which?
|
||||
|
||||
### Use Web Version When:
|
||||
- ✅ Need instant access without installation
|
||||
- ✅ Want to reach maximum users
|
||||
- ✅ Easy distribution and updates
|
||||
- ✅ Cross-platform without building
|
||||
- ✅ Server-side processing is primary
|
||||
|
||||
### Use Desktop Version When:
|
||||
- ✅ Need offline functionality
|
||||
- ✅ Require file system access
|
||||
- ✅ Want native OS integration
|
||||
- ✅ Better performance for heavy tasks
|
||||
- ✅ Professional/enterprise distribution
|
||||
- ✅ Users prefer installable apps
|
||||
|
||||
## Hybrid Approach (Recommended)
|
||||
|
||||
You can support BOTH:
|
||||
|
||||
1. **Web version** for quick access and demos
|
||||
2. **Desktop version** for power users and offline work
|
||||
|
||||
Both use the same React codebase!
|
||||
|
||||
## Technical Differences
|
||||
|
||||
### Bundle
|
||||
- **Web**: Code split, lazy loaded
|
||||
- **Desktop**: Single binary with embedded web assets
|
||||
|
||||
### Backend
|
||||
- **Web**: Always remote server
|
||||
- **Desktop**: Can be embedded OR remote
|
||||
|
||||
### APIs Available
|
||||
|
||||
#### Web Only
|
||||
- Service Workers
|
||||
- Push notifications (via server)
|
||||
- IndexedDB (browser storage)
|
||||
|
||||
#### Desktop Only
|
||||
- Native file dialogs
|
||||
- System tray
|
||||
- Global shortcuts
|
||||
- Local database (SQLite)
|
||||
- Direct hardware access
|
||||
- Menu bar integration
|
||||
|
||||
#### Both
|
||||
- React components
|
||||
- WebSocket communication
|
||||
- REST APIs
|
||||
- Local Storage
|
||||
|
||||
## Performance Comparison
|
||||
|
||||
### Startup Time
|
||||
- **Web**: Fast (loads incrementally)
|
||||
- **Desktop**: Slower first time (2-5s), then instant
|
||||
|
||||
### Memory Usage
|
||||
- **Web**: ~100-300 MB (shared with browser)
|
||||
- **Desktop**: ~80-150 MB (dedicated)
|
||||
|
||||
### Build Time
|
||||
- **Web**: 10-30 seconds
|
||||
- **Desktop**: 2-5 minutes (first time), then ~30 seconds
|
||||
|
||||
## Distribution
|
||||
|
||||
### Web
|
||||
```bash
|
||||
npm run build
|
||||
# Deploy dist/public to any static host
|
||||
```
|
||||
|
||||
### Desktop
|
||||
```bash
|
||||
npm run tauri:build
|
||||
# Get installers in src-tauri/target/release/bundle/
|
||||
```
|
||||
|
||||
## Maintenance
|
||||
|
||||
### Updating Web Version
|
||||
1. Push changes to server
|
||||
2. Users get updates on refresh
|
||||
3. No user action needed
|
||||
|
||||
### Updating Desktop Version
|
||||
1. Build new version
|
||||
2. Distribute installer
|
||||
3. Users install update
|
||||
4. (Can add auto-updater)
|
||||
|
||||
## Cost Comparison
|
||||
|
||||
### Web Hosting
|
||||
- Server costs: $5-50/month
|
||||
- CDN: $0-100/month
|
||||
- Database: $0-200/month
|
||||
|
||||
### Desktop Distribution
|
||||
- Build process: Free (CI/CD)
|
||||
- Distribution: Free (GitHub Releases, etc.)
|
||||
- No hosting costs
|
||||
|
||||
## Recommendation for AeThex-OS
|
||||
|
||||
### For MVP/Demo
|
||||
→ **Use Web Version**
|
||||
- Faster iteration
|
||||
- Easier to share
|
||||
- No installation friction
|
||||
|
||||
### For Production/Enterprise
|
||||
→ **Offer Both**
|
||||
- Web for accessibility
|
||||
- Desktop for power users
|
||||
- Desktop can work offline
|
||||
|
||||
### Development Workflow
|
||||
1. Develop on web version (faster)
|
||||
2. Test on desktop periodically
|
||||
3. Build desktop for releases
|
||||
4. Deploy web continuously
|
||||
|
||||
## Current Setup
|
||||
|
||||
You now have:
|
||||
- ✅ Web version ready (`npm run dev`)
|
||||
- ✅ Desktop version configured (`npm run tauri:dev`)
|
||||
- ✅ Same React codebase for both
|
||||
- ✅ Can build and deploy either version
|
||||
|
||||
Choose based on your needs!
|
||||
|
|
@ -14,7 +14,10 @@
|
|||
"ios": "npx cap open ios",
|
||||
"start": "NODE_ENV=production node dist/index.js",
|
||||
"check": "tsc",
|
||||
"db:push": "drizzle-kit push"
|
||||
"db:push": "drizzle-kit push",
|
||||
"tauri": "tauri",
|
||||
"tauri:dev": "tauri dev",
|
||||
"tauri:build": "tauri build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@capacitor-community/privacy-screen": "^6.0.0",
|
||||
|
|
|
|||
4950
src-tauri/Cargo.lock
generated
Normal file
4950
src-tauri/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,10 +1,10 @@
|
|||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
name = "aethex-os"
|
||||
version = "1.0.0"
|
||||
description = "AeThex Web Desktop Platform"
|
||||
authors = ["AeThex Corporation"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/AeThex-Corporation/AeThex-OS"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
|
|
@ -15,11 +15,11 @@ name = "app_lib"
|
|||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2.5.3" }
|
||||
tauri-build = { version = "2.5.3", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = { version = "2.9.5" }
|
||||
tauri = { version = "2.9.5", features = [] }
|
||||
tauri-plugin-log = "2"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"version": "1.0.0",
|
||||
"identifier": "com.aethex.os",
|
||||
"build": {
|
||||
"frontendDist": "../dist/client",
|
||||
"frontendDist": "../dist/public",
|
||||
"devUrl": "http://localhost:5000",
|
||||
"beforeDevCommand": "npm run dev:client",
|
||||
"beforeBuildCommand": "npm run build"
|
||||
|
|
@ -19,12 +19,15 @@
|
|||
"minHeight": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false,
|
||||
"center": true
|
||||
"center": true,
|
||||
"decorations": true,
|
||||
"transparent": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
|
@ -35,6 +38,11 @@
|
|||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
],
|
||||
"publisher": "AeThex Corporation",
|
||||
"copyright": "Copyright © 2025 AeThex Corporation",
|
||||
"category": "Productivity",
|
||||
"shortDescription": "AeThex Web Desktop Platform",
|
||||
"longDescription": "A modular web desktop platform with authentication, project management, and extensible features."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue