OverviewThis WebsiteHome LabTrading BotEcosimProcedural Generation
Projects

This Website

A full-stack Rust application with server-side rendering, WASM hydration, and a view-source mode built in from the start.


Architecture

Full-stack Rust

The site is built with Leptos 0.6, a fine-grained reactive framework for Rust. Axum handles HTTP on the server via leptos_axum, which renders each route to HTML on request. The same component tree is then shipped as a WASM bundle that hydrates the page on the client, enabling SPA-style navigation without a full reload.

Server functions (like the contact-form email sender) are declared with #[server] and compiled only into the server binary — the client sees a typed async function that makes an HTTP POST behind the scenes.


Feature

View Source Mode

Every page exposes a ?source=1 query parameter. When active, the router renders the raw Rust source of the current page instead of the page itself — embedded at compile time via include_str!(). No round-trips, no GitHub links, just the code that generated what you were just looking at.


Build

cargo-leptos

cargo-leptos orchestrates the dual compilation: an SSR server binary (native target) and a WASM client bundle, built in parallel. The release profile uses opt-level = "z" and LTO to minimise binary size.

cargo leptos build --release

CI / CD

Pipeline

The project is hosted on a local Gitea instance. The project is simple, so the infrastructure is too — on push to master, the pipeline:

  1. systemd timer monitors the gitea repository for new commits on the production branch
  2. Builds the new commits with cargo leptos build --release
  3. Triggers a redeploy on the server

Styling

Pure CSS

No CSS framework. A single style.css file using custom properties for the colour palette (dark background, warm-gold accent), IBM Plex Sans & Mono for body and code, and Playfair Display for headings. Animations are CSS keyframes only.