Architecture
gitinspector-rs is designed with a modular, data-first architecture. The system is split into multiple crates to ensure that the core analysis engine can be reused across CLI, Desktop, and Web environments.
System Design¶
Analysis Lifecycle¶
Component Breakdown¶
1. gitinspector-core¶
The heartbeat of the project. It handles:
Abstraction: A
GitProvidertrait that allows the engine to run against the CLIgitcommand or directly againstlibgit2(planned).Filtering: A robust
Filterengine that supports regex-based exclusions for authors, files, and messages.Analysis: Specialized modules for
timelinegeneration,blametracking, andmetrics(complexity/size) calculation.
2. apps/cli¶
The primary interface for v1.1.0. It provides:
CLI Parsing: Powered by
clapfor a modern, type-safe interface.Formatting Layer: Converts internal analysis structures into user-facing reports (HTML, Markdown, etc.).
Progress Tracking: Uses
indicatiffor real-time console feedback during long-running audits.
3. Data Flow¶
Analysis follows a strictly serializable data flow. Every metric generated by the core library implements serde::Serialize, ensuring that reports are consistent across all formats (JSON, XML, HTML).
Future Platform Support¶
By keeping the core decoupled from the UI, we are paving the way for:
Tauri-based Desktop App: A native GUI for exploring repository analytics.
WASM Integration: Running git audits directly in the browser for web-based project management tools.