Repository Overview
ZeroLimit is built with Tauri 2 + React + Rust, organized into frontend (React/TypeScript) and backend (Rust) components.Frontend Architecture (src/)
The frontend follows a feature-sliced design with clear separation of concerns:
Directory Structure
Feature Module Pattern
Each feature follows a consistent structure:DashboardPage.tsx- UI componentuseDashboardPresenter.ts- Data fetching and business logicusage.store.ts- Global usage state (Zustand)
State Management
ZeroLimit uses Zustand for global state:auth.store.ts- Authentication state and tokensusage.store.ts- Usage metrics and quota dataconfig.store.ts- Application configurationcliProxy.store.ts- CLI Proxy server statetheme.store.ts- UI theme (dark/light)language.store.ts- Selected languageupdate.store.ts- Update availability and version
UI Components
Built with Radix UI primitives + Tailwind CSS:- Alert dialogs, modals, select dropdowns
- Progress bars for quota tracking
- Scroll areas for logs
- Custom components in
shared/components/
Internationalization
Supported languages via react-i18next:- English (en)
- Chinese (zh)
- Indonesian (id)
- Japanese (ja)
- Korean (ko)
- Vietnamese (vi)
- Thai (th)
src/i18n/locales/[lang].json
Backend Architecture (src-tauri/)
Directory Structure
Rust Dependencies
Core:tauri- Desktop app framework with tray icon supportserde+serde_json- Serialization for frontend communication
tauri-plugin-shell- Execute shell commandstauri-plugin-dialog- Native file/folder dialogstauri-plugin-fs- Filesystem accesstauri-plugin-updater- Auto-update functionalitytauri-plugin-process- Process managementtauri-plugin-os- OS information
reqwest- HTTP client for API callstokio- Async runtimezip,tar,flate2- Archive extraction (for CLI Proxy downloads)dirs- Platform-specific directoriesopener- Open URLs in default browser
Tauri Commands
Rust functions exposed to frontend via#[tauri::command]:
- File system operations (download, extract, read)
- CLI Proxy management (start, stop, detect)
- OS-specific utilities
@tauri-apps/api.
Configuration Files
Build and Development
package.json- Node dependencies and npm scriptsvite.config.ts- Vite bundler configurationtsconfig.json- TypeScript compiler optionstailwind.config.js- Tailwind CSS configuration (if present)components.json- shadcn/ui component configuration
Code Quality
.editorconfig- Editor formatting rules (2 spaces, LF, UTF-8).prettierrc- Prettier configuration (no semicolons, single quotes).prettierignore- Files to exclude from formatting
Tauri Specific
src-tauri/tauri.conf.json- Window settings, bundle config, pluginssrc-tauri/Cargo.toml- Rust crate metadata and dependencies
Documentation
README.md- Project overview and quick startAGENTS.md- Repository guidelines for developersdocs/USAGE.md- User guide
Build Outputs
Development
- Frontend dev server:
http://localhost:1420(in-memory) - Rust debug build:
src-tauri/target/debug/
Production
- Frontend bundle:
dist/(HTML, CSS, JS) - Rust release binary:
src-tauri/target/release/ - Installers:
src-tauri/target/release/bundle/- Windows:
nsis/,msi/ - macOS:
dmg/,macos/ - Linux:
deb/,rpm/,appimage/
- Windows:
Architecture Patterns
Frontend
- Presenter Pattern: Business logic separated into
use[Feature]Presenterhooks - Feature Slices: Each feature is self-contained with its own components, stores, and logic
- Shared Utilities: Common code in
shared/for reuse across features - Type Safety: Full TypeScript coverage with strict mode
Backend
- Command Pattern: Tauri commands act as backend API endpoints
- Async/Await: All I/O operations use Tokio async runtime
- Error Handling:
thiserrorfor structured error types - Cross-platform: Platform-agnostic code where possible, conditional compilation where necessary
Key Technologies
| Layer | Technology | Purpose |
|---|---|---|
| Desktop Framework | Tauri 2 | Native desktop wrapper |
| Frontend | React 19 + TypeScript | UI and application logic |
| Backend | Rust | System operations and CLI Proxy management |
| Build Tool | Vite | Fast dev server and bundling |
| Styling | Tailwind CSS 4 | Utility-first styling |
| UI Components | Radix UI | Accessible primitives |
| State Management | Zustand | Global state |
| Routing | React Router 7 | Client-side navigation |
| HTTP Client | Axios (frontend), reqwest (backend) | API communication |
| i18n | react-i18next | Internationalization |
| Animation | Motion (Framer Motion) | UI animations |
| Charts | Recharts | Quota visualization |
Next Steps
Building from Source
Set up your development environment
Contributing
Start contributing to ZeroLimit