Skip to content
Docs

Command palette

Jump to a page or search the docs.

Changelog

AutoFolio on the template

The repository's architectural decision, rationale and consequences.

Markdown

Status: accepted · Date: 2026-10-22 · Related: ADR-0003, ADR-0009, ADR-0011, ADR-0013

The product handoff in handoff/ (read-only) was written for an empty monorepo: apps/api, packages/domain, packages/db, packages/tokens, packages/i18n, and its own users/households/memberships tables. This repository already has authentication, tenancy with row-level security, oRPC, Effect at the edges, R2 uploads, a cron queue, i18n and an Expo app. We build AutoFolio on it instead of beside it.

Decision

The handoff wins on product, design and business rules. This repository's AGENTS.md and ADRs win on structure. The mapping:

HandoffHere
apps/api (Hono or oRPC)packages/api/src/features/<feature>/, served by the apps/web Worker over oRPC. Endpoints in PRD §ARD become procedures with the same meaning.
users (locale, currency, units, region, plan)Better Auth user plus an account_preference row per user (locale, main currency, distance and volume unit, data region, reminder channels). Plan comes from billing entitlements; no entitlement means Free (a deployment with no billing provider enforces no Free limit).
households, membershipsThe Better Auth Organization is the household (ADR-0003). Every AutoFolio table carries organization_id and is isolated by RLS (ADR-0009). Per-vehicle roles for the family garage (v1.2) are a vehicle_member table.
★ append-only tablesRLS grants without UPDATE/DELETE for app_tenant, plus a trigger that rejects UPDATE/DELETE for every role. Corrections are new rows with a reason.
packages/domainpackages/domain, a client-safe package with no imports beyond itself: reference/domain ported as is, tests run by vitest.
packages/tokenspackages/tokens, generated from handoff/design/tokens.json into a React Native theme and CSS variables.
packages/i18nProduct strings from handoff/i18n/*.json become the mobile locales pt-BR, en, de (i18next, flat keys) and the web dictionaries. The template's fr locale is dropped: AutoFolio ships three languages.
apps/web (TanStack Start)apps/web: D-Site replaces the template landing, plus D-Privacidade and the buyer passport /p/:token.
Postgres queueThe existing one-minute cron tick and leased jobs (ADR-0005, ADR-0006).
CINot used for now. Every check runs locally (typecheck, lint, tests, Maestro, agent-browser).

The template's todo example feature is removed once the garage replaces it as the home of the app.

Consequences

  • Isolation, auth, uploads and jobs are reused, so AutoFolio work is product work.
  • Data region per account (ADR-07 of the handoff) is stored now and enforced later; there is one database until the EU launch needs more.
  • The handoff's testIDs, deep link autofolio://dev/<board> and Maestro flows are kept as they are. The Maestro APP_ID is io.zietec.autofolio.
Edit on GitHubDocumentation is in English.

We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience. Read our Cookie Policy and Privacy Policy.