Build desktop-class applications with modern web technologies and Rust performance. A production-ready starter template featuring Clean Architecture, MVVM pattern, comprehensive error handling, connection pooling, and an integrated DevTools panel.
# Clone and run
git clone <repository-url>
cd starter-rust-webuiangular-rspack
./run.sh./run.sh --build # Build frontend + backend
./run.sh --build-frontend # Build frontend only
./run.sh --build-rust # Build backend only
./run.sh --release # Build optimized release
./run.sh --run # Run existing build
./run.sh --clean # Clean artifacts
./run.sh --rebuild # Clean + rebuild
./run.sh --help # Show all options- Clean Architecture (Rust backend) - Domain, Application, Infrastructure, Presentation layers
- MVVM Pattern (Angular frontend) - Models, ViewModels, Views separation
- Event-Driven Design - Pub/sub event bus for decoupled communication
- Plugin System - Extensible architecture for custom functionality
- WebUI Integration - Native desktop windowing without Electron overhead
- SQLite Database - Embedded database with connection pooling (r2d2)
- Enhanced Error Handling - Panic hooks, error tracking, terminal output
- Comprehensive Logging - Multi-sink logging with JSON formatting
- Cross-Platform - Windows, macOS, Linux support
- Serialization - JSON, MessagePack, CBOR support via serde
- Angular 21.1.5 - Latest Angular with Signals and modern features
- Rspack Bundler - 10x faster builds than webpack
- Biome Linter - Fast Rust-based linting and formatting
- Error Interceptor - Global error catching and reporting
- Event Bus Service - Reactive event management
- DevTools Panel - Comprehensive debugging interface (5 tabs)
- Hot Module Replacement - Fast development with live reload
- Type Safety - Full TypeScript typing with strict mode
- Code Quality - Biome linting and formatting enforced
- Build Orchestration - Automated build pipelines
- Configuration - TOML-based configuration management
| Document | Description |
|---|---|
| π Getting Started | Installation, setup, and first run |
| ποΈ Architecture | System architecture and design patterns |
| π¦ Project Structure | Repository layout and organization |
| π¨ Build System | Build pipeline and deployment |
| π Communication | Frontend-backend IPC patterns |
| Comprehensive error handling guide | |
| π§ Biome Setup | Linter and formatter configuration |
| π Connection Pooling | Database pooling implementation |
| π Dependencies | Complete dependency reference |
| π― Improvements | Suggested enhancements |
starter-rust-webuiangular-rspack/
β
βββ π Cargo.toml # Rust package manifest
βββ π Cargo.lock # Dependency lock file
βββ π build.rs # Cargo build script
βββ π run.sh # Main run script
βββ π build-frontend.js # Frontend build orchestration
βββ π build-dist.sh # Distribution builder
βββ π post-build.sh # Post-build processing
β
βββ π src/ # Rust backend source
β βββ main.rs # Application entry point
β βββ utils_demo.rs # Utility demonstrations
β β
β βββ π core/ # Clean Architecture
β βββ domain/ # Business entities & traits
β βββ application/ # Use cases & handlers
β βββ infrastructure/ # DB, logging, config, DI
β β βββ database/ # SQLite with connection pooling
β β βββ logging/ # Multi-sink logging
β β βββ error_handler.rs # Enhanced error handling
β β βββ di.rs # Dependency injection
β βββ presentation/ # WebUI integration
β βββ webui/handlers/ # Event handlers
β
βββ π frontend/ # Angular frontend
β βββ src/
β β βββ main.ts # Angular entry point
β β βββ index.html # HTML template
β β β
β β βββ π views/ # Angular components
β β β βββ app.component.ts # Root component
β β β βββ home/ # Home feature
β β β βββ demo/ # Demo feature
β β β βββ devtools/ # π οΈ DevTools panel
β β β
β β βββ π viewmodels/ # MVVM ViewModels
β β β βββ event-bus.viewmodel.ts
β β β βββ logging.viewmodel.ts
β β β βββ window-state.viewmodel.ts
β β β βββ error-dashboard.viewmodel.ts
β β β
β β βββ π core/ # Core services
β β β βββ global-error.handler.ts
β β β βββ global-error.service.ts
β β β βββ error-interceptor.ts
β β β βββ winbox.service.ts
β β β
β β βββ π models/ # Data models
β β βββ π types/ # TypeScript types
β β βββ π environments/ # Environment configs
β β
β βββ angular.json # Angular CLI config
β βββ rspack.config.js # Rspack bundler config
β βββ biome.json # Biome linter config
β βββ tsconfig.json # TypeScript config
β βββ package.json # NPM dependencies
β
βββ π config/ # Runtime configuration
β βββ app.config.toml # Application config
β
βββ π docs/ # Documentation
β βββ 01-introduction.md
β βββ 02-architecture.md
β βββ 03-build-system.md
β βββ 04-communication.md
β βββ 05-dependencies.md
β βββ 06-improvements.md
β βββ 07-getting-started.md
β βββ 08-project-structure.md
β βββ 09-errors-as-values.md
β βββ REFACTORING_CONNECTION_POOLING.md
β
βββ π thirdparty/ # Third-party libraries
β βββ webui-c-src/ # WebUI C source
β
βββ π static/ # Static assets (runtime)
βββ js/
βββ css/
| Technology | Version | Purpose |
|---|---|---|
| Rust | 1.93+ | Core language |
| WebUI | 2.5.0-beta.4 | Desktop windowing |
| SQLite | 0.32 | Embedded database |
| r2d2 | 0.8 | Connection pooling |
| serde | 1.0 | Serialization |
| log | 0.4 | Logging facade |
| backtrace | 0.3 | Stack traces |
| Technology | Version | Purpose |
|---|---|---|
| Angular | 21.1.5 | UI framework |
| TypeScript | 5.9 | Type safety |
| Rspack | 1.7.6 | Bundler |
| Biome | 2.4.4 | Linter/formatter |
| Bun | 1.3 | Package manager |
| WinBox | 0.2.82 | Window management |
| RxJS | 7.8.2 | Reactive extensions |
| Tool | Purpose |
|---|---|
| Cargo | Rust build system |
| Angular CLI | Angular build tool |
| Rspack | Fast webpack-compatible bundler |
| Biome | Fast linter and formatter |
- Native window management with WinBox integration
- System information monitoring
- File system operations
- Database CRUD operations
- Real-time event bus communication
-
DevTools Panel (5 tabs):
- π₯οΈ Backend - Stats, logs, bindings
- π¨ Frontend - Events, errors, memory
- π‘ Events - Event history and payloads
- π Environment - Browser info, features
- β‘ Actions - Test scenarios, benchmarks
-
Error Dashboard - Visual error tracking
-
Console Logging - Structured error output
-
Performance Benchmarks - Event bus, signals
- SQLite database with connection pooling
- User management (CRUD operations)
- Event history tracking
- Log aggregation and retrieval
# Clone repository
git clone <repository-url>
cd starter-rust-webuiangular-rspack
# Install frontend dependencies
cd frontend
bun install
# Build and run
cd ..
./run.sh# WebKit2GTK (required for WebUI)
sudo apt install libwebkit2gtk-4.1-dev # Debian/Ubuntu
sudo dnf install webkit2gtk4.1-devel # Fedora# Xcode Command Line Tools
xcode-select --install# Visual Studio Build Tools
# WebView2 runtime (included in Windows 10+)[app]
name = "Rust WebUI SQLite Demo"
version = "1.0.0"
[window]
title = "Rust WebUI Application"
width = 1280
height = 800
[database]
path = "app.db"
create_sample_data = true
[logging]
level = "info"
file = "logs/application.log"
append = true
[communication]
transport = "webview_ffi"
serialization = "json"| Variable | Description | Default |
|---|---|---|
RUST_LOG |
Log level | info |
RUSTWEBUI_DIST_DIR |
Custom dist directory | ./dist |
cd frontend
cargo testcd frontend
bun run testcd frontend
bun run lint # Check
bun run lint:fix # Auto-fixcd frontend
bun run format # Check
bun run format:fix # Auto-fix./run.sh --build./run.sh --release./build-dist.sh build-releaseOutput will be in target/release/ with platform-specific packaging.
# Clean and rebuild
./run.sh --clean
./run.sh --rebuild# Reinstall dependencies
cd frontend
rm -rf node_modules bun.lock
bun install# Remove and recreate database
rm app.db
./run.sh- Ensure WebKit2GTK is installed (Linux)
- Check WebView2 runtime (Windows)
- Verify port is not in use
- Check documentation
- Review ERROR_HANDLING_GUIDE.md
- Inspect application logs in
logs/application.log - Check DevTools panel for runtime errors
MIT License - See LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
- All code must pass
bun run lintandbun run format - Backend code must pass
cargo clippy - New features should include tests
- Documentation should be updated for API changes
| Metric | Value | Notes |
|---|---|---|
| Frontend Build Time | ~30s | Production build |
| Backend Build Time | ~45s | Debug profile |
| Cold Start Time | ~2s | First launch |
| Memory Usage | ~50MB | Idle application |
| Event Bus Throughput | 10,000+ events/sec | Benchmark test |
- β Clean Architecture implementation
- β MVVM frontend pattern
- β Connection pooling (r2d2)
- β Enhanced error handling
- β DevTools panel
- β Biome linting setup
- π Integration testing framework
- π Performance monitoring
- π Plugin marketplace
- β³ WebSocket transport layer
- β³ Multi-window support
- β³ Theme customization
- β³ Auto-update mechanism
Built with β€οΈ using Rust and Angular