How idootop/magicmirror works
Main Components
a) Frontend Layer:
• React-based UI (src/ directory) with key components:
• Main UI Views (pages/Launch.tsx, pages/Mirror.tsx)
• Component Library (components/)
• Hooks for Business Logic (hooks/)
• Services for Core Functions (services/)
b) Desktop Application Shell:
• Tauri framework (src-tauri/) which bridges web frontend and native backend:
• Main Process (src-tauri/src/main.rs)
• IPC Commands (src-tauri/src/commands.rs)
• Utility Functions (src-tauri/src/utils.rs)
c) Python Backend Server:
• AI processing server (src-python/):
• Main Server (server.py)
• Face Processing Module (magic/face.py)
• Application Logic (magic/app.py)
Interaction Flows
• Frontend → Tauri Bridge: IPC calls for native operations
• Tauri → Python Server: Local API communications
• Python Server → AI Models: Face processing operations
• Data flow for image processing pipeline
Architectural Patterns to Highlight
• Client-Server Architecture (Frontend ↔ Python Backend)
• Bridge Pattern (Tauri connecting Web UI and Native features)
• Service-based Architecture (Frontend services layer)
• Hook-based State Management (React hooks)
Technical Stack Indicators
• Frontend: React, TypeScript, Vite
• Desktop: Tauri (Rust)
• Backend: Python
• AI: InsightFace, FaceFusion
Additional Elements
• Configuration files (tauri.conf.json, pyproject.toml)
• Resource directories (assets, locales)
• Build/Deploy workflows (.github/workflows)
Remember to:
• Use consistent symbols and notation
• Brief annotations for key components
• Both synchronous and asynchronous flows
• Error handling paths