trackWork-0.2.0 is not a library.
TimeTrack
A powerful console-based time tracking application built with Rust featuring a beautiful terminal UI.
Features
- Terminal UI: Clean, intuitive interface built with ratatui
- Time Entry Management: Create, edit, delete, and reorder time entries
- Navigation: Easy keyboard-driven navigation
- Daily Views: View and track entries by date
- Running Timers: Start entries without an end time and stop them later
- Duration Tracking: Automatic calculation and display of time durations
- Persistent Storage: SQLite database for reliable data storage
- Date Navigation: Browse entries across different days
Installation
Build from source
The binary will be available at target/release/timetrack
Run
Usage
Keyboard Shortcuts
Normal Mode
n- Create new time entrye- Edit selected entryd- Delete selected entrys- Stop running entry (set end time to now)↑/↓- Navigate between entriesCtrl+↑/↓- Reorder entries (move up/down)←/→- Change date (previous/next day)q- Quit application
Edit/Create Mode
- Type to enter data in the current field
Tab- Move to next field (Description → Start Time → End Time)Enter- Save entryEsc- Cancel and return to normal modeBackspace- Delete character
Time Format
Enter times in 24-hour format: HH:MM (e.g., 09:30, 14:45)
Leave the end time empty to create a running timer.
Data Storage
The application stores all data in ~/.timetrack.db (SQLite database).
Project Structure
src/
├── main.rs # Application entry point and event loop
├── app.rs # Core application logic and state management
├── db.rs # Database operations and SQLite interface
├── models.rs # Data models (TimeEntry)
└── ui.rs # Terminal UI rendering (separated from business logic)
Architecture
The application follows a clean separation of concerns:
- UI Layer (
ui.rs): Handles all rendering and display logic - App Layer (
app.rs): Manages application state and user interactions - Data Layer (
db.rs,models.rs): Database operations and data structures
This separation makes the codebase maintainable and testable.
Example Workflow
- Launch the application
- Press
nto create a new entry - Enter description (e.g., "Client meeting")
- Tab to start time, enter
09:00 - Tab to end time, leave empty for running timer (or enter
10:30) - Press Enter to save
- Use
↑/↓to select entries - Press
sto stop a running timer - Use
Ctrl+↑/↓to reorder entries - Use
←/→to view different days
Dependencies
ratatui- Terminal UI frameworkcrossterm- Cross-platform terminal manipulationrusqlite- SQLite database interfacechrono- Date and time handlinganyhow- Error handlingdirs- Home directory detection
License
MIT