{"id":26672100,"url":"https://github.com/d-led/independent_liveview_components_experiment","last_synced_at":"2025-03-26T00:48:22.597Z","repository":{"id":278250352,"uuid":"923272493","full_name":"d-led/independent_liveview_components_experiment","owner":"d-led","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-18T19:31:06.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T20:22:37.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-led.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-27T23:35:37.000Z","updated_at":"2025-02-18T19:31:10.000Z","dependencies_parsed_at":"2025-02-18T20:22:42.137Z","dependency_job_id":"8c815b33-8a92-40d9-845b-0f361195d375","html_url":"https://github.com/d-led/independent_liveview_components_experiment","commit_stats":null,"previous_names":["d-led/independent_liveview_components_experiment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Findependent_liveview_components_experiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Findependent_liveview_components_experiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Findependent_liveview_components_experiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-led%2Findependent_liveview_components_experiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-led","download_url":"https://codeload.github.com/d-led/independent_liveview_components_experiment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245568581,"owners_count":20636803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-26T00:48:21.991Z","updated_at":"2025-03-26T00:48:22.565Z","avatar_url":"https://github.com/d-led.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Independent Phoenix LiveView Micro-UIs Experiment\n\n## Motivation\n\n- allow multiple teams to deploy parts of a LiveView independently with maximum simplicity\n- there's no settled optimum yet, ideas are welcome\n\n## Current Architecture\n\n- 3 independent nodes connected in a cluster\n- [main_app](./main_app/) acts as the front-end, serving the [main page](main_app/lib/main_app_web/live/main_live.ex)\n- [global_service](./global_service/) and [private_service](./private_service/) [push rendered partial LiveViews](private_service/lib/private_service/private_click_aggregator_service.ex) into Pub/Sub, to which the `main_app` is subscribed, rendering them as they are, within the main view.\n- the services also expose their own LiveViews for e.g. their \"admin\" purposes\n\n![3 mini UIs](./docs/img/3-mini-uis.gif)\n\n### Challenges\n\n- very chatty/wasteful:\n  - rendered partial HTML views are sent from the services, instead of the optimized configuration as known in LiveView\n- current docker compose / libcluster config creates a sporadically disconnected cluster\n- presence messages seem to not reach the services\n  - work-around: when a main LiveView is mounted, a custom `hi` message is published into the `arrivals` channel, requesting a rendered UI from the services.\n\n### Pending Ideas\n\n- 3 LiveView sockets\n  - potentially served via the same reverse proxy under different paths\n- other approaches, unifying the LiveView socket?\n- when a service goes doesn / hasn't sent updates in a while, show a `currently unavailable` message in the main view\n  - custom monitor?\n  - custom scheduled messages to `self()` in main LiveView?\n\n### Failed Approaches\n\n- trying to render the diffs only:\n  - unfortunately, this failed with the diff (?) functions not being present on the `main_app`\n\n## Start with process-compose\n\n- install [process-compose](https://f1bonacc1.github.io/process-compose/installation/)\n- `process-compose``\n- \u0026rarr; http://localhost:4000\n  - http://localhost:4001\n  - http://localhost:4002\n\n## Start with docker compose\n\n- `docker compose up` (with other options depending on the needs)\n- \u0026rarr; http://localhost:4001\n  - http://localhost:4001/services/global\n  - http://localhost:4001/services/private","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-led%2Findependent_liveview_components_experiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-led%2Findependent_liveview_components_experiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-led%2Findependent_liveview_components_experiment/lists"}