Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pelleking/Time-Logger

Repository files navigation

Time Logger for Harvest

A native macOS menu bar application that provides a convenient interface for tracking time with Harvest. Built with SwiftUI and designed for macOS 15.2+.

Features

🚀 Core Functionality

  • Menu Bar Integration: Quick access to time tracking directly from your macOS menu bar
  • Harvest Integration: Full OAuth2 authentication with Harvest API
  • Real-time Timer: Start, stop, and track time with live elapsed time display
  • Project & Task Management: Browse and select from your assigned Harvest projects and tasks
  • Today's Entries: View all time entries for the current day

🎨 Customization

  • Multiple Themes: Auto, Light, and Dark theme support
  • Accent Colors: Choose from Green, Blue, Orange, Purple, or Pink
  • Favorite Projects: Mark frequently used projects as favorites for quick access
  • Default Tasks: Set default tasks for projects to speed up time entry
  • Time Rounding: Configurable time rounding intervals (15 minutes by default)

🖥️ User Interface

  • Detached Window Mode: Pop out the timer into a standalone window
  • Keyboard Shortcuts:
    • ⌘S - Start timer
    • ⌘⇧S - Stop timer
    • ⌘R - Refresh data
    • ⌘, - Open settings
    • ⌘⌥1/2/3 - Switch themes
  • Advanced Settings: Manage favorites and default tasks in a dedicated settings window

🔐 Security & Privacy

  • Secure OAuth2: Industry-standard authentication with Harvest
  • Local Storage: All settings and tokens stored securely using Core Data

Prerequisites

  • macOS 15.2 or later
  • Active Harvest account

Usage

Initial Setup

  1. Launch the application
  2. Click on the clock icon in your menu bar
  3. Click "Sign In with Harvest"
  4. Complete the OAuth2 flow in your browser
  5. Return to the app to start tracking time

Time Tracking

  1. Select a project from the dropdown
  2. Choose a task (if multiple tasks are available)
  3. Click "Start Timer" or use ⌘S
  4. Work on your task
  5. Click "Stop Timer" or use ⌘⇧S when finished

Managing Favorites and Defaults

  1. Access settings via ⌘, or the menu
  2. Mark frequently used projects as favorites
  3. Set default tasks for projects to auto-select them
  4. Configure time rounding preferences

Project Structure

Time Logger/
├── MainApp.swift              # Main app entry point
├── ContentView.swift          # Primary UI interface
├── SharedModels.swift         # Data models and view models
├── OAuthManager.swift         # Harvest OAuth2 integration
├── AppDelegate.swift          # App delegate
├── AppWindowView.swift        # Window management
├── Persistence.swift          # Core Data stack
├── Time_Logger.xcdatamodeld/  # Core Data model
├── Assets.xcassets/           # App assets
└── Time_Logger.entitlements   # App entitlements

Architecture

  • SwiftUI: Modern declarative UI framework
  • Core Data: Local data persistence for tokens and settings
  • Combine: Reactive programming for state management
  • OAuth2: Secure authentication with Harvest API
  • Menu Bar Extra: Native macOS menu bar integration

API Integration

The app integrates with Harvest's REST API v2:

  • Authentication: OAuth2 flow with PKCE
  • Projects: Fetch assigned projects and tasks
  • Time Entries: Create, read, and manage time entries
  • User Info: Retrieve account information

Keyboard Shortcuts

Shortcut Action
⌘S Start Timer
⌘⇧S Stop Timer
⌘R Refresh Data
⌘, Open Settings
⌘⌥1 Auto Theme
⌘⌥2 Light Theme
⌘⌥3 Dark Theme

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and feature requests, please use the GitHub issue tracker.

Acknowledgments

  • Built with SwiftUI
  • Integrates with Harvest time tracking service
  • Uses OAuth2 for secure authentication

Made with ❤️ by Pelle

Happy time tracking!

About

My own time logger using harvest api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages