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

Repository files navigation

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 Dashboard

🌟 Features

  • πŸ“… Flexible Time Entry - Record multiple clock in/out entries per day
  • πŸ–οΈ 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
  1. Run the application:
flask run
  1. Access the application at http://localhost:5000

πŸ“– Usage

Manual Time Entry

  1. Navigate to "Manual Entry" to record your work hours
  2. Select a date and whether it's a regular work day or absence
  3. For work days, enter your clock-in and clock-out times
  4. You can add multiple time entries per day (e.g., for lunch breaks)

Time Summary

View a monthly summary of your work hours, including:

  • Required hours based on working days
  • Actual hours worked
  • Balance (overtime or deficit)
  • Daily breakdown with detailed information

Time Logs

Access a chronological log of all your time entries, including:

  • Regular work days with specific times
  • Absences and holidays
  • Daily totals

πŸ“ Project Structure

TimeTrack/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ config/        # Configuration settings
β”‚   β”œβ”€β”€ db/            # Database management
β”‚   β”œβ”€β”€ models/        # Data models
β”‚   β”œβ”€β”€ routes/        # Route handlers
β”‚   β”œβ”€β”€ 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
β”œβ”€β”€ app.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

Security policy

Stars

Watchers

Forks