Build Toggl Track
KINDAreplaces $12/mosaves $144/yrback to the verdict
Build a private manual time tracker with editable history and clear reports.
Before step 1
Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.
- installPython is free; this local prototype requires no hosting subscription.
Why The local backend, tests and storage use Python.
Get it Install Python from python.org. Open a terminal in a new empty project folder. On Windows, use py -3 where this guide says python if python is not on PATH; on macOS/Linux use python3 if needed. Create .venv and activate it before installing packages. open ↗
Verify
python --version reports 3.12+ and python -c "import sqlite3" succeeds. - installNo paid service required for this local step.
Why You need to view the local interface and edit generated project files.
Get it Use an installed Chrome, Firefox or Edge browser. Open the empty project folder in your editor; open the terminal there, not in this catalog repository.
Verify
You can create a text file in the project folder and open browser developer tools. - have readyNo paid service required for this local step.
Why This fixture makes the first end-to-end check reproducible.
Get it Create synthetic sample data before implementation: Two one-hour entries on separate projects and one running timer crossing local midnight. Save it under fixtures/ with the expected results in fixtures/README.md; use no real credentials or customer records.
Verify
The fixture files and expected outcomes exist and can be inspected without a vendor account. - decideNo paid service required for this local step.
Why The full commercial product is larger than this guide.
Get it The deliverable is a private manual time tracker with editable history and clear reports. Read every exclusion below. Indie mode runs locally; any public or shared use requires the product access and deployment gates first.
Verify
You can name the primary workflow and the vendor features this version deliberately leaves out.
Data model
Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.
- projects(id,name,client) - tags(id,name) - entries(id,project_id,description,start_utc,end_utc,revision) - entry_tags(entry_id,tag_id) - edits(id,entry_id,before_json,after_json,reason,at) - Use stable ids and explicit relationships; add auxiliary tables named by the phases before those phases use them. - Acceptance fixture: Two one-hour entries on separate projects and one running timer crossing local midnight.
Environment variables
These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.
| Variable | Needed | Example | Where the value comes from |
|---|---|---|---|
DATA_DIR | required | ./data/toggl-track | A new private folder this application creates on first run; never serve it as static files. |
SECRET_KEYsecret | required | replace-with-a-random-secret | Generate with python -c "import secrets; print(secrets.token_hex(32))" and save only in .env. |
APP_MODE | required | indie | Use indie for loopback-only personal work. Product mode must refuse to start until owner login and the deployment gates are configured. |
SITE_URL | required | http://127.0.0.1:5000 | The origin used for local forms and links; replace with the chosen HTTPS origin in product mode. |
The build, in order
Local foundation and data contract
Create the runnable local foundation for a private manual time tracker with editable history and clear reports, including the real schema and acceptance fixture.
Run the venv command first, then stop and activate it before running the remaining commands. Use your OS instructions: Windows .venv\Scripts\activate.bat in cmd, or .venv\Scripts\Activate.ps1 in PowerShell; macOS/Linux source .venv/bin/activate. Then install the listed packages. Create app.py exposing app, load .env with python-dotenv, and add a /healthz route. Freeze tested dependency versions to requirements.txt. Create .env manually from .env.example; replace SECRET_KEY before launch.
Files
app.pyrequirements.txt.env.example.gitignoreterminalpython -m venv .venv python -m pip install Flask Flask-WTF python-dotenv waitress tzdata python -m pip freeze > requirements.txt python -m flask --app app run --host 127.0.0.1
For database-backed state create schema.sql and db.py using this model: projects(id,name,client); tags(id,name); entries(id,project_id,description,start_utc,end_utc,revision); entry_tags(entry_id,tag_id); edits(id,entry_id,before_json,after_json,reason,at). Add the auxiliary relationships explicitly used in later phases; use stable ids, foreign keys, parameterized values and transactions. For canonical files use atomic replacement and hashes instead. Implement python manage.py init and python manage.py seed to create only synthetic data: Two one-hour entries on separate projects and one running timer crossing local midnight. Re-running init must not erase data.
Files
schema.sqldb.pymanage.pyfixtures/README.mdterminalpython manage.py init python manage.py seed
Install Flask-WTF CSRF protection for forms and same-origin fetches, validate Host and Origin against SITE_URL, bound inputs and escape output. Deliberately public intake endpoints get bounded validation and rate limits; signed provider webhooks use signature checks instead of browser CSRF tokens. All other admin routes stay local until product authentication exists. When a later phase tests viewer/member permissions, implement the users, hashed passwords, expiring server sessions and role checks in this foundation first; product mode must never use a fabricated identity from request input. Add error, empty, keyboard-focus and retry states now.
Files
app.pytemplates/base.htmltest/test_foundation.py
done when · tick each as it passeswatch out- The Flask development server is for local development only. Loopback binding alone does not replace CSRF and origin validation.
One running timer
One running timer for Toggl Track: Implement start/stop and a database constraint or transaction guard allowing at most one open entry.
Implement start/stop and a database constraint or transaction guard allowing at most one open entry.
Files
features/one_running_timer.pytemplates/one_running_timer.htmlPersist start instants in UTC and calculate elapsed display from the clock; provide a manual-entry form.
Files
features/one_running_timer.pyUse Two one-hour entries on separate projects and one running timer crossing local midnight. Check: Two simultaneous Start requests leave one running entry. Then check: Reloading the page preserves the elapsed timer. Add a focused regression for the failure case under test/ using a temporary database or folder and fake external services; also perform the visible workflow in a browser.
Files
test/test_one_running_timer.pyterminalpython -m unittest discover -s test
done when · tick each as it passeswatch out- The browser tick is a display refresh, not a trustworthy duration counter.
Corrections and boundaries
Corrections and boundaries for Toggl Track: Allow edits with a reason and before/after history; reject negative durations and flag overlaps for explicit review.
Allow edits with a reason and before/after history; reject negative durations and flag overlaps for explicit review.
Files
features/corrections_and_boundaries.pytemplates/corrections_and_boundaries.htmlSplit report allocations at local day boundaries using a selected IANA timezone while preserving the original UTC entry.
Files
features/corrections_and_boundaries.pyUse Two one-hour entries on separate projects and one running timer crossing local midnight. Check: The midnight-spanning entry contributes the correct seconds to each local day. Then check: Editing end before start fails without changing history. Add a focused regression for the failure case under test/ using a temporary database or folder and fake external services; also perform the visible workflow in a browser.
Files
test/test_corrections_and_boundaries.pyterminalpython -m unittest discover -s test
done when · tick each as it passeswatch out- Do not silently delete overlap time; users may intentionally record parallel work.
Project reports
Project reports for Toggl Track: Sum integer seconds by project, client and tag with clear date/timezone filters; avoid double-counting in the overall total.
Sum integer seconds by project, client and tag with clear date/timezone filters; avoid double-counting in the overall total.
Files
features/project_reports.pytemplates/project_reports.htmlExport CSV of raw entries plus JSON edit history and document that rounding occurs only in display.
Files
features/project_reports.pyUse Two one-hour entries on separate projects and one running timer crossing local midnight. Check: Two one-hour entries total exactly 7200 seconds. Then check: An entry with two tags is counted once in the all-project total. Add a focused regression for the failure case under test/ using a temporary database or folder and fake external services; also perform the visible workflow in a browser.
Files
test/test_project_reports.pyterminalpython -m unittest discover -s test
done when · tick each as it passeswatch out- Leave employee surveillance, payroll calculations and automatic invoicing out of this manual tracker.
Portable delivery and clean-start proof
Finish the Toggl Track replacement with a documented first-run path and a recoverable export.
Document prerequisites, every configuration variable, data locations and the three domain workflows: One running timer; Corrections and boundaries; Project reports. Include the exclusions, actual costs and source check date 2026-09-05. Commands shown earlier that reference project files are files the builder must implement before running them.
Files
README.md.env.exampleUse sqlite3.Connection.backup for the database in DATA_DIR and pause writers while taking the matching attachment snapshot. Keep schema version, hashes and a manifest for toggl-track. Restore into a separate empty directory or isolated deployment, with all outbound actions and schedules disabled. Recreate this proof: Two one-hour entries on separate projects and one running timer crossing local midnight. Compare ids/counts and open the result before recording the restore date. Never test a restore over the only live copy.
Files
OPERATIONS.mdscripts/backup.pyUse a new folder and only README instructions to reach the fixture outcome. Install from requirements.txt, initialize storage, run the tests and exercise the UI at 375px and 1280px; use keyboard-only controls and inspect browser errors. Record exactly what passed; do not mark unrun checks complete.
Files
README.mdverification.mdterminalpython -m pip install -r requirements.txt python -m unittest discover -s test
done when · tick each as it passeswatch out- Export without an import or restore rehearsal is not verified portability.
Operate and share with access controlsproduct builder
Product-builder only: make a private manual time tracker with editable history and clear reports operable for its stated audience before allowing remote access.
Add owner/member/viewer authorization as appropriate, password hashes through Werkzeug, expiring server-side sessions, CSRF and login rate limits. Add users, sessions and audit schema migrations plus an owner-init command prompting securely for its password. Enforce ownership on every private read/write/download and fail closed when product setup is incomplete. Existing learner or admin identities must use this same boundary.
Files
ARCHITECTURE.mdOPERATIONS.mdServe app:app with Waitress on loopback behind Caddy HTTPS. Configure trusted proxy headers narrowly, Secure/HttpOnly/SameSite cookies, upload limits, request ids and structured logs without private content. Run background jobs as a separate supervised process when the domain workflow requires them.
Files
CaddyfileOPERATIONS.mdterminalwaitress-serve --listen=127.0.0.1:5000 app:app
Add a scheduled encrypted off-host backup using this procedure: Use sqlite3.Connection.backup for the database in DATA_DIR and pause writers while taking the matching attachment snapshot. Keep schema version, hashes and a manifest for toggl-track. Monitor health, disk space, failed jobs and backup age. Stop the service to test an alert; rehearse recovery with outbound effects disabled and record recovery time. Rotate any exposed credentials and require reconciliation before resuming queues.
Files
OPERATIONS.mdrelease-checklist.md
done when · tick each as it passeswatch out- Product mode is additional engineering, not a switch that makes a local prototype production-ready.
That is the whole plan for Toggl Track. What it deliberately does not cover is below · check the gaps before you call it a replacement.
- The browser tick is a display refresh, not a trustworthy duration counter.
- This is a private manual time tracker with editable history and clear reports; full Toggl Track feature parity, vendor hosting and support are not included.
- cross-platform apps, background tracking, integrations, team controls, and sync
- cross-device history
- team timesheets and payroll
- behavioral datasets
- blocking across every platform
- Extend project reports only after the fixture and recovery checks pass.
- Before adding another integration, document its credentials, limits, cost and failure behavior with primary-source links.
Need the files? The project pack on the verdict page hands your agent the whole brief · more time tracking.