<script>
import { Link, page } from "@inertiajs/svelte";
import Icon from "../components/Icon.svelte";
const authed = $derived(!!$page.props.auth?.user);
const features = [
{ icon: "bolt", title: "Axum", text: "Fast, ergonomic routing and middleware on the Tokio stack, wired up for you." },
{ icon: "layers", title: "Inertia", text: "Build pages in Svelte, skip the API layer. Props flow straight from your controllers." },
{ icon: "db", title: "SeaORM", text: "Typed models and migrations on SQLite, Postgres or MySQL. Change one line to switch." },
{ icon: "key", title: "Pluggable sessions", text: "Memory, database or cookie-backed sessions behind one small interface." },
{ icon: "shield", title: "CSRF and account safety", text: "CSRF protection, hashed passwords, email verification and password resets out of the box." },
{ icon: "book", title: "OpenAPI docs", text: "Generated with utoipa and served at /docs.", href: "/docs", more: "Open /docs" },
{ icon: "queue", title: "Queues", text: "Push work to background jobs and keep requests quick." },
{ icon: "mail", title: "Mail", text: "Write mailables as plain Rust and send them from a job or a handler." },
];
</script>
<svelte:head><title>Ryuk, the Rust framework that devours boilerplate</title></svelte:head>
<section class="hero">
<div class="wrap">
<span class="pill"><i></i>Rust, Axum, Inertia, Svelte</span>
<h1>The Rust framework that <em>devours</em> boilerplate.</h1>
<p class="lede">Ryuk gives you auth, a database, sessions, queues and mail on day one, so you can spend your time on the part that is yours.</p>
<div class="cta">
{#if authed}
<Link href="/dashboard" class="btn btn-primary btn-lg">Go to dashboard <Icon name="arrow" /></Link>
<Link href="/posts" class="btn btn-lg">View posts</Link>
{:else}
<Link href="/register" class="btn btn-primary btn-lg">Register <Icon name="arrow" /></Link>
<Link href="/login" class="btn btn-lg">Log in</Link>
{/if}
</div>
<div class="term" role="img" aria-label="Terminal: ryuk new blog, then ryuk serve">
<div class="term-bar"><i></i><i></i><i></i><span>~/code</span></div>
<pre aria-hidden="true"><span class="p">$</span> ryuk new blog && ryuk serve
<span class="c"> Created blog</span>
<span class="c"> vite ready in 214 ms</span>
<span class="c"> ryuk listening on</span> <span class="g">http://127.0.0.1:3000</span></pre>
</div>
</div>
</section>
<section class="section">
<div class="wrap">
<div class="section-head">
<span class="eyebrow">What you get</span>
<h2>Everything a real app needs, already connected.</h2>
<p>No glue code to write and nothing to hunt down. It is all in your project, in plain Rust and Svelte you can read and change.</p>
</div>
<div class="grid">
{#each features as f (f.title)}
{#if f.href}
<a class="feature" href={f.href}>
<div class="ico"><Icon name={f.icon} /></div>
<h3>{f.title}</h3>
<p>{f.text}</p>
<span class="more">{f.more} <Icon name="arrow" class="inline" /></span>
</a>
{:else}
<div class="feature">
<div class="ico"><Icon name={f.icon} /></div>
<h3>{f.title}</h3>
<p>{f.text}</p>
</div>
{/if}
{/each}
</div>
<div class="band">
<h2>Edit <code>client/src/pages/Welcome.svelte</code> and make it yours.</h2>
<p>This page is just the starting point.</p>
</div>
</div>
</section>
<style>
:global(.feature .more svg) { width: 1em; height: 1em; vertical-align: -.125em; }
</style>