Reference example web app: end-to-end expense log (umbrella) #22
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/support#22
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reference example web app: end-to-end expense log
Why
iw-supportexposes many ideas (security wiring, i18n + message catalogue, Tapir endpoints, HTMX/Vite/WebAwesome integration, ReBAC authorization, forms, codecs, scenarios, e2e testing) but downstream projects have to piece them together from guides and prior projects. We need one canonical, runnable, tested reference application that exercises these pieces together so we can:This issue is the umbrella spec for that reference app. Implementation will be split into follow-up issues/PRs.
Scope: shared expense log
A small multi-user expense tracker. Chosen because it naturally exercises i18n (currency, dates, decimal/thousands separators), authorization (group membership, ownership, admin override), forms + validation (amount, date, category), and dynamic UI (filters, inline edit, pagination) without being contrived.
Functional outline
Module coverage (what we're exercising)
The example must end up using each of the following, with a short note in the docs about why each is wired in:
core— base types, error handling, ZIO layerscodecs— JSON codecs for the API surfaceentity— domain entities (Group, Expense, Membership)forms— expense form, validation, error renderingtapir(jvm + shared) — endpoint definitions, OpenAPIserver/http— HTTP server bootstrap, routes, error mappingui(incl.scenariosUI) — WebAwesome components, HTMX wiring, Vite buildscenarios— at least one component scenario for a non-trivial UI piece (e.g. expense form)autocomplete— category/tag/payer autocompleteAuthorization.require/check/filterAllowedfor the permission model abovee2e-testing— Playwright scenarios for the golden pathsOut of initial scope (call out explicitly so we don't drift):
sqldb/sqldb-postgresql/sqldb-mysql— in-memory persistence only for now; sqldb integration is a planned follow-up.mongo,akka-persistence,paygate,hashicorp,email,files,project-management,service-specs— out of scope for v1.Identity provider
Use
navikt/mock-oauth2-serveras the OIDC provider for dev and e2e. Single small container, supports OIDC discovery, issues signed JWTs for any user, no DB, scriptable from tests.docker compose upbrings the mock IdP alongside the appPac4j is configured with the OIDC client; the example documents the standard configuration we want downstream projects to copy.
Deliverable structure (proposed)
New top-level module group under
examples/:Mill build wiring follows the pattern of existing modules. The example is not published.
Acceptance criteria
Startup & security
docker compose upfor the mock IdP.Authorization
Authorization.require/check/filterAllowed.filterAllowedso non-members don't see other groups' data.Internationalization
HTMX / Vite / WebAwesome
HTTP_SERVER_GUIDE.md.Forms & codecs
formswith server-side validation and field-level error rendering.codecsJSON.Scenarios
scenariosexercising the expense form (or another non-trivial component) in isolation.Tapir / OpenAPI
e2e tests
Documentation
examples/expense-log/README.mdexplains how to run dev, run tests, and what each piece demonstrates.HTTP_SERVER_GUIDE.md,AUTHORIZATION_GUIDE.md, message catalogue docs) gain a "see the expense-log example" cross-reference where relevant.Suggested implementation order (follow-up issues)
Helloendpoint.Each step should land as a small PR that keeps the example runnable.
Out of scope (explicit)