{"id":18552876,"url":"https://github.com/oderwat/go-nats-app","last_synced_at":"2025-04-09T22:32:04.704Z","repository":{"id":64781946,"uuid":"573247589","full_name":"oderwat/go-nats-app","owner":"oderwat","description":"A Go code only PWA as proof of concept for using (embedded) NATS as communication between front and back end.","archived":false,"fork":false,"pushed_at":"2024-06-02T11:06:02.000Z","size":4193,"stargazers_count":28,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T15:18:37.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oderwat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-12-02T02:32:50.000Z","updated_at":"2025-03-22T02:17:51.000Z","dependencies_parsed_at":"2024-05-30T13:01:36.657Z","dependency_job_id":null,"html_url":"https://github.com/oderwat/go-nats-app","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/oderwat%2Fgo-nats-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oderwat%2Fgo-nats-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oderwat%2Fgo-nats-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oderwat%2Fgo-nats-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oderwat","download_url":"https://codeload.github.com/oderwat/go-nats-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123798,"owners_count":21051535,"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":"2024-11-06T21:15:24.803Z","updated_at":"2025-04-09T22:32:04.281Z","avatar_url":"https://github.com/oderwat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go-Nats-App\n\nThis is a demo of a [Go-App](https://github.com/maxence-charriere/go-app) based PWA that uses [NATS](https://nats.io/) for the communication between frontend and backend.\n\n### How to run it?\n\nClone the repository, cd into it and run `go run mage.go run` (or `mage run` if you installed mage already).\n\nThen open http://127.0.0.1:8500 once or multiple times in your browser and chat with yourself.\n\n![preview](.gitbook/assets/readme-image.jpg)\n\n### Features of this demo\n\n* There is no java-script! Everything is Go code.\n  * Frontend \u0026 Backend uses [Go-App](https://github.com/maxence-charriere/go-app).\n  * Build tooling made with [Mage](https://magefile.org/).\n* The frontend is a PWA and can be installed on your phone or desktop. It runs in the browser as WASM code with a service-worker.\n* We are using an embedded NATS-Server in the backend to offer three services:\n  * [Govatar](https://github.com/o1egl/govatar) image (JPEG / random / female).\n  * Chat broker (3 lines of code + error handling = 10 lines).\n  * (New) Each PWA has an echo \"req\" service under the subject \"echo.\". Like \"echo.late-meadow\" in our example picture. An example command-line is shown in the site.\n* We use the original nats.go client in the frontend.\n* Go-App code is smaller when building WASM and normal code separately.\n* We compress the WASM code on the fly.\n* You can run the embedded nats-server as leaf-node of a cluster (that is what we do in another proof of concept).\n\n### What does not work?\n\n* This will not work with TLS (`wss://`) with before the next release of [Nats.go](https://github.com/nats-io/nats.go) (after 1.20.0). If you need TLS for the web socket you can use `go get https://github.com/nats-io/nats.go@main` which should work for that. The code in the demo does contain everything needed though (implementation of `SkipTLSHandshake()` on the `CustomDialer`).\n* The IPs and ports are hard-coded and as everything binds to localhost it will not work behind reverse proxies or through tunnels like [sish](https://github.com/antoniomika/sish) or ngrok.\n* A lot more. It is just a proof of concept / demo.\n* [#second-tab](page-1.md#second-tab \"mention\")\n\n### Disclaimer\n\n* We do not care what you do with the code as long as you do not bug us or destroy humanity with it :)\n* This uses the MIT License and is as it is what it is.\n* Parts of the code were quickly grabbed from other internal prototypes or written without much though. It is most likely full of bugs :)\n\n### Greetings\n\n* to the NATS Team\n* to the Go-App developer\n* all the contributors\n* and to everybody else :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foderwat%2Fgo-nats-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foderwat%2Fgo-nats-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foderwat%2Fgo-nats-app/lists"}