How parthapatel114-rgb/margin works
Margin is a local-first desktop study-time tracker. Users choose a subject and study type, run a stopwatch, Pomodoro, or countdown, then finish and review recorded sessions; the app restores unfinished timers on restart. History supports manual entry and correction, while statistics and calendars summarize recorded time. The graph separates the React workspace and study workflows from analytics and the Rust/SQLite persistence layer. Backup, appearance, daily targets, and native mini-timer capabilities are included as documented branches; unsampled backend wiring is represented only where the README supports it.
Main entry points: App.tsx App shell · lib.rs Native commands · analytics.ts Analytics engine · Insights.tsx Statistics views
Components 18
Desktop workspace
- App shell
src/App.tsx - Settings and backups
src/components/Settings.tsx - Appearance presets
src/lib/palette.ts
Study workflows
- Timer UI
src/components/Timer.tsx - Today view
src/components/Today.tsx - Subjects and types
src/components/Subjects.tsx
History and insights
- Session history
src/components/History.tsx - Session editor
src/components/SessionEditor.tsx - Statistics views
src/components/Insights.tsx - Calendar and dates
src/components/Calendar.tsx - Analytics engine
src/lib/analytics.ts - Insight summaries
src/lib/insights.ts - Date utilities
src/lib/dates.ts
Native data layer
- Native commands
src-tauri/src/lib.rs - Domain models
src-tauri/src/model.rs - Session persistence
src-tauri/src/db.rs - Local SQLite
Other components
- Student
Connections 24
- Student → App shell: uses
README.md - App shell → Today view: shows
src/App.tsx - App shell → Timer UI: shows
src/App.tsx - App shell → Session history: shows
src/App.tsx - App shell → Statistics views: shows
src/App.tsx - App shell → Settings and backups: opens
src/App.tsx - Today view → Timer UI: hosts
- Timer UI → Native commands: records sessions
- Subjects and types → Native commands: saves choices
- Session history → Session editor: edits sessions
src/components/History.tsx - Session history → Analytics engine: analyzes sessions
src/components/History.tsx - Session editor → Native commands: saves entries
- Statistics views → Analytics engine: analyzes sessions
src/components/Insights.tsx - Statistics views → Insight summaries: builds recaps
src/components/Insights.tsx - Statistics views → Calendar and dates: shows calendar
src/components/Insights.tsx - Calendar and dates → Analytics engine: uses date totals
src/components/Calendar.tsx - Calendar and dates → Date utilities: uses date ranges
src/components/Calendar.tsx - Insight summaries → Analytics engine: summarizes
src/lib/insights.ts - Date utilities → Analytics engine: uses date helpers
src/lib/dates.ts - Settings and backups → Native commands: exports and restores
- App shell → Appearance presets: applies appearance
- Native commands → Session persistence: dispatches commands
src-tauri/src/lib.rs - Session persistence → Domain models: reads and writes
src-tauri/src/db.rs - Session persistence → Local SQLite: persists records
README.md