Repository navigation
0016 guest accounts
Status: accepted · Implementation: planned · Date: 2026-11-18
From LibreLifts ADRs 0025 and 0033. Decided again for LibreBars on 2026-11-18: the guest account is made before the backup notice is answered, as in LibreLifts. Rate limits are kept in the API's memory, which is only right while there is one instance of it. As built, 2026-11-18: an install gets its guest account in the background, keeps its session, and is limited to ten requests an hour per address; seen against a local API in Chromium, where three launches made one account, and on the iOS simulator, where the session survived a relaunch. The privacy policy, the retention period and deletion do not exist, and the app only talks to an API on the developer machine until they do, so this stays planned.
The server holds a copy of each person's log (0014). The question is who gets one. Requiring a sign-up before the app is useful is what LibreBars sets out not to do. Offering backup only after a sign-up leaves everyone else with a log that is lost with the phone.
A guest has no email, no password and nothing else that identifies it: only a session whose key the device holds. That raises three things. The app may first be opened with no connection. A session that runs out takes the account with it. And anyone can ask for a guest account, as often as they like.
- Every install becomes a guest account by itself, without asking for anything. A guest is an ordinary account row with a mark that says it is a guest.
- Signing up is never required. When sign-up exists, it turns the guest into a full account and keeps its data.
- The app never waits for an account. It works at once from its own database. It asks for a guest account in the background the first time it has a connection, and keeps trying, at growing intervals, until it has one. "No account yet" is a normal state, not an error, and no screen shows it as a failure.
- The account is asked for as soon as there is a connection, before the backup notice is answered and whether or not backup is on (0020). Only the person's data waits for the notice. A guest account whose owner declined backup holds nothing.
- The device keeps the session in its secure storage. In the browser build it is a cookie.
- A guest's session lasts a year and is renewed whenever the app is opened.
- A session that is lost cannot be recovered. The device starts again as a new guest. Its own database is untouched, and its data reaches the new account at the next sync.
- Asking for guest accounts is limited per address.
- Before any real person's data is stored, the project has a privacy policy, a period after which an abandoned guest's data is deleted, and a way to delete one's data on request.
- The first launch works with no connection, and nothing in the app handles a missing account as an error.
- Until sign-up exists, a guest's data on the server can only be reached from the install that made it. A lost phone still loses the log.
- A guest account tied to a device is personal data under data-protection law, even with no name or email, and one is made for a person who then declines backup.
- An account request whose answer is lost leaves an account nobody holds the key to. The job that removes abandoned guests clears it; that job does not exist yet.
- A guest who does not open the app for more than a year loses the server's copy.
- Signing in to an existing account from a device that has guest data needs a rule for joining the two. It is decided with sign-up.
Generated from docs/ on dev. Edit the docs there; changes made on the wiki are overwritten.
- Development
- Workflow
-
Decisions
- 0001 Decisions are recorded
- 0002 Apache License 2.0
- 0003 Changes land on dev by fast-forward; main is the last release
- 0004 Conventional Commits, Keep a Changelog and Semantic Versioning
- 0005 docs/ is for developers and is mirrored to the wiki
- 0006 LibreBars is a free workout log for calisthenics
- 0007 The tracker is an iOS and Android app; its web build stays until the store release
- 0008 LibreBars is an app and a crowd-sourced open database
- 0009 The database is ODbL, media is CC BY-SA, and neither can be closed later
- 0010 A hosted API with a free tier is the paid product
- 0011 The workspace is app, web and api, with engine, ui, data and contracts
- 0012 The engine is small pure functions, in the style of date-fns
- 0013 Web and app share a Tailwind theme, not components
- 0014 Postgres is the source of truth for all data
- 0015 The API is Fastify, and it owns LibreBars accounts
- 0016 Every install is a guest account, made in the background
- 0017 Accounts use Better Auth
- 0018 The on-device database is SQLite with Drizzle, on every platform
- 0019 Sync is our own push and pull
- 0020 The app says it backs up, and backup can be turned off
- 0021 Postgres 18, run with Docker Compose and tested on two databases
- 0022 expo-sqlite is patched so the web build reuses one buffer
- 0023 Seed data is TypeScript modules in packages/data, with permanent ids
- 0024 The first tables
- 0025 One TanStack Start app is the website, on GitHub Pages
- 0026 The catalog reaches the app as a snapshot plus updates, and the website through the API
- 0027 The app's first components are its own