How zhongweili/imagenie works
Main Components
• Frontend (Vue 3):
• All UI components, views, and routing logic reside in the src directory. This includes components (e.g., MainLayout, Sidebar, FunctionSettings) for displaying the user interface and handling interactivity.
• Backend (Tauri/Rust):
• Located in the src-tauri directory. Contains the Rust code responsible for executing commands (e.g., background_removal.rs, face_restoration.rs, upscaling.rs) along with image processing modules and integration with ONNX (for AI model inference).
• AI Processing Engine:
• Uses ONNX models (e.g., dummy.onnx). The Rust backend handles the image processing logic and employs libraries like ONNX Runtime for rapid AI-driven image enhancement.
• Configuration & Build Tools:
• Files like Cargo.toml, tauri.conf.json, and package.json indicate the integration of multiple build systems (Rust/Cargo and Node/Vite). This supports both the frontend and backend parts of the app.
• Auxiliary Directories:
• Assets (styles, images), i18n for multiple languages, and .github workflows for testing and release management also support project development and deployment.
Relationships and Interactions
• User Interaction Flow:
• The user interacts with the Vue-based frontend. From components in src, actions (e.g., clicking a button to upscale an image) trigger API calls.
• Communication via Tauri Bridge:
• Processing Pipeline:
• Tauri command modules then use image processing utilities (the image/ folder in src-tauri) and AI models (from the models folder and ONNX Runtime integration) to execute the given functionality.
• Feedback:
• Results are returned from the Rust backend to the Vue frontend for real-time display, especially with features such as before/after swipe comparisons.
Architectural Patterns and Design Principles
• Separation of Concerns:
• The clear division between the presentation layer (Vue3) and processing layer (Rust/Tauri) is a core design principle here.
• Modular Design:
• The commands are modularized in separate files (image processing, background removal, etc.) to keep feature implementations isolated and maintainable.
• Local and Secure Processing:
• That this architecture is designed for complete local execution, using secure, isolate processing without remote calls, which is a significant design decision in the project.
Relevant Technologies, Frameworks, and Libraries
• Frontend: Vue 3, Vite (as can be seen in vite.config.ts), JavaScript/TypeScript.
• Backend: Tauri 2 (using Rust), ONNX Runtime for AI-based image processing.
• Build/Configuration Tools: Cargo (for Rust), Node.js (for frontend via package.json), pre-commit hooks, GitHub Actions.
• Additional Dependencies: Tools like cliff.toml, deny.toml, and _typos.toml used for project quality and lint checks.