tpt-ruc-nz

Rust

Privacy-first, open-source NZ Road User Charges (RUC) tracking: shared Rust core, ESP32 GPS reference node, offline PWA and self-hostable backend. Not an NZTA Section 43 approved distance recorder.

0 stars0 forks0 watchers1 open issuesApache License 2.0

Languages

Rust50.6%TypeScript28.5%HTML16.8%JavaScript3.5%Handlebars0.3%Shell0.2%CSS0.1%
README

tpt-ruc-nz

A privacy-first, open-source toolkit for tracking and estimating New Zealand Road User Charges (RUC): a shared Rust core, an ESP32 reference GPS node, a static PWA, and a self-hostable backend.

Important: NZTA Section 43 disclaimer

tpt-ruc-nz is an open-source reference implementation for personal tracking, estimation and fleet telemetry. It is not an NZTA-approved distance recorder.

Under the NZ Road User Charges Act, claiming RUC deductions (such as off-road travel), or using a digital display in place of a physical licence label, requires an NZTA Approved Distance Recorder under Section 43. If you intend to use this system for official RUC licensing or tax deductions, you must apply for Section 43 approval through NZTA first.

Rates in this project are not authoritative until they have been verified against nzta.govt.nz. See DESIGN_SPEC.md.

Status

Early development. Phase 0 (foundations) and Phase 1 (core maths) are in progress. See todo.md for the full checklist.

ComponentPathStatus
Core: NMEA parsing, Haversine distance, coordinatescrates/tpt-ruc-coreWorking, 27 tests
RUC rate enginecrates/tpt-ruc-coreNot started (rates need verification)
WASM bindings and PWAcrates/tpt-ruc-wasm, pwa/Planned (Phase 2)
ESP32 firmwarecrates/tpt-ruc-firmwarePlanned (Phase 3)
Backendcrates/tpt-ruc-backendPlanned (Phase 4)

Repository layout

crates/tpt-ruc-core/   Pure Rust logic, no_std compatible
pwa/                   Progressive Web App (Phase 2)
hardware/              KiCad, BOM, enclosure (Phase 3 onward)
docs/                  User guides and NZTA compliance notes
DESIGN_SPEC.md         Design specification and locked decisions

Building

Requires the stable Rust toolchain (pinned in rust-toolchain.toml).

cargo test --workspace

# no_std check for microcontroller and WASM targets
cargo check -p tpt-ruc-core --no-default-features --target thumbv7em-none-eabihf

Licence

Dual licensed under MIT or Apache-2.0, at your option. Copyright (c) 2026 TPT Solutions.

Every dependency must be MIT, BSD, ISC, Zlib, Unlicense/CC0 or dual MIT/Apache-2.0. This is enforced in CI by cargo-deny (see deny.toml).

Contributing

See CONTRIBUTING.md. To report a security issue, see SECURITY.md.