{"id":21921527,"url":"https://github.com/delta1/phx-live-demo","last_synced_at":"2026-03-04T15:31:39.458Z","repository":{"id":139190549,"uuid":"197384475","full_name":"delta1/phx-live-demo","owner":"delta1","description":"Phoenix LiveView dashboard demo","archived":false,"fork":false,"pushed_at":"2020-07-19T17:26:56.000Z","size":649,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T17:29:34.636Z","etag":null,"topics":["ecto","elixir","liveview","phoenix","pubsub"],"latest_commit_sha":null,"homepage":"https://github.com/phoenixframework/phoenix_live_view","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delta1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-07-17T12:24:59.000Z","updated_at":"2020-07-19T17:26:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"98359981-5049-4baf-9d85-e9cad690d17e","html_url":"https://github.com/delta1/phx-live-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/delta1/phx-live-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta1%2Fphx-live-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta1%2Fphx-live-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta1%2Fphx-live-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta1%2Fphx-live-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delta1","download_url":"https://codeload.github.com/delta1/phx-live-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delta1%2Fphx-live-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30084962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ecto","elixir","liveview","phoenix","pubsub"],"created_at":"2024-11-28T20:25:42.109Z","updated_at":"2026-03-04T15:31:39.436Z","avatar_url":"https://github.com/delta1.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiveDemo\n\n## Phoenix LiveView dashboard demo\n\n\u003e **tl;dr** LiveView dashboard that updates from changes in the database, triggered by [PubSub](https://hexdocs.pm/phoenix/1.1.0/Phoenix.PubSub.html#functions)\n\n**What is this?**\n\nA simple demo of [Phoenix LiveView](https://github.com/phoenixframework/phoenix_live_view) functionality for a \"live dashboard\". \nWhen \"items\" in the database are changed, the dashboard updates without reloading the page.\n\nBelow we have the standard [phx.gen.html](https://hexdocs.pm/phoenix/Mix.Tasks.Phx.Gen.Html.html) scaffold on the left, and a LiveView on the right.\n\nAs we create, modify or delete the items, they are updated automagically in the LiveView.\n\n\n![demo](assets/static/images/demo.gif)\n\n\n**How can I try it out?**\n\n- Clone the repo\n- Install dependencies with `mix deps.get`\n- Create and migrate your database with `mix ecto.setup`\n- Install Node.js dependencies with `cd assets \u0026\u0026 npm install`\n- Start Phoenix endpoint with `mix phx.server`\n\nVisit [`localhost:4000`](http://localhost:4000) from your browser for the live view, and [/items](http://localhost:4000/items) for the items crud scaffold.\n\n**How does it work?**\n\n- Once LiveView is setup in your project ([docs](https://github.com/phoenixframework/phoenix_live_view/blob/master/lib/phoenix_live_view.ex), [tutorial](https://elixirschool.com/blog/phoenix-live-view/#getting-started)), you can define a module to `use LiveView`, and then implement `render/1`, `mount/2`, and `handle_event/3` functions to control your live view.\n\n- In this specific example, the [`render`](lib/live_demo_web/live/live_view.ex) function just renders the simple live template. The `mount` function retrieves the items from the database and then subscribes to the PubSub topic. The 2 `handle_event` functions are used from the live view when creating or updating an item. The `handle_info` function re-fetches the database items to supply them to the live view.\n\n- When items are updated in the database using the [`Items`](lib/live_demo/items.ex) context, we call PubSub.broadcast on the same topic which notifies the live view to update.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelta1%2Fphx-live-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelta1%2Fphx-live-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelta1%2Fphx-live-demo/lists"}