Quick reference for running the project locally, running tests, and contributing. For a single-page contributor overview (workflows, adding routes/services/templates), see Contributor Guide. For full guidelines, see Contributing and the developer documentation.
-
Clone the repo and enter the directory:
git clone https://github.com/drytrix/TimeTracker.git cd TimeTracker -
Create and activate a virtual environment:
python -m venv venv # Windows: venv\Scripts\activate # Linux/macOS: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Copy the environment template and set required variables:
cp env.example .env
Edit
.env: setSECRET_KEY(e.g. frompython -c "import secrets; print(secrets.token_hex(32))"). For a local DB, you can use SQLite (see Local Testing with SQLite). -
Initialize the database and run the app:
flask db upgrade flask run
By default the app is at http://127.0.0.1:5000.
For a quick run without installing Python locally:
docker-compose -f docker/docker-compose.local-test.yml up --buildThen open http://localhost:8080. See Local Testing with SQLite for details.
- Copy
env.exampleto.envand adjust values. - Key variables:
SECRET_KEY,DATABASE_URL(or leave default for SQLite),TZ,CURRENCY. - Full list and descriptions: Docker Compose Setup and
env.example.
- Python: 3.11+
- Package list:
requirements.txt - Package install for tests:
setup.pyis used so the app can be installed as a package (e.g.pip install -e .) for testing; core dependencies remain inrequirements.txt.
TimeTracker/
βββ app/ # Flask app: routes, models, services, templates, utils
βββ desktop/ # Electron-style desktop app
βββ mobile/ # Flutter mobile app
βββ docker/ # Docker config and scripts
βββ tests/ # Pytest tests
βββ docs/ # Documentation
βββ app.py # Application entry point
βββ env.example # Environment template
βββ requirements.txt # Python dependencies
For more detail, see ARCHITECTURE.md and Project Structure.
- Follow the Contributing guidelines: PEP 8, Black (line length 88), type hints and docstrings where appropriate.
- Use blueprints for routes; keep business logic in services.
- Create a branch for your change.
- Run tests locally:
pytest(orpytest --cov=appfor coverage). - Lint/format: follow Contributing (e.g. Black, flake8).
- For user-facing changes, add an entry under Unreleased in CHANGELOG.md.
# All tests
pytest
# With coverage
pytest --cov=app
# Single file
pytest tests/test_timer.py
# Single test class or test
pytest tests/test_routes/test_api_v1_projects_refactored.py -vSee Contributing β Testing for more options and conventions.
- Web app: Run
npm install && npm run build:dockeronce to produceapp/static/dist/(Tailwind CSS + hashed JS bundles) andapp/static/vendor/(self-hosted third-party libraries). Both are gitignored build output, and the UI will be unstyled and non-interactive without them. Then run the app withflask runorpython app.py. See FRONTEND.md. - Docker image:
docker build -t timetracker .from repo root. See Docker Compose Setup. - Mobile/Desktop: See Build Guide and mobile-desktop-apps/README.md for Flutter and Electron build steps.
- Read CONTRIBUTING.md.
- Follow the full Contributing guidelines (branching, PR process, changelog).
- For user-facing changes, add an entry under Unreleased in CHANGELOG.md.
How versions and releases are managed is documented in Version Management. The application version is defined in setup.py as the single source of truth.