Initial commit: Basic Yew frontend template

- Set up Cargo.toml with Yew dependencies
- Created main.rs entry point
- Added basic App component with counter functionality
- Included HTML template with styling
- Added Trunk.toml for build configuration
- Added .gitignore to exclude build artifacts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-08-28 14:36:34 -04:00
commit a507ab07be
6 changed files with 106 additions and 0 deletions

24
src/app.rs Normal file
View File

@@ -0,0 +1,24 @@
use yew::prelude::*;
#[function_component]
pub fn App() -> Html {
let counter = use_state(|| 0);
let onclick = {
let counter = counter.clone();
move |_| {
let value = *counter + 1;
counter.set(value);
}
};
html! {
<div>
<h1>{ "Hello Yew!" }</h1>
<p>{ "This is a basic Yew application template." }</p>
<div>
<button {onclick}>{ "Click me!" }</button>
<p>{ format!("Counter: {}", *counter) }</p>
</div>
</div>
}
}

8
src/main.rs Normal file
View File

@@ -0,0 +1,8 @@
use yew::prelude::*;
mod app;
use app::App;
fn main() {
yew::Renderer::<App>::new().render();
}