Most time trackers want an account first. Then they sync my day to their cloud, and after a trial they want a subscription. But a record of how I spend each hour is personal data, and I did not want to send it to a server just to see a weekly chart.
So I built my own. It runs only locally. It has no login and no cloud. All the data is in one SQLite file on my machine.
What it does
- A live timer for the current task, or a manual entry after the fact. Each entry has one category, any number of tags and an optional comment.
- Your own categories and tags. You define the categories, each with its own colour, in a small TOML file or in the Settings screen. Tags need no setup: type a new one and it is created. You can rename both later.
- Today, Week and Month views. The Week header shows the calendar week, like
CW 27. - Reports can be generated for a week, a month or a quarter: time per category and per tag, a stacked hours-by-category chart, an entry-count line chart and a short written summary.
- Exports: the report can be exported as HTML, Markdown or PDF; all entries as CSV, and it’s also possible to save a copy of the raw database.
- Customizable: settings for the timezone, the first day of the week, the default entry mode and the default export format.
One file is the whole system
Local-first sounds like extra work, but here it made things simpler. The SQLite file is the database, the backup and the export at the same time. The backup endpoint uses the SQLite online backup API, so the copy is consistent even while the app writes to the file. If I want to move to a new laptop, I copy one file.
The stack is small: FastAPI and SQLite for the backend, React with Vite and TypeScript for the frontend. You start it with uv and npm, or with Docker Compose.
A day is a local thing
The hardest part of a time tracker is not the timer. It is the calendar. Timestamps are stored in UTC, but “today” depends on where you are. An entry at 01:00 in Tokyo belongs to the previous day in UTC. So every total in the app uses day boundaries from the timezone in Settings, and a regression test checks the boundary between UTC and Asia/Tokyo.
Weeks were the same story. ISO calendar weeks start on Monday, but the app lets the week start on Sunday. The week label is anchored on the Thursday of each week, so a Sunday-start week still gets the correct CW number.
A summary without an LLM
Each report has a few lines of text: the total time, the top categories and their share, the busiest day, the daily average and the top tag.
It would be easy to send the numbers to a model and ask for a paragraph. I did not. The narrative is rule-based Python over the same aggregation as the charts. It makes no network call, it costs nothing, and it never invents a number.
What I learned
- Local-first can be simpler. One SQLite file removed the need for sync, accounts and a separate backup tool.
- Time zones can be a real work. Store UTC, but compute every day, week and month in local time.
- Not every text needs a model. When the summary only restates numbers the app already computed, a few rules do the job: no API cost, no network call, and no risk that a model invents or rounds a number.
- Write the contract first. The API contract existed before the code, so the backend and the frontend could not drift apart.
More information
Project page: Time Tracker App
Code: GitHub
One Comment:
FastAPI TestClient passed, 25 of 30 requests failed – Nelson Eiró
[…] offline time tracker, a FastAPI app, had a strange problem. Now and then, a red banner said “An unexpected error […]