Implement OweMe v1 #2

Merged
reudy merged 8 commits from feat/v1-app into main 2026-10-09 22:28:31 +02:00
Member

Implements the full v1 spec (all five milestones): core logic, server, web client, push notifications and the podman compose deployment.

This branch contains PR #1's spec commits. Merging this PR merges the spec too, so #1 can be closed; or merge #1 first and this diff shrinks to the implementation only.

What's in it

  • packages/core: event schema and validation, integer and BigInt money math (largest-remainder splits, round-half-even conversion), replay with rewind snapshots, greedy settle-up, recurring occurrences, stats, CSV export.
  • apps/server: Node 24 standard library only, with zero npm dependencies. Encrypted event log (SQLite), live updates over Server-Sent Events, encrypted photo storage, daily ECB rates, Web Push (VAPID + RFC 8291 implemented with node:crypto) restricted to known push services, strict CSP. Unknown groups and wrong tokens both return 404.
  • apps/web: Svelte 5 PWA, about 65 KB gzipped. Groups via a #secret link, remembered on the device along with "who am I". Offline outbox; equal, shares, exact and percent splits; multiple payers; currencies with editable rates; photos resized and stripped of EXIF before encryption; comments; per-expense history and whole-group rewind with undo; stats; recurring expenses; CSV and backup export; EN/CS chosen from the browser language; dark and light money-green theme; service worker that decrypts pushes on the device.
  • deploy/: Containerfile, compose.yaml (app + Caddy with automatic HTTPS), .env.example (DOMAIN, limits, ports), README with VPS steps.

Changes from the spec (SPEC.md updated)

  • Node instead of Bun: Node was already on the box, and node:sqlite plus type stripping meant no new runtime and no server dependencies.
  • Svelte + Vite instead of SvelteKit; no Workbox and no chart library.
  • revert targets an event id, not a seq, so restored backups keep working.
  • Backup files include the group secret (otherwise they couldn't recover a lost link); the UI warns about this.
  • The "only notify about expenses involving me" option was dropped, because browsers require every push to show a notification.

Verification

  • npm test: 25 core and 11 server tests pass, including decrypting a push payload as a browser would.
  • npm run check: tsc and svelte-check report 0 errors and 0 warnings.
  • npm run test:e2e: 2/2 pass. They cover two devices (English and Czech) sharing a group, identity, ECB rate prefill, exact split, photo upload and viewing on the other device, live sync, balances and settle-up, rewind and undo, offline edits syncing later, the home screen and stats, and a push delivered to the service worker producing the decrypted notification "Flat | Petr: Pizza · €12.50".
  • The compose stack was run locally (DOMAIN=localhost, loopback ports), and the e2e suite passed against it through Caddy over HTTPS. The full ECB history loaded (7,111 days).
  • Not verified: a real push service (FCM, Apple) delivering to a phone, and Let's Encrypt issuance on a public domain. Both need the VPS.

🤖 Generated with Claude Code

https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF

Implements the full v1 spec (all five milestones): core logic, server, web client, push notifications and the podman compose deployment. **This branch contains PR #1's spec commits.** Merging this PR merges the spec too, so #1 can be closed; or merge #1 first and this diff shrinks to the implementation only. ## What's in it - **`packages/core`**: event schema and validation, integer and BigInt money math (largest-remainder splits, round-half-even conversion), replay with rewind snapshots, greedy settle-up, recurring occurrences, stats, CSV export. - **`apps/server`**: Node 24 **standard library only**, with zero npm dependencies. Encrypted event log (SQLite), live updates over Server-Sent Events, encrypted photo storage, daily ECB rates, Web Push (VAPID + RFC 8291 implemented with `node:crypto`) restricted to known push services, strict CSP. Unknown groups and wrong tokens both return 404. - **`apps/web`**: Svelte 5 PWA, about 65 KB gzipped. Groups via a `#secret` link, remembered on the device along with "who am I". Offline outbox; equal, shares, exact and percent splits; multiple payers; currencies with editable rates; photos resized and stripped of EXIF before encryption; comments; per-expense history and whole-group rewind with undo; stats; recurring expenses; CSV and backup export; EN/CS chosen from the browser language; dark and light money-green theme; service worker that decrypts pushes on the device. - **`deploy/`**: Containerfile, `compose.yaml` (app + Caddy with automatic HTTPS), `.env.example` (`DOMAIN`, limits, ports), README with VPS steps. ## Changes from the spec (SPEC.md updated) - Node instead of Bun: Node was already on the box, and `node:sqlite` plus type stripping meant no new runtime and no server dependencies. - Svelte + Vite instead of SvelteKit; no Workbox and no chart library. - `revert` targets an event id, not a seq, so restored backups keep working. - Backup files include the group secret (otherwise they couldn't recover a lost link); the UI warns about this. - The "only notify about expenses involving me" option was dropped, because browsers require every push to show a notification. ## Verification - `npm test`: 25 core and 11 server tests pass, including decrypting a push payload as a browser would. - `npm run check`: tsc and svelte-check report 0 errors and 0 warnings. - `npm run test:e2e`: 2/2 pass. They cover two devices (English and Czech) sharing a group, identity, ECB rate prefill, exact split, photo upload and viewing on the other device, live sync, balances and settle-up, rewind and undo, offline edits syncing later, the home screen and stats, and a push delivered to the service worker producing the decrypted notification "Flat | Petr: Pizza · €12.50". - The compose stack was run locally (`DOMAIN=localhost`, loopback ports), and the e2e suite passed against it through Caddy over HTTPS. The full ECB history loaded (7,111 days). - Not verified: a real push service (FCM, Apple) delivering to a phone, and Let's Encrypt issuance on a public domain. Both need the VPS. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
agent added 8 commits 2026-10-09 21:59:35 +02:00
Covers access model (key-in-fragment links), encrypted event log,
deterministic money math, currencies, photos, history/rewind,
i18n, theming, server API, threat model and podman compose deploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
Deterministic integer/BigInt arithmetic so every client computes identical
balances; replay validates events and supports rewind via snapshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
Node 24 standard library only (node:http, node:sqlite, node:crypto).
Push uses VAPID + RFC 8291 encryption with an allowlist of push services.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
Re-uploading existing events (retries, backup restore) is idempotent and
must not eat into MAX_GROUP_BYTES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
Mobile-first PWA: groups via key-in-fragment links, encrypted outbox and
sync over SSE, all split modes, currencies with ECB rate prefill, photos,
comments, history and rewind, stats, recurring expenses, CSV and backup,
EN/CS, dark/light theme, Web Push decrypted in the service worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
Two devices (EN + CS) sharing a group through sync, photos, rates, rewind,
offline and settle-up; plus push delivery to the service worker via CDP.
Can target a running deployment with E2E_BASE_URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
Containerfile + compose (app + Caddy with automatic HTTPS), env-driven
domain/limits/ports, VAPID key generation that never prints the key.
SPEC updated to match the implementation (Node stdlib server, Svelte SPA,
revert by event id, backup contents, push options).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
reudy merged commit 41b3487a5a into main 2026-10-09 22:28:31 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: reudy-net/oweme#2
No description provided.