Dries Peeters 69f2c80308 feat: Complete Admin Settings UI and enhance PDF logo reliability
This commit addresses multiple issues with the Admin Settings page and
improves PDF invoice logo embedding for better cross-platform reliability.

## Admin Settings UI - Missing Fields Fixed

The Admin → Settings page was incomplete, showing only basic timer and
regional settings. Added all missing sections:

- User Management: Self-registration toggle with admin username note
- Company Branding: Full company info fields (name, email, phone, website,
  address, tax ID, bank info) plus logo upload with preview
- Invoice Defaults: Prefix, start number, payment terms, and notes
- Backup Settings: Retention days and backup time configuration
- Export Settings: CSV delimiter preference selector
- Privacy & Analytics: Telemetry opt-in with detailed privacy information

The backend was already handling these fields - this was purely a frontend
template issue where form fields were missing.

## Analytics/Telemetry Preference Synchronization

Fixed critical bug where analytics checkbox in Admin Settings only updated
the database but not the InstallationConfig file that the telemetry system
actually reads from. Changes now properly sync both systems:

- On page load: Auto-sync database from InstallationConfig (source of truth)
- On save: Update both database AND InstallationConfig simultaneously
- Added logging for analytics preference changes
- Updated UI references: Initial setup and Telemetry dashboard now point
  to Admin → Settings as the primary location
- Added clear privacy information explaining what data is collected

## PDF Logo Embedding Enhancement

Improved logo reliability in PDF invoices by switching from file:// URIs
to base64 data URIs:

- More reliable across platforms (Windows, Linux, macOS)
- Works consistently in Docker containers
- Self-contained (no filesystem path dependencies)
- Automatic MIME type detection for all formats (PNG, JPG, GIF, SVG, WEBP)
- Graceful fallback to file:// URI if base64 fails
- Added comprehensive debug logging for troubleshooting

## Diagnostic Tools & Documentation

- Created test_logo_pdf.py: Diagnostic script to identify logo issues
- Created LOGO_PDF_TROUBLESHOOTING.md: Comprehensive troubleshooting guide
- Enhanced error messages with debug output throughout logo processing
- Added context passing fixes for PDF template rendering

## Files Changed

### Core Fixes
- app/templates/admin/settings.html: Complete rewrite with all sections
- app/routes/admin.py: InstallationConfig sync for analytics preference
- app/static/uploads/logos/.gitkeep: Ensure logos directory tracked by git

### PDF Logo Enhancement
- app/utils/pdf_generator.py: Base64 encoding + explicit context passing
- app/utils/template_filters.py: get_logo_base64() helper with debug logging
- app/templates/invoices/pdf_default.html: Base64 logo embedding

### Analytics Synchronization
- app/templates/setup/initial_setup.html: Updated settings reference
- app/templates/admin/telemetry.html: Cross-reference to Admin → Settings

### Documentation
- docs/GETTING_STARTED.md: Updated to reflect actual UI behavior
- test_logo_pdf.py: New diagnostic script
- LOGO_PDF_TROUBLESHOOTING.md: New troubleshooting guide

## Testing

Run diagnostic script to verify logo configuration:
2025-10-25 07:23:43 +02:00
2025-10-21 13:00:59 +02:00
2025-10-24 17:29:50 +02:00
2025-10-24 22:07:09 +02:00
2025-10-10 11:37:23 +02:00
2025-10-24 18:49:41 +02:00
2025-10-20 22:07:14 +02:00
2025-10-10 11:37:23 +02:00
2025-08-16 21:49:43 +02:00
2025-10-10 11:37:23 +02:00
2025-10-10 11:37:23 +02:00
2025-10-10 13:33:49 +02:00
2025-10-10 11:37:23 +02:00
2025-10-23 19:38:04 +02:00
2025-10-24 16:53:30 +02:00
2025-10-10 11:37:23 +02:00
2025-10-10 11:37:23 +02:00
2025-10-10 11:37:23 +02:00
2025-10-10 11:37:23 +02:00
2025-10-24 15:14:39 +02:00

TimeTracker

Professional Time Tracking & Project Management for Teams

Track time. Manage projects. Generate invoices. All in one place.

🚀 Quick Start Features📸 Screenshots📖 Getting Started📚 Documentation🐳 Deploy


🎯 What is TimeTracker?

TimeTracker is a self-hosted, web-based time tracking application designed for freelancers, teams, and businesses who need professional time management with complete control over their data.

Perfect for:

  • 💼 Freelancers tracking billable hours across multiple clients
  • 👥 Small Teams managing projects and tracking productivity
  • 🏢 Agencies needing detailed reporting and client billing
  • 🔒 Privacy-focused organizations wanting self-hosted solutions

Features

⏱️ Smart Time Tracking

  • One-Click Timers — Start tracking with a single click
  • Persistent Timers — Timers keep running even after browser closes
  • Idle Detection — Automatic pause after configurable idle time
  • Manual Entry — Add historical time entries with notes and tags
  • Real-time Updates — See live timer updates across all devices

📊 Project & Task Management

  • Unlimited Projects & Tasks — Organize work your way
  • Client Management — Store client details and billing rates
  • Task Board — Visual task management with priorities and assignments
  • Status Tracking — Monitor progress from to-do to completion
  • Estimates vs Actuals — Track project budgets and burn rates

🧾 Professional Invoicing

  • Generate from Time — Convert tracked hours to invoices automatically
  • Custom Line Items — Add manual items for expenses or services
  • Tax Calculation — Automatic tax calculations with configurable rates
  • PDF Export — Professional invoice templates (coming soon)
  • Status Tracking — Track draft, sent, paid, and overdue invoices

📈 Analytics & Reporting

  • Visual Dashboards — Charts and graphs for quick insights
  • Detailed Reports — Time breakdown by project, user, or date range
  • CSV Export — Export data for external analysis
  • Billable vs Non-billable — Separate tracking for accurate billing
  • Custom Date Ranges — Flexible reporting periods

🔐 Multi-User & Security

  • Role-Based Access — Admin and user roles with appropriate permissions
  • User Management — Add team members and manage access
  • Self-Hosted — Complete control over your data
  • Username-Only Login — Simple authentication for internal use
  • Session Management — Secure cookies and session handling
  • Profile Pictures — Users can upload a profile picture in their profile settings

🛠️ Technical Excellence

  • Docker Ready — Deploy in minutes with Docker Compose
  • Database Flexibility — PostgreSQL for production, SQLite for testing
  • Responsive Design — Works perfectly on desktop, tablet, and mobile
  • Real-time Sync — WebSocket support for live updates
  • Automatic Backups — Scheduled database backups (configurable)

📸 Screenshots

🏠 Dashboard — Your Command Center

Dashboard

Start timers, view recent entries, and see your productivity at a glance


🔐 Simple Login & User Management

Login Profile

Simple username-based authentication and customizable user profiles with avatar support


📁 Projects & Tasks — Stay Organized

Projects Tasks

Manage multiple projects and break them down into actionable tasks


📋 Kanban Board — Visual Task Management

Kanban Board

Drag-and-drop task management with customizable columns and visual workflow


⏱️ Time Tracking — Flexible & Powerful

Log Time Time Entry Templates

Manual time entry and reusable templates for faster logging


🧾 Invoicing & Clients — Professional Billing

Invoices Client Management

Generate invoices from tracked time and manage client relationships


📊 Reports & Analytics — Data-Driven Insights

Reports User Reports

Comprehensive reporting and user analytics for informed decisions


🛠️ Admin Dashboard — Complete Control

Admin Dashboard

Manage users, configure settings, and monitor system health


🎯 Easy Creation — Streamlined Workflows

Create Project Create Task Create Client

Simple, intuitive forms for creating projects, tasks, and clients


🚀 Quick Start

Get TimeTracker running in under 2 minutes:

# Clone the repository
git clone https://github.com/drytrix/TimeTracker.git
cd TimeTracker

# Create your .env from the template and set SECRET_KEY and TZ
cp env.example .env
# Edit .env and set a strong SECRET_KEY (python -c "import secrets; print(secrets.token_hex(32))")

# Start with Docker Compose (HTTPS via nginx)
docker-compose up -d

# Access at https://localhost (self-signed cert)

# Prefer plain HTTP on port 8080?
# Use the example compose that publishes the app directly:
# docker-compose -f docker-compose.example.yml up -d
# Access at http://localhost:8080

See the full Docker Compose setup guide: docs/DOCKER_COMPOSE_SETUP.md

First login creates the admin account — just enter your username!

Quick Test with SQLite

Want to try it out without setting up a database?

docker-compose -f docker-compose.local-test.yml up --build

No configuration needed — perfect for testing!


💡 Use Cases

For Freelancers

Track time across multiple client projects, generate professional invoices, and understand where your time goes. TimeTracker helps you bill accurately and identify your most profitable clients.

For Teams

Assign tasks, track team productivity, and generate reports for stakeholders. See who's working on what, identify bottlenecks, and optimize team performance.

For Agencies

Manage multiple clients and projects simultaneously. Track billable hours, generate client invoices, and analyze project profitability — all in one place.

For Personal Projects

Even if you're not billing anyone, understanding where your time goes is valuable. Track personal projects, hobbies, and learning activities to optimize your time.


🌟 Why TimeTracker?

Feature TimeTracker Traditional Time Trackers
Self-Hosted Complete data control Cloud-only, subscription fees
Open Source Free to use & modify Proprietary, locked features
Persistent Timers Runs server-side Browser-dependent
Docker Ready Deploy anywhere ⚠️ Complex setup
Invoicing Built-in Track to bill workflow Requires integration
No User Limits Unlimited users Per-user pricing

📚 Documentation

Comprehensive documentation is available in the docs/ directory:

Getting Started

Features

Technical Documentation

Contributing


🐳 Deployment

Local Development

docker-compose up -d

Production with PostgreSQL

# Configure your .env file
cp env.example .env
# Edit .env with production settings (set SECRET_KEY, TZ, DB credentials)

# Start with production compose (published image)
docker-compose -f docker-compose.remote.yml up -d

⚠️ Security Note: Always set a unique SECRET_KEY in production! See CSRF Configuration for details.

Raspberry Pi

TimeTracker runs perfectly on Raspberry Pi 4 (2GB+):

# Same commands work on ARM architecture
docker-compose up -d

📖 See Deployment Guide for detailed instructions


🔧 Configuration

TimeTracker is highly configurable through environment variables. For a comprehensive list and recommended values, see:

Common settings:

# Timezone and locale
TZ=America/New_York
CURRENCY=USD

# Timer behavior
SINGLE_ACTIVE_TIMER=true
IDLE_TIMEOUT_MINUTES=30
ROUNDING_MINUTES=1

# User management
ADMIN_USERNAMES=admin,manager
ALLOW_SELF_REGISTER=false

# Security (production)
SECRET_KEY=your-secure-random-key
SESSION_COOKIE_SECURE=true

📊 Analytics & Telemetry

TimeTracker includes optional analytics and monitoring features to help improve the application and understand how it's being used. All analytics features are:

  • Disabled by default — You must explicitly opt-in
  • Privacy-first — No personally identifiable information (PII) is collected
  • Self-hostable — Run your own analytics infrastructure
  • Transparent — All data collection is documented

What We Collect (When Enabled)

1. Structured Logs (Always On, Local Only)

  • Request logs and error messages stored locally in logs/app.jsonl
  • Used for troubleshooting and debugging
  • Never leaves your server

2. Prometheus Metrics (Always On, Self-Hosted)

  • Request counts, latency, and performance metrics
  • Exposed at /metrics endpoint for your Prometheus server
  • Stays on your infrastructure

3. Error Monitoring (Optional - Sentry)

  • Captures uncaught exceptions and performance issues
  • Helps identify and fix bugs quickly
  • Opt-in: Set SENTRY_DSN environment variable

4. Product Analytics (Optional - PostHog)

  • Tracks feature usage and user behavior patterns with advanced features:
    • Person Properties: Role, auth method, login history
    • Feature Flags: Gradual rollouts, A/B testing, kill switches
    • Group Analytics: Segment by version, platform, deployment
    • Rich Context: Browser, device, environment on every event
  • Opt-in: Set POSTHOG_API_KEY environment variable
  • See POSTHOG_ADVANCED_FEATURES.md for complete guide

5. Installation Telemetry (Optional, Anonymous)

  • Sends anonymous installation data via PostHog with:
    • Anonymized fingerprint (SHA-256 hash, cannot be reversed)
    • Application version
    • Platform information
  • No PII: No IP addresses, usernames, or business data
  • Opt-in: Set ENABLE_TELEMETRY=true and POSTHOG_API_KEY environment variables

How to Enable Analytics

# Enable Sentry error monitoring (optional)
SENTRY_DSN=https://your-sentry-dsn@sentry.io/project-id
SENTRY_TRACES_RATE=0.1  # 10% sampling for performance traces

# Enable PostHog product analytics (optional)
POSTHOG_API_KEY=your-posthog-api-key
POSTHOG_HOST=https://app.posthog.com

# Enable anonymous telemetry (optional, uses PostHog)
ENABLE_TELEMETRY=true
TELE_SALT=your-unique-salt
APP_VERSION=1.0.0

Self-Hosting Analytics

You can self-host all analytics services for complete control:

# Use docker-compose with monitoring profile
docker-compose --profile monitoring up -d

This starts:

  • Prometheus — Metrics collection and storage
  • Grafana — Visualization dashboards
  • Loki (optional) — Log aggregation
  • Promtail (optional) — Log shipping

Privacy & Data Protection

Telemetry: TimeTracker can optionally send anonymized usage data to help improve the product (errors, feature usage, install counts). All telemetry is opt-in. No personal data is collected. To disable telemetry, set ENABLE_TELEMETRY=false or simply don't set the environment variable (disabled by default).

What we DON'T collect:

  • Email addresses or usernames
  • IP addresses
  • Project names or descriptions
  • Time entry notes or client data
  • Any personally identifiable information (PII)

Your rights:

  • 📥 Access: View all collected data
  • ✏️ Rectify: Correct inaccurate data
  • 🗑️ Erase: Delete your data at any time
  • 📤 Export: Export your data in standard formats

📖 See Privacy Policy for complete details
📖 See Analytics Documentation for configuration
📖 See Events Schema for tracked events


🛣️ Roadmap

Planned Features

  • 📄 PDF Invoice Templates — Professional PDF generation
  • 📧 Email Integration — Send invoices to clients
  • 📱 Progressive Web App — Install as mobile app
  • 🔄 Recurring Invoices — Automate recurring billing
  • 🎨 Custom Themes — Personalize your interface
  • 🔌 API Extensions — RESTful API for integrations
  • 📊 Advanced Analytics — More charts and insights

Recently Added

  • Invoice Generation — Complete invoicing system
  • Task Management — Full task tracking and management
  • Command Palette — Keyboard-driven navigation
  • Calendar View — Visual time entry calendar
  • Bulk Operations — Bulk time entry creation

🤝 Contributing

We welcome contributions! Whether it's:

  • 🐛 Bug Reports — Help us identify issues
  • 💡 Feature Requests — Share your ideas
  • 📝 Documentation — Improve our docs
  • 💻 Code Contributions — Submit pull requests

📖 See Contributing Guidelines to get started


📄 License

TimeTracker is licensed under the GNU General Public License v3.0.

This means you can:

  • Use it commercially
  • Modify and adapt it
  • Distribute it
  • Use it privately

See LICENSE for full details


🆘 Support


Star Us!

If TimeTracker helps you track your time better, consider giving us a star on GitHub! It helps others discover the project.

Star on GitHub


Built with ❤️ for the time-tracking community

Description
No description provided
Readme GPL-3.0 20 MiB
Languages
Python 56.2%
HTML 34.4%
JavaScript 6.8%
Shell 1.2%
CSS 0.9%
Other 0.3%