{"id":20458530,"url":"https://github.com/tvziet/simple_hotwire","last_synced_at":"2026-04-21T19:32:19.078Z","repository":{"id":170943227,"uuid":"647221099","full_name":"tvziet/simple_hotwire","owner":"tvziet","description":"Learn Hotwire by building the simplest possible Hotwire and Ruby on Rails","archived":false,"fork":false,"pushed_at":"2023-05-30T10:58:46.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T10:49:47.497Z","etag":null,"topics":["beginer","hotwire","rails"],"latest_commit_sha":null,"homepage":"https://github.com/tvziet/simple_hotwire","language":"Ruby","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/tvziet.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":"2023-05-30T10:10:58.000Z","updated_at":"2023-05-30T10:12:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4d58f1b-bc1f-4a88-9d22-7efdfadac374","html_url":"https://github.com/tvziet/simple_hotwire","commit_stats":null,"previous_names":["tvziet/simple_hotwire"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tvziet/simple_hotwire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvziet%2Fsimple_hotwire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvziet%2Fsimple_hotwire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvziet%2Fsimple_hotwire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvziet%2Fsimple_hotwire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tvziet","download_url":"https://codeload.github.com/tvziet/simple_hotwire/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvziet%2Fsimple_hotwire/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32106633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["beginer","hotwire","rails"],"created_at":"2024-11-15T12:12:54.474Z","updated_at":"2026-04-21T19:32:19.065Z","avatar_url":"https://github.com/tvziet.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learn Hotwire by building the simplest possible Hotwire and Ruby on Rails - For beginners\n\n## What new in Rails 7?\n\nRails 7 already comes with lots of things alrady setup for us. It means that now, most of the hard work is alrady done for us:\n- Redis is alrady setup and running in our Procfile, and Rails knows how to start using it without us needing to config anything.\n- ActionCable is alrady configured in **config/cable.yml**, and will connect to our Redis instance automatically (as long as we are using the default Redis config).\n- Stimulus, which handles the frontend side of things, is already setup and running in **app/javascript/controllers**.\n- Turbo, which let's use create **turbo_streams** and **turbo_frames**, is also already setup and ready for use to use. \n\n## Description\n1. What is `Hotwire`?\n    \u003e Hotwire is a (relatively) new part of Ruby on Rails that allows your Rails frontend to **update live and realtime** - in many cases, **totally replacing frontend framework** like React or Vue.\n\n- Under the hood, Hotwire uses Action cable to send message to the frontend (called **broadcasts**).\n- With a couple of `broadcast_to` lines in models, and a few `turbo_stream_from` helpers in views, we can build live UIs without any sort of Javascript framework. Just pure Rails and ERB.\n\n2. More\n- `Hotwire` requires `redis` to be running, and a `Procfile` makes it really easy to get it running.\n- `Procfile` makes a few things to run in parallel.\n\n3. How to add a broadcast to model?\n- Example:\n    ```ruby\n    class Post \u003c ApplicationRecord\n        broadcasts_to -\u003e (post) { :posts }\n    end\n    ```\n- Explain: With this setup, we telling our model to create a `broadcast` whenever it gets either `created`, `updated`, `deleted`. We also specify a specific stream we want it to broadcast to, called `:posts`.\n- References: [broadcastable](https://github.com/hotwired/turbo-rails/blob/main/app/models/concerns/turbo/broadcastable.rb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvziet%2Fsimple_hotwire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftvziet%2Fsimple_hotwire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvziet%2Fsimple_hotwire/lists"}