Community financial records, transaction accountability, and merchandise stock for AWS User Group organizers.
PocketTrail is an English-only, organization-scoped web application built as one full-stack SvelteKit app in TypeScript on Cloudflare Workers, D1, and private R2 storage. Server rendering, form actions, and server-only modules keep authorization and financial rules out of the browser. The interface follows Cloudscape-informed operating patterns; it is not an official AWS service or a React Cloudscape implementation.
Current release boundary: local development and validation. Nothing in this repository authorizes deployment, real notification delivery, or publication of community financial data. See validation evidence for the checks actually performed and remaining limitations.
Prerequisites: Node.js 22 or later (developed against 22.20) and npm. Nothing else is required — there is no Rust toolchain, no Wasm build step, and no separate frontend.
npm ci
cp .dev.vars.example .dev.vars # then set SECRET_SESSION_KEY (32+ chars)
npm run db:migrate:local # applies migrations/*.sql to local D1
npm run db:seed:local # synthetic fixtures only
npm run dev # http://127.0.0.1:5173npm run db:seed:local is only for a fresh local database. It does not erase
or reset an existing database. Do not rerun it after importing real records.
Synthetic fixtures are separate from deployment migrations.
Fixture sign-in is offered only when LOCAL_DEV=true, a signing key exists, and
the request uses a loopback hostname.
- Alice: administrator of the synthetic Jakarta organization.
- Bob: Jakarta approver and administrator of the separate synthetic Indonesia organization.
- Admin: platform administrator with no initial organization memberships.
Use Alice and Bob to test independent approval. A platform administrator is not automatically allowed to read every organization's finances.
Google Sign-in requires an OAuth client whose authorized JavaScript origins include the local URL in use. Locating a client ID does not prove that origin is registered. Fixture login tests the local workflow without a live Google login.
- Choose an organization and pocket.
- Select a Jago PDF. Browser-local PDF.js extracts its text; no statement goes to an external document-processing or AI service.
- Review the import before confirming it.
- Match full Jago references within the pocket. Repeated cumulative exports must not replace existing explanations, assignments, evidence, discussions, or approval. Conflicting bank facts require review.
- Assign responsibility through explicit actor mappings or transaction details.
- Supply a purpose and evidence, with multiple allocations when one transfer covers several purposes.
- Discuss the transaction and request independent approval.
Bank facts remain separate from the spender's explanation. Responsible members, including historical responsible members retained after reassignment, cannot approve their own transactions. Substantive edits invalidate approval; discussion does not.
Merchandise inventory records an item, optional variant, quantity by location or holder, and an attributed change history. It is not an equipment-lending system. Inventory Maintainers can edit names/variants and archive or restore items and locations without access to financial records. Archiving requires zero stock; records and movement history are retained.
Existing accounts receive membership directly from People → Add person.
New emails receive an invitation, accepted using the matching Google account.
With EMAIL_DELIVERY_ENABLED=true, invitation creation and Resend use the
existing SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD, and
SMTP_FROM Worker settings. Port 465 uses implicit TLS; other supported ports
require STARTTLS. Workers blocks port 25. Keep local email delivery disabled.
Store SMTP credentials as Worker secrets, never in Git or build logs. Failed delivery retains the invitation and records a safe error for Resend. A successful SMTP response means the server accepted the email, not guaranteed inbox delivery. Existing pending invitations need Resend after deploying this transport. Transaction reminders remain outbox-only; enabling invitation SMTP does not automatically send them.
- Organization notifications start off.
- Local work captures notification intentions in an outbox; it does not send email to organizers.
- Mentions do not override organization disablement or transaction suppression.
- A transaction's suppression excludes every notification and summary concerning it; suppression does not mean evidence exists or approval was granted.
- Historical reminders use a chosen transaction-date cutoff, and enabling notifications requires previewing recipients for that cutoff first.
- Departed members retain attribution but lose organization access and stop receiving notifications.
Connecting the existing email server and scheduled delivery is a separate integration gate, not something the local outbox proves.
npm run check # svelte-check: generated types + TypeScript
npm run test:unit # pure server rules, parser, money, permissions
npm run test:extraction # browser extraction helper (plain Node)
npm run test:e2e # builds the Worker, migrates + seeds local D1, HTTP checks
npm run test:journeys # inventory, transactions, imports, settings, races
npm run test:ui # rendered desktop/mobile/accessibility checks (Chrome)
printf 'n\n' | CI=1 npx wrangler deploy --dry-run --outdir /tmp/pt-drytest:e2e, test:journeys, and test:ui are not mocks: they rebuild the local
D1 database from migrations/, seed tests/fixtures/seed.sql, build the Worker
with @sveltejs/adapter-cloudflare, run it under wrangler dev on loopback, and
drive it over HTTP and a real browser. The UI check uses a system Chrome
(/usr/bin/google-chrome by default, override with CHROME_PATH).
For local private statement samples, scripts/validate-browser-extraction.cjs
drives the shipped browser extraction path against Jago*.pdf files and writes
only ignored local-data/browser-statements text. It reports counts, never names,
IDs, notes, or balances. Install npx playwright install chromium if no Chrome
is available, or point POCKETTRAIL_CHROMIUM at one.
src/
app.css app.html app.d.ts hooks.server.ts
lib/ shared browser-safe helpers (money, fmt, domain types)
lib/server/ server-only: session, permissions, D1/R2 access, parser,
financial rules, audit, notifications
lib/components/ shared page chrome
routes/ pages, form actions, endpoints
static/ browser assets: vendored PDF.js, extraction helper
migrations/ the existing SQL schema and history (unchanged)
tests/ unit tests (vitest) and synthetic fixtures
e2e/ runtime harness, journeys, rendered-UI checks
docs/ decisions, deployment notes, validation evidence
#lib/server/* is server-only: SvelteKit refuses to bundle it into the browser,
so signing keys and permission logic cannot reach a client module. There is no
client-side copy of permission authority; hiding a control is never the gate.
- Root
Jago*.pdfsamples,.dev.vars,.env, local database/R2 state, extracted records, and browser captures are Git-ignored. - Static assets are served from
static/, not the project root. - Real statements and invoices must never be committed to the public repository.
- Use synthetic workspaces for screenshots. Create a separate organization before working with real community records.
wrangler.tomlpoints at configured Cloudflare resources;--remotecommands can affect live data and require explicit authorization.- Cloudflare Workers Builds should use
npm run deployas its production deploy command to apply pending D1 migrations before deploying the Worker. See deployment setup. - Free-tier allowances are not a promise of permanently free operation.