Skip to content

Latest commit

 

History

History
120 lines (85 loc) · 4.61 KB

File metadata and controls

120 lines (85 loc) · 4.61 KB

TimeTracker Mobile App

Flutter mobile application for Android and iOS that integrates with the TimeTracker REST API.

Features

  • Time Tracking - Start, pause, resume, and stop timers
  • Projects & Tasks - View and select projects and tasks
  • Time Entries - View, filter, and manage time entries
  • Workday - Clock in/out and breaks
  • Finance & workforce - Invoices, expenses, time-off, timesheets, approvals
  • Offline Support - Queue changes offline; periodic auto-sync when online
  • Secure Authentication - Sign in with your web username and password; the app obtains an API token and validates the server via GET /api/v1/info

Setup

Prerequisites

  • Flutter SDK 3.0.0 or higher
  • Android Studio / Xcode for platform-specific setup

Installation

  1. Install dependencies:
flutter pub get
  1. Run code generation (for Hive adapters):
flutter pub run build_runner build
  1. Run the app:
flutter run

Configuration

Signing in

Use the same username and password you use to log in to the TimeTracker web app. The mobile app signs you in via the API and obtains an API token in the background, giving you the same basics access (timer, time entries, projects, tasks) as on the web.

  1. Launch the app on your device
  2. On the login screen, enter:
    • Server URL: The exact base URL you use in the browser for the TimeTracker web app. If the web app opens at https://example.com/timetracker/ (with a path), use https://example.com/timetracker as the Server URL — no trailing slash. If it opens at https://example.com/, use https://example.com.
    • Username: Your web login username
    • Password: Your web login password
  3. Tap "Login"
  4. The app will validate your credentials and navigate to the home screen if successful

Server URL and HTTPS

The default TimeTracker deployment uses docker-compose with NGINX on ports 80 and 443 (HTTPS). Use your server’s HTTPS URL (e.g. https://your-server.com) with no port unless you use a custom one.

  • Production: Use a valid certificate (e.g. Let’s Encrypt) so the app can connect without certificate errors.
  • Local / testing: Use a trusted CA (e.g. mkcert) for HTTPS, or HTTP only if your setup serves the API over HTTP (e.g. dev without NGINX).

Troubleshooting

"Invalid username or password" error:

  • Use the same username and password you use on the web app
  • Ensure the server URL is correct and the server is reachable

"Connection failed" or certificate errors (e.g. on DDNS or custom domains like timetracker.example.ddns.net):

  • Enter the exact base URL with https:// (e.g. https://timetracker.techteam.ddns.net) — no path and no trailing slash after the host.
  • If the server uses a self-signed or custom CA certificate, the app will show a "Certificate not trusted" dialog — tap "Yes, trust" to allow that host and retry.
  • For production, use a publicly trusted certificate (e.g. Let's Encrypt) for your hostname so the app connects without prompts.
  • Ensure the hostname resolves from the phone’s network (e.g. if the server is only reachable on office Wi‑Fi, connect the phone to that network or VPN).
  • Use the "Details" button on the error to copy diagnostics (URL, error type, message) for debugging.

General "Connection failed" error:

  • Verify the server URL is correct and accessible
  • Check your internet connection
  • Ensure the server is running and the API is accessible
  • For local development, use http://localhost:5000 or your local IP address

Offline Mode:

  • The app works offline and will sync when connection is restored
  • Time entries created offline are queued and synced automatically
  • Timer status is cached locally for offline viewing

Architecture

The app follows clean architecture principles:

  • Presentation Layer (lib/presentation/) - UI screens and widgets
  • Domain Layer (lib/domain/) - Business logic and use cases
  • Data Layer (lib/data/) - API client, local storage, models
  • Core (lib/core/) - Configuration, themes, constants

API Integration

The app integrates with the TimeTracker REST API (/api/v1/):

  • Timer endpoints: /api/v1/timer/start, /api/v1/timer/stop, /api/v1/timer/status
  • Time entries: /api/v1/time-entries
  • Projects: /api/v1/projects
  • Tasks: /api/v1/tasks

See the main project's API documentation for details.

Building

Android

flutter build apk --release
# or
flutter build appbundle --release

iOS

flutter build ios --release

Then open Xcode to archive and distribute.