{"id":19414302,"url":"https://github.com/sentinel1909/shuttle-template-yew","last_synced_at":"2025-04-24T12:31:55.470Z","repository":{"id":185651054,"uuid":"673825347","full_name":"sentinel1909/shuttle-template-yew","owner":"sentinel1909","description":"A template for a Yew app served with Axum and hosted on Shuttle","archived":false,"fork":false,"pushed_at":"2024-08-07T04:18:14.000Z","size":355,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-08T07:52:36.407Z","etag":null,"topics":["axum","shuttle","yew"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/sentinel1909.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":"2023-08-02T14:04:26.000Z","updated_at":"2024-08-07T12:31:32.000Z","dependencies_parsed_at":"2023-11-12T05:20:39.577Z","dependency_job_id":"d776d63c-6cb7-4ab0-a3de-3dce74ce244f","html_url":"https://github.com/sentinel1909/shuttle-template-yew","commit_stats":null,"previous_names":["sentinel1909/shuttle-template-yew"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentinel1909%2Fshuttle-template-yew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentinel1909%2Fshuttle-template-yew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentinel1909%2Fshuttle-template-yew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentinel1909%2Fshuttle-template-yew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sentinel1909","download_url":"https://codeload.github.com/sentinel1909/shuttle-template-yew/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223953855,"owners_count":17231151,"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":["axum","shuttle","yew"],"created_at":"2024-11-10T12:37:11.874Z","updated_at":"2024-11-10T12:37:12.509Z","avatar_url":"https://github.com/sentinel1909.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yew and Axum Starter Template (hosted with Shuttle)\n\n## Overview\n\nThis is a template that allows you to start an app with the [Yew](https://yew.rs) web framework for Rust, and host it on [Shuttle](https://shuttle.rs). It is minimalist and ready for you to add what you need. The Yew frontend web files are contained in the `/frontend` folder and are built with the [trunk](https://trunkrs.dev) deployment and packaging tool. The Yew frontend is served up from an Axum web server, contained in the `/server` folder. The Rocket server has two routes:\n\n- `/` : which serves up the Yew website\n- `/health_check` : returns an empty body and 200 OK message\n\nThis app template uses client side rendering, which is the default in Yew. In the client side rendering scheme, when the user visits a website, the server sends a skeleton HTML file without any content and a WebAssembly bundle, to the browser. Everything is then rendered client side by the WebAssembly bundle.\n\nTailwind is incorporated for styles. The trunk build tool incorporates the Tailwind CLI, so very little additional work is needed. The template provides a pre-made `tailwind.config.js` in the root of the `frontend` folder, which can serve as a starting point. Simply style your Yew components with Tailwind classes and trunk will take care of the rest.\n\n## Setup\n\nAfter cloning this repo and making it your own, you'll need to get the following basic tooling installed.\n\n- install Rust\n- install WebAssembly target\n- install Trunk\n- install the Just command runner\n\n### Install Rust\n\nHead to the official Rust installation instructions [here](https://www.rust-lang.org/tools/install).\n\n### Install WebAssembly Target\n\nFrom your command line, type:\n\n```bash\nrustup target add wasm32-unknown-unknown\n```\n\n### Install Trunk\n\nInstall the trunk build tool by typing the following in your command line:\n\n```bash\ncargo install --locked trunk\n```\n\n### Install Just\n\nInstall the Just command runner tool by typing the following in your command line:\n\n```bash\ncargo install just\n```\n\n## Usage\n\nIf you're using this template as a starter and want to get more familiar with the Yew framework, I recommend working through the tutorials on the Yew website. There are also many examples hosted in their [GitHub repo](https://github.com/yewstack/yew).\n\nThis template leverages the [Just](https://github.com/casey/just) command runner to help build the frontend for deployment. In the root directory, the configuration file for just (justfile) has the following starter recipes:\n\n`just dev` : starts a hot loading development server (with trunk)\n\n`just build-release` : uses trunk to build the frontend for deployment, default output location is /server/dist (per Trunk.toml)\n\n`just shuttle-run` : serves the built frontend via Axum using a local shuttle environment\n\n`just shuttle-deploy` : deploys the built frontend, with its Axum server, to the shuttle cloud environment for deployment\n\n## Notes\n\nPer the [discussion](https://docs.shuttle.rs/resources/shuttle-static-folder) in the Shuttle docs regarding the shuttle-static-folder resource, because this template is built as a cargo workspace, the `/dist` folder containing the built Yew frontend must live in the root of the workspace. The build artifacts are output to `/server/dist` (via the Trunk.toml configuration file located in the `/frontend` directory) by default, to support running locally with `cargo shuttle run`. The `just shuttle-deploy` recipe copies the build artifacts to `/dist` in the root of the crate workspace.\n\n## Building from Here\n\nThis template has just enough to get you going. You'll likely want to add:\n\n- yew-router (for routing between pages of your app)\n- [telemetry](https://docs.shuttle.rs/introduction/telemetry) to the server portion of the app\n- wasm-logger crate for logging from WebAssembly to the console\n- web-sys crate (bindings for all Web APIs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentinel1909%2Fshuttle-template-yew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsentinel1909%2Fshuttle-template-yew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentinel1909%2Fshuttle-template-yew/lists"}