Skip to content

Architecture

Hour Advantage is the engine. It has no user interface. It comes in two parts on one shared platform. Each engine has a narrow job. Each reaches the world, and the other engine, only through a public contract.

This section shows how the pieces fit together. It is for anyone deciding how to integrate or replace one of them.

Clocks own protocols Hour Advantage Connect protocol packages devices and keys commands and jobs sync groups reports facts, runs commands public contract events outbox, sinks commands action API Time and Attendance store: facts, setup policies and rules pay period ledgers approvals, close decides or anything else that keeps the contract or anything else that keeps the contract Shared platform store Postgres outbox sinks, webhooks packages Luau sandbox settings environments admin API auth, audit
The engines talk only through the sink and event contract. Events leave Connect through the outbox. Commands come back through the action API. Any other system uses the same two paths. When both run in one process, the sink can hand events over directly, under the same contract. Both engines run on one platform.
PartWhat it holdsPage
Hour Advantage ConnectProtocols, kept as packages. Devices and their keys. Commands, actions and jobs. Sync groups and routes. Each tenant’s policy packages, for decisions made at the clock.Hour Advantage Connect
Hour Advantage Time and AttendanceFacts about people’s time. The setup that applies to them. Policies and their rules. The pay period ledgers worked out from all of it.Time and Attendance
Shared platformThe store. The outbox and its sinks. Packages and the Luau sandbox. Settings and environments. The admin API, authentication and the audit trail.Shared platform

Both engines and the platform run in one server program, hourd. Time and Attendance knows nothing of Connect’s internals. It receives punches the way any system does. They arrive as events delivered by a sink. The sink uses a delivery key that the tenant issued. Time and Attendance keeps its own events and delivers them to its own sinks. Its routes sit on the admin API.

Headless: facts in one place, decisions in the other

Section titled “Headless: facts in one place, decisions in the other”

Connect reports facts and carries out commands. It never makes a business decision.

Hour Advantage ConnectThe authority (Time and Attendance, or another system)
KnowsDevices, protocols, what is on each clock, what each clock was sent.People as employees, their employment, who may enroll where, their ids in other systems.
DoesReports what happened at clocks. Keeps clocks matching the state it was given. Runs commands.Decides. Then sends the state it wants and the commands to get there.
NeverDecides whether a person should exist, or what their time is worth.Talks to a clock directly.

For example, someone enrolls at a clock. They become a person of the clock’s sync group. Connect reports this as a person.enrolled event. The person stays on that clock alone, unlinked.

The authority then answers in one of two ways. It links the person, which gives them their id in its system. Or it deletes them (enrollment). There is no “approve, then reverse”, because Connect never approved anything.

Sometimes a tenant wants a decision made at the clock itself. Examples are routing a punch by its work code, setting a clock up as it joins, or linking someone by the PIN they enrolled with. The tenant writes that decision in its own policy package. The package’s hooks are the points where it gets to decide. They run at a short, fixed list of moments. Connect carries out their answers through the same person and device APIs any system uses. The decision is the tenant’s. Connect only runs it.

Time and Attendance follows the same rule from the other side. It applies no rules of its own. With no policy, fifty hours in a week are fifty hours of work. Every rule is a step that a policy chooses. A step is one of the standard steps with its settings, or a step of the tenant’s own policy package. Each layer’s eligibility rule says whom it applies to.

Every feature passes one test. Could another system replace Connect, or Time and Attendance, using only the public contract?

  • The contract out of Connect is its events. These are the event types. Sinks deliver them, or you can pull them from the admin API. Punches carry where they go and the person’s id there (routes).
  • The contract into Connect is the admin API. It covers actions, commands and jobs, the sync group registry, and people and their external ids.

Time and Attendance is one client of Connect. It receives the same punch events an outside system does. It gets them through a sink in the same program instead of a webhook. It reads them by the public event contract alone (from punch event to punch fact). Its commands go through the action API, like anyone’s.

Sometimes Time and Attendance needs something the contract lacks. Then the contract gains a general feature that any system can use. Examples are external ids, routes or posted events.

  • A punch’s path: a punch from the clock to a line of a pay period’s ledger.
  • The ledger: the fixed stages a pay period is worked out in, and where policy steps plug in.
  • Policy layers: how a policy is put together from layers, general to specific, with locks.
  • Closed periods: what a change to a period already paid becomes.