ActivityWatch is built as a set of loosely coupled components communicating over a local REST API. Understanding this architecture is essential before building custom watchers or integrations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ActivityWatch/activitywatch/llms.txt
Use this file to discover all available pages before exploring further.
Components
ActivityWatch has two server implementations that share the same REST API:- aw-server (Python) — the current default, built with Flask
- aw-server-rust — a Rust implementation that is the planned future default; also provides
aw-sync
Watchers (data collectors)
Watchers are standalone processes that send heartbeat events to aw-server:| Watcher | Language | What it tracks |
|---|---|---|
| aw-watcher-window | Python | Active application and window title |
| aw-watcher-afk | Python | Keyboard/mouse activity (AFK detection) |
| aw-watcher-web | JavaScript | Active browser tab URL and title |
| awatcher | Rust | Active window on Linux Wayland |
| aw-watcher-input | Python | Detailed keyboard/mouse input metrics |
Supporting components
- aw-qt — system tray manager; launches and manages aw-server and the built-in watchers
- aw-core — shared Python library (models, config, logging, storage backends)
- aw-client — Python client library for the REST API; used by all Python watchers
- aw-webui — Vue.js frontend served by aw-server on port 5600
- aw-notify — Rust daemon that queries aw-server and sends desktop notifications
Data flow
Communication pattern
All components communicate with aw-server via its REST API onhttp://localhost:5600/api/0/. Watchers use the heartbeat endpoint to send periodic state updates. The server merges consecutive heartbeats with the same data into a single event, controlled by the pulsetime parameter.
aw-client (Python) wraps the REST API for convenience. Any language with HTTP support can interact with aw-server directly.
Repository structure
The mainactivitywatch repository is a meta-package that bundles all components as git submodules:
Data Model
Understand buckets and events — the core data structures
REST API
Explore all available API endpoints
Writing Watchers
Build your own watcher using aw-client
Contributing
Set up the development environment
