Skip to content

Latest commit

 

History

History
176 lines (130 loc) · 5.72 KB

File metadata and controls

176 lines (130 loc) · 5.72 KB

TimeTrack

Python Flask Pytest Black GitHub license Contributions welcome codecov 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.

🌟 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
# Note: Ensure HOLIDAY_PROVIDER is set to ARGENTINA_API for reliable holiday data
  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