Skip to content

Simple time tracking application for managing work hours, leaves and holidays. Built with Flask and PostgreSQL. Features manual time entry, schedule analysis, and automatic holiday updates for Argentina.

License

Notifications You must be signed in to change notification settings

PPeitsch/TimeTrack

TimeTrack

Python Flask Pytest Black GitHub license Contributions welcome Code coverage PRs Welcome

TimeTrack is a simple yet powerful time tracking application designed for managing work hours, leaves, and holidays. Built with Flask and compatible with PostgreSQL or SQLite, it provides a user-friendly interface for tracking your time and analyzing your work patterns.

TimeTrack Calendar View

🌟 Features

  • πŸ—“οΈ Interactive Calendar Log - Manage your schedule with a drag-and-drop monthly calendar view
  • πŸ“… Flexible Time Entry - Record multiple clock in/out entries per day
  • βš™οΈ Customizable Absence Codes - Create, edit, and delete your own absence types
  • πŸ–οΈ Absence Management - Track leaves, holidays and other time off
  • πŸ“Š Time Analytics - View daily, weekly and monthly work summaries
  • πŸ“ˆ Automatic Calculations - Track work hour balances and overtime
  • πŸ‡¦πŸ‡· Argentina Holidays Integration - Automatic holiday tracking for Argentina
  • πŸ“± Responsive Design - Works on desktop and mobile devices
  • πŸ”Œ Flexible Database Support - Works with SQLite or PostgreSQL
  • πŸ§ͺ Well-tested Code - Comprehensive test suite ensures reliability

πŸš€ Quick Start

Prerequisites

  • Python 3.9+
  • pip (Python package installer)
  • PostgreSQL (optional, SQLite works out of the box)

Installation

  1. Clone the repository:
git clone https://github.com/PPeitsch/TimeTrack.git
cd TimeTrack
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate  # Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your preferred settings
  1. Initialize the database:
python init_db.py

Note: This script is interactive and may prompt you to import data, such as public holidays.

  1. Run the application:
flask run
  1. Access the application at http://localhost:5000

πŸ“– Usage

The application is organized into several key sections accessible from the main navigation bar.

Calendar Log

This is the main interface for managing your schedule.

  • View an entire month at a glance with color-coded day types.
  • Click and drag to select one or more days to change their type (e.g., assign a week of vacation).
  • Quickly override weekends or holidays to log work on non-standard days.

Manual Entry

For detailed time logging on a specific day:

  • Select a date and specify whether it's a workday or an absence.
  • For workdays, enter multiple clock-in and clock-out times to account for breaks.

Summary

Get a detailed overview of your logged time for any given month:

  • See a summary of required hours, completed hours, and the resulting balance.
  • View a day-by-day breakdown of hours worked versus required hours.

Settings

Customize the application to fit your needs:

  • Manage absence codes by adding, editing, or deleting types (e.g., "Vacation", "Sick Leave").

πŸ“ Project Structure

TimeTrack/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ config/        # Configuration settings
β”‚   β”œβ”€β”€ db/            # Database management
β”‚   β”œβ”€β”€ models/        # Data models
β”‚   β”œβ”€β”€ routes/        # Route handlers (Blueprints)
β”‚   β”œβ”€β”€ services/      # Business logic (e.g., holiday providers)
β”‚   β”œβ”€β”€ static/        # Static assets (JS, CSS)
β”‚   β”œβ”€β”€ templates/     # HTML templates
β”‚   └── utils/         # Utility functions
β”œβ”€β”€ scripts/           # Helper scripts
β”œβ”€β”€ tests/             # Test suite
β”œβ”€β”€ .env               # Environment configuration
β”œβ”€β”€ .env.example       # Example environment configuration
β”œβ”€β”€ run.py             # Application entry point
β”œβ”€β”€ init_db.py         # Database initialization script
└── requirements.txt   # Python dependencies

πŸ§ͺ Development

Setting Up Development Environment

  1. Install development dependencies:
pip install -r requirements-dev.txt
  1. Set up pre-commit hooks:
pre-commit install

Running Tests

pytest tests/

Code Formatting

We use Black and isort for code formatting:

# Format code with Black
python -m black .

# Sort imports with isort
python -m isort --profile black .

# Run both with our helper script
python scripts/run-formatters.ps1  # Windows
./scripts/run-formatters.sh  # Linux/Mac

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an Issue.

Please read our Contributing Guidelines and follow our Code of Conduct.

πŸ“„ License

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

✨ Acknowledgements

About

Simple time tracking application for managing work hours, leaves and holidays. Built with Flask and PostgreSQL. Features manual time entry, schedule analysis, and automatic holiday updates for Argentina.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •