This project is developed primarily on Windows. Detect the host OS and adapt commands accordingly:
- Windows: Use
.venv\Scripts\Activate.ps1, paths with\ - Linux: Use
source .venv/bin/activate, paths with/
When in doubt, ask the user which environment they are working on.
TimeTrack is a Flask-based web application for tracking time entry and observations.
- Data persistence with SQLAlchemy and PostgreSQL/SQLite.
- MVC architecture with Flask Blueprints.
| Tool | Purpose | Configuration |
|---|---|---|
| pip | Dependency Manager | requirements.txt, requirements-dev.txt |
| black | Code formatting | pyproject.toml (or default), 88 chars |
| isort | Import sorting | profile = "black" |
| mypy | Type checking | mypy.ini |
| pytest | Testing | pytest.ini or default |
- Python 3.10, 3.11+
# Create virtual environment
python -m venv .venv
# Activate (Windows PowerShell)
.venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt# Check formatting
black --check app tests
isort --check-only app tests
# Apply formatting
black app tests
isort app testsmypy app tests# Run all tests with coverage
pytest tests/ -v --cov=app --cov-report=term-missingTimeTrack/
├── app/ # Main application package
│ ├── __init__.py # App factory
│ ├── models/ # SQLAlchemy models
│ ├── routes/ # Flask routes/blueprints
│ ├── services/ # Business logic
│ ├── templates/ # HTML templates
│ └── static/ # CSS, JS, Images
├── tests/ # Test suite
├── migrations/ # Database migrations
├── requirements.txt # Production dependencies
├── requirements-dev.txt # Development dependencies
├── run.py # Entry point
└── README.md # Project overview
- Always run quality checks before committing:
black,isort,mypy,pytest - Use type hints for all new functions and methods
- Write tests for new functionality
- Follow Flask Best Practices: application factories, blueprints.