Skip to content

Switch queries to model-bound approach and restructure frontends to match Studio - #568

Merged
einari merged 4 commits into
mainfrom
feat/model-bound-queries-and-frontend-restructure
Jun 7, 2026
Merged

Switch queries to model-bound approach and restructure frontends to match Studio#568
einari merged 4 commits into
mainfrom
feat/model-bound-queries-and-frontend-restructure

Conversation

@einari

@einari einari commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Changed

  • Queries for authors, books, and member profiles now use model-bound static ObserveAll() methods on [ReadModel] records (injecting IMongoCollection<T> and calling .Observe()) instead of separate ASP.NET controller classes.
  • Frontend entry files (App.tsx, index.tsx, index.html, index.css) moved into .frontend/ so Vite's root matches the Studio project layout.
  • Aspire upgraded to 13.4.2; all service host ports are now pinned (Chronicle Workbench → 8080, gRPC → 35000, Keycloak → 8090/8091, AuthProxy → 7000/7001).
  • MongoDB Chronicle profile now spins up a dedicated container (the latest-development image no longer bundles MongoDB).

einari and others added 4 commits June 7, 2026 11:15
- Bump Aspire packages to 13.4.2 (AppHost.Sdk, Hosting.*)
- Switch Composition.csproj to use Aspire.AppHost.Sdk project SDK
- Pin Chronicle Workbench to host port 8080, gRPC to 35000
- Pin Keycloak (Lending) to 8090, Keycloak (Members) to 8091
- Pin AuthProxy instances to 7000 and 7001
- Spin up a dedicated MongoDB container for the default Chronicle profile
  (the latest-development image no longer bundles MongoDB)
- Fix database resource names to use "chronicle-db" to avoid naming conflicts
- Add SharpCompress and Snappier as explicit package references required by
  the updated Aspire AppHost SDK

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…serve()

All three read models (Author, Book, MemberProfile) previously exposed
queries via ASP.NET controller classes. This replaces them with static
ObserveAll() methods directly on the [ReadModel] records, injecting
IMongoCollection<T> and calling .Observe() for real-time push semantics.

- Add [ReadModel] attribute and ObserveAll static method to Author, Book,
  and MemberProfile
- Remove BookQueries, AuthorQueries, and MemberProfileQueries controllers
- Add explicit Cratis.Chronicle package reference to Lending and Members
  so CPM applies version 15.33.3 (required for IMongoCollection.Observe())
- Remove stale unused usings from Adding.cs
- Regenerate TypeScript proxies: AllAuthors/AllMembers/GetAll removed,
  ObserveAll added with route /api/.../observe-all

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…entions

Move App.tsx, index.tsx, index.html, and index.css from the project root
into .frontend/ so that Vite's root points to .frontend/ itself, matching
the layout used by all Studio frontend modules.

- Fix .frontend/tsconfig.json extends path: ../../ → ../../../ so the
  base config (jsx, noEmit, strict, etc.) is correctly inherited
- Fix .frontend/vite.config.ts root: '../' → './' and vitest setupFiles
  path to correctly resolve Samples/.frontend/vitest.setup.ts
- Simplify root tsconfig.json to just extend .frontend/tsconfig.json
- Add @cratis/components ^1.10.2 dependency to both packages so subpath
  imports (@cratis/components/Toolbar, /CommandDialog, etc.) resolve
- Fix ToolbarButton tooltip → title prop to match current API
- Fix AddBook.tsx: update AllAuthors import to ObserveAll proxy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add a full Aspire service URL table covering all pinned host ports
- Add note explaining why the backend root returns 404 in dev mode
- Fix markdownlint false positives (line length, bare URLs)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@einari
einari merged commit e0a9745 into main Jun 7, 2026
1 of 2 checks passed
@einari
einari deleted the feat/model-bound-queries-and-frontend-restructure branch June 7, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant