- Elixir 87.6%
- Python 6.7%
- HTML 2.1%
- Dockerfile 2.1%
- Shell 1.3%
- Other 0.2%
| .github/workflows | ||
| apps | ||
| architecture | ||
| assets | ||
| config | ||
| rel | ||
| scripts | ||
| .credo.exs | ||
| .dialyzer_ignore.exs | ||
| .formatter.exs | ||
| .gitignore | ||
| .tool-versions | ||
| CHANGELOG.md | ||
| Containerfile | ||
| LICENSE | ||
| mix.exs | ||
| README.md | ||
| SECURITY.md | ||
mcl-bookclub-phoenix
The Bookclub-on-Mesh, for Elixir students: the same domain, the same contract, in Elixir with a Phoenix LiveView admin.
This is the drop-in Elixir twin of
mcl-bookclub: the same
commands, events, guards, stream ids, facts topics and procedure names —
a second club on the mesh, indistinguishable from the first except by node
identity. The contract is shared; the club is a payload parameter
(club_id and club_name in every fact), never a namespace. One topic
set serves a thousand clubs.
Separation of business logic and presentation
The spine of this repository, by design and by test: the three division
apps (host_bookclub, project_bookclub, query_bookclub) have no
Phoenix in their deps — business logic never imports presentation. The
LiveView app contains only presentation, and calls the divisions through
the same entry points the mesh uses. A view that can't reach a guard is a
view that can't violate one.
Layout
apps/host_bookclub/ CMD: commands, events, aggregates (Elixir structs)
apps/project_bookclub/ PRJ: events -> sqlite, idempotent writes + the pubsub seam
apps/query_bookclub/ QRY: pure query modules
apps/mcl_bookclub_phoenix/ the facade (the :mcl_om_service behaviour + mesh emitters)
apps/mcl_bookclub_phoenix_web/ the LiveView admin (presentation only)
Status: full domain + LiveView admin
Every desk the Erlang twin has (initiate/archive/plan_party, member
register/unregister, book procure/retire, reading start/finish, the
plan_party policy), every projection (clubs/members/books/readings), every
query desk, the three mesh emitters, the get_bookclub_by_id capability,
and the LiveView admin console -- task buttons dispatch the divisions'
entry points, lookups call the query desks, and the projection pubsub seam
feeds the live feed. CI and the image (.github/workflows/ci.yml,
Containerfile) are in place; what remains is the fleet rollout as the
second club.
Running it
mix deps.get
mix compile --warnings-as-errors
mix test
mix credo --strict
mix dialyzer
The runtime is pinned in .tool-versions (OTP 28.4.3, Elixir 1.18.4).
The admin serves on MCL_HTTP_PORT (default 4000); build its JS first
with mix esbuild mcl_bookclub_phoenix_web.
Architecture
The C4 model is in architecture/README.md, with its
diagrams drawn by architecture/c4_diagrams.py into assets/. Change the
script, run it (python3 architecture/c4_diagrams.py), and look at the result
before committing.