{"id":24671873,"url":"https://github.com/orhun/ratzilla","last_synced_at":"2025-05-14T22:07:31.899Z","repository":{"id":270629924,"uuid":"910970331","full_name":"orhun/ratzilla","owner":"orhun","description":"Build terminal-themed web applications with Rust and WebAssembly. Powered by Ratatui.","archived":false,"fork":false,"pushed_at":"2025-05-03T09:53:53.000Z","size":9044,"stargazers_count":713,"open_issues_count":25,"forks_count":25,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T07:51:32.370Z","etag":null,"topics":["ratatui","rust","trunk","tui","wasm","wasm-bindgen","web","web-framework","web-sys","webassembly"],"latest_commit_sha":null,"homepage":"http://orhun.dev/ratzilla/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orhun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null}},"created_at":"2025-01-01T23:56:29.000Z","updated_at":"2025-05-06T19:56:01.000Z","dependencies_parsed_at":"2025-01-09T11:20:05.023Z","dependency_job_id":"cfea9e74-5096-4d00-afa3-5622b1e0aa08","html_url":"https://github.com/orhun/ratzilla","commit_stats":null,"previous_names":["martinbspheroid/wasm-test","orhun/ratatui-web","orhun/ratzilla"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fratzilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fratzilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fratzilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fratzilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orhun","download_url":"https://codeload.github.com/orhun/ratzilla/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235696,"owners_count":22036963,"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":["ratatui","rust","trunk","tui","wasm","wasm-bindgen","web","web-framework","web-sys","webassembly"],"created_at":"2025-01-26T10:12:03.235Z","updated_at":"2025-05-14T22:07:26.881Z","avatar_url":"https://github.com/orhun.png","language":"Rust","readme":"\u003cp align=\"center\"\u003e\n\u003c!-- Thanks to https://github.com/dekirisu for the logo --\u003e\n\u003ca href=\"https://github.com/orhun/ratzilla\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/orhun/ratzilla/refs/heads/main/assets/ratzilla.gif\" width=\"500\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Repo](https://img.shields.io/badge/github-orhun/ratzilla-3c8cba?style=flat\u0026logo=GitHub\u0026labelColor=1D272B\u0026color=3c8cba\u0026logoColor=white)](https://github.com/orhun/ratzilla)\n[![Crate](https://img.shields.io/crates/v/ratzilla?style=flat\u0026logo=Rust\u0026labelColor=1D272B\u0026color=936c94\u0026logoColor=white)](https://crates.io/crates/ratzilla)\n[![Docs](https://img.shields.io/docsrs/ratzilla?style=flat\u0026logo=Rust\u0026labelColor=1D272B\u0026logoColor=white)](https://docs.rs/ratzilla)\n\n**Watch the conference talk:** [Bringing Terminal Aesthetics to the Web With Rust (and Vice Versa)](https://www.youtube.com/watch?v=iepbyYrF_YQ)\n\n\u003c/div\u003e\n\n# Ratzilla\n\nBuild terminal-themed web applications with Rust and WebAssembly. Powered by [Ratatui].\n\n## Quickstart\n\n### Templates\n\nInstall [`cargo-generate`](https://github.com/cargo-generate/cargo-generate):\n\n```shell\ncargo install cargo-generate\n```\n\nGenerate a new project:\n\n```shell\ncargo generate orhun/ratzilla\n```\n\nAnd then [serve the application on your browser](#serve) ➡️\n\nSee [templates](./templates) for more information.\n\n### Manual Setup\n\nAdd **Ratzilla** as a dependency in your `Cargo.toml`:\n\n```sh\ncargo add ratzilla\n```\n\nHere is a minimal example:\n\n```rust no_run\nuse std::{cell::RefCell, io, rc::Rc};\n\nuse ratzilla::ratatui::{\n    layout::Alignment,\n    style::Color,\n    widgets::{Block, Paragraph},\n    Terminal,\n};\n\nuse ratzilla::{event::KeyCode, DomBackend, WebRenderer};\n\nfn main() -\u003e io::Result\u003c()\u003e {\n    let counter = Rc::new(RefCell::new(0));\n    let backend = DomBackend::new()?;\n    let terminal = Terminal::new(backend)?;\n\n    terminal.on_key_event({\n        let counter_cloned = counter.clone();\n        move |key_event| {\n            if key_event.code == KeyCode::Char(' ') {\n                let mut counter = counter_cloned.borrow_mut();\n                *counter += 1;\n            }\n        }\n    });\n\n    terminal.draw_web(move |f| {\n        let counter = counter.borrow();\n        f.render_widget(\n            Paragraph::new(format!(\"Count: {counter}\"))\n                .alignment(Alignment::Center)\n                .block(\n                    Block::bordered()\n                        .title(\"Ratzilla\")\n                        .title_alignment(Alignment::Center)\n                        .border_style(Color::Yellow),\n                ),\n            f.area(),\n        );\n    });\n\n    Ok(())\n}\n```\n\nThen add your `index.html` which imports the JavaScript module:\n\n\u003cdetails\u003e\n  \u003csummary\u003eindex.html\u003c/summary\u003e\n  \n```html\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003cmeta\n      name=\"viewport\"\n      content=\"width=device-width, initial-scale=1.0, user-scalable=no\"\n    /\u003e\n    \u003clink\n      rel=\"stylesheet\"\n      href=\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/fira_code.min.css\"\n    /\u003e\n    \u003ctitle\u003eRatzilla\u003c/title\u003e\n    \u003cstyle\u003e\n      body {\n        margin: 0;\n        width: 100%;\n        height: 100vh;\n        display: flex;\n        flex-direction: column;\n        justify-content: center;\n        align-items: center;\n        align-content: center;\n        background-color: #121212;\n      }\n      pre {\n        font-family: \"Fira Code\", monospace;\n        font-size: 16px;\n        margin: 0px;\n      }\n    \u003c/style\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cscript type=\"module\"\u003e\n      import init from \"./pkg/ratzilla.js\";\n      init();\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\u003c/details\u003e\n\nAnd then [serve the application on your browser](#serve) ➡️\n\n## Serve\n\nInstall [trunk] to build and serve the web application.\n\n```sh\ncargo install --locked trunk\n```\n\nAdd compilation target `wasm32-unknown-unknown`:\n\n```sh\nrustup target add wasm32-unknown-unknown\n```\n\nThen serve it on your browser:\n\n```sh\ntrunk serve\n```\n\nNow go to [http://localhost:8080](http://localhost:8080) and enjoy TUIs in your browser!\n\n## Documentation\n\n- [API Documentation](https://docs.rs/ratzilla)\n- [Backends](https://docs.rs/ratzilla/latest/ratzilla/backend/index.html)\n- [Widgets](https://docs.rs/ratzilla/latest/ratzilla/widgets/index.html)\n\n## Examples\n\n- [Minimal](https://github.com/orhun/ratzilla/tree/main/examples/minimal) ([Preview](https://orhun.dev/ratzilla/minimal))\n- [Demo](https://github.com/orhun/ratzilla/tree/main/examples/demo) ([Preview](https://orhun.dev/ratzilla/demo))\n- [Pong](https://github.com/orhun/ratzilla/tree/main/examples/pong) ([Preview](https://orhun.dev/ratzilla/pong))\n- [Colors RGB](https://github.com/orhun/ratzilla/tree/main/examples/colors_rgb) ([Preview](https://orhun.dev/ratzilla/colors_rgb))\n- [Animations](https://github.com/orhun/ratzilla/tree/main/examples/animations) ([Preview](https://orhun.dev/ratzilla/animations))\n- [World Map](https://github.com/orhun/ratzilla/tree/main/examples/world_map) ([Preview](https://orhun.dev/ratzilla/world_map))\n\n## Websites built with Ratzilla\n\n- \u003chttps://orhun.dev/ratzilla\u003e - The official website of Ratzilla\n- \u003chttps://terminalcollective.org\u003e - Terminal Collective community website\n- \u003chttps://www.function-type.com/tusistor\u003e - Resistor calculator\n- \u003chttp://timbeck.me\u003e - Personal website of Tim Beck\n- \u003chttps://jetpham.com\u003e - Conway's Game of Life\n- \u003chttps://map.apt-swarm.orca.toys\u003e - Map of apt-swarm p2p locations\n\n## Acknowledgements\n\nThanks to [Webatui] projects for the inspiration and the initial implementation of the essential parts of DOM backend.\n\nSpecial thanks to [Martin Blasko] for his huge help and contributions.\n\nLastly, thanks to [Ratatui] for providing the core TUI components.\n\n[trunk]: https://trunkrs.dev\n[Ratatui]: https://ratatui.rs\n[`DomBackend`]: https://docs.rs/ratzilla/latest/ratzilla/struct.DomBackend.html\n[`CanvasBackend`]: https://docs.rs/ratzilla/latest/ratzilla/struct.CanvasBackend.html\n[`Hyperlink`]: https://docs.rs/ratzilla/latest/ratzilla/widgets/struct.Hyperlink.html\n[Webatui]: https://github.com/TylerBloom/webatui\n[Martin Blasko]: https://github.com/MartinBspheroid\n\n## Contributing\n\nPull requests are welcome!\n\nConsider submitting your ideas via [issues](https://github.com/orhun/ratzilla/issues/new) first and check out the [existing issues](https://github.com/orhun/ratzilla/issues).\n\n## License\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat\u0026logo=GitHub\u0026labelColor=1D272B\u0026color=3c8cba\u0026logoColor=white)](./LICENSE-MIT)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat\u0026logo=GitHub\u0026labelColor=1D272B\u0026color=3c8cba\u0026logoColor=white)](./LICENSE-APACHE)\n\nLicensed under either of [Apache License Version 2.0](./LICENSE-APACHE) or [The MIT License](./LICENSE-MIT) at your option.\n\n🦀 ノ( º \\_ º ノ) - respect crables!\n\n## Copyright\n\nCopyright © 2025, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com)\n","funding_links":[],"categories":["Rust","📦 Libraries","\u003ca name=\"Rust\"\u003e\u003c/a\u003eRust"],"sub_categories":["🏗️ Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fratzilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forhun%2Fratzilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fratzilla/lists"}