{"id":20655694,"url":"https://github.com/remast/go_buffalo_turbo","last_synced_at":"2025-10-24T22:13:00.311Z","repository":{"id":145093729,"uuid":"326503616","full_name":"remast/go_buffalo_turbo","owner":"remast","description":"Simple example for using Buffalo with Turbo powers to develop modern, user-friendly web applications.","archived":false,"fork":false,"pushed_at":"2024-01-28T11:53:09.000Z","size":378,"stargazers_count":8,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-01T12:15:27.419Z","etag":null,"topics":["go","golang","hotwire","ssr","turbo","webdev"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/remast.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}},"created_at":"2021-01-03T21:25:28.000Z","updated_at":"2023-08-15T14:53:29.000Z","dependencies_parsed_at":"2023-11-26T16:27:57.030Z","dependency_job_id":"5427d4e9-7963-4a74-8760-1ff2fb217cb2","html_url":"https://github.com/remast/go_buffalo_turbo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fgo_buffalo_turbo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fgo_buffalo_turbo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fgo_buffalo_turbo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remast%2Fgo_buffalo_turbo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remast","download_url":"https://codeload.github.com/remast/go_buffalo_turbo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224951662,"owners_count":17397425,"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":["go","golang","hotwire","ssr","turbo","webdev"],"created_at":"2024-11-16T18:12:20.116Z","updated_at":"2025-10-24T22:12:55.270Z","avatar_url":"https://github.com/remast.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Buffalo with Turbo Powers\n\nModern, user-friendly web applications powered by Server Rendered HTML? This example shows how to build a modern, user-friendly web application based on HTML and the [hotwire](https://hotwire.dev/) approach. We will develop a server rendered web application in [Go]() with [Buffalo](http://gobuffalo.io) enhanced by the [Turbo]() that powers [Basecamps](https://basecamp.com/) mail service [Hey](http://hey.com/).\n\n## Running the Example\nRun the example\n\n\t$ buffalo dev\n\nNow point your browser to [http://127.0.0.1:3000](http://127.0.0.1:3000).\n\nYou'll see the app with a list of TODOs and a feed of todos on the right:\n![alt text](images/todo_overview.jpg \"TODO App Overview\")\n\n### Using the Example without Turbo\nYou can also try the example without Turbo and without any JavaScript at all. To use the example without Turbo just set the cookie `skipTurbo` to `true`.\n\n## Setting up Turbo\nTurbo is set up by including the Turbo JavaScript in the HTML header. In Buffalo the header is rendered by the layout template `application.plush.html`.\n\nAdd the Turbo JavaScript to [application.plush.html](templates/application.plush.html):\n```html\n\u003chead\u003e\n\t\u003cscript src=\"https://unpkg.com/@hotwired/turbo@7.0.1/dist/turbo.es5-umd.js\"\u003e\u003c/script\u003e\n\t...\n\u003c/head\u003e\n```\n\n## Turbo Frame with Lazy Loading\nThe home pages shows a feed of todos of other users as a feed on the right. This feed is loaded lazily as [Turbo Frame](https://turbo.hotwire.dev/reference/frames)\n\nExample for Turbo Frame in [todo/index.plush.html](templates/todo/index.plush.html):\n```html\n\u003cturbo-frame class=\"col-4\" id=\"feed-frame\" src=\"/feed\"\u003e\n    \u003cdiv class=\"alert alert-light\" role=\"alert\"\u003e\n        Loading feed ...\n    \u003c/div\u003e\n\u003c/turbo-frame\u003e\n```\n\n## Form handling with Turbo Streams\n\nTurbo Streams allow the server to send just fragments of HTML over the wire and only replace these fragements on the client. The example uses Turbo Streams to create new todos.\n\n\nThe submitted form returns a Turbo Stream if possible, see [todo.go](actions/todo.go):\n```go\nif acceptsTurboStream(c.Request()) {\n\t// Handle Turbo requests\n\tturboAction := \"replace\"\n\tturboDomID := \"todo_new_form\"\n\treturn c.Render(http.StatusOK, r.Func(\"text/vnd.turbo-stream.html\", createTurboWriter(\"todo/new.plush.html\", turboAction, turboDomID)))\n}\n// Handle normal requests\nreturn c.Render(http.StatusOK, r.HTML(\"todo/new.plush.html\"))\n```\n## What Next?\n\nCheck out how to use Turbo Streams over WebSockets in my example [github.com/remast/go_websocket_turbo](https://github.com/remast/go_websocket_turbo)\n\nA must is the full hotwire demo implemented in Go [github.com/while1malloc0/hotwire-go-example](https://github.com/while1malloc0/hotwire-go-example).\n\n## Thanks to\n\nhttps://github.com/luchsamapparat/ssr-to-csr","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremast%2Fgo_buffalo_turbo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremast%2Fgo_buffalo_turbo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremast%2Fgo_buffalo_turbo/lists"}