Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

topcoat

topcoat: A modular, batteries-included Rust framework for building full-stack apps.

What problem it solves

Building full-stack web applications in Rust often requires coordinating server rendering, client reactivity, routing, assets, and reusable UI components. Topcoat aims to simplify and streamline that work by combining these capabilities in a unified framework.

Key features

  • Server rendering with client reactivity — Components render asynchronously on the server and can access application services directly. Reactive expressions are evaluated during the initial render and translated to JavaScript for browser-side updates without requiring a WebAssembly bundle or client build step.

    Source: README

  • HTML-oriented Rust templates — The `view!` macro combines familiar HTML structure with Rust expressions, control flow, and component calls. A formatting command can format `view!` snippets and other macros across a codebase.

    Source: README

  • Module-based routing — Topcoat can infer an application's route tree from its module structure without a build step, while also supporting manually defined pages, layouts, and API routes.

    Source: README

  • Editable UI components — Topcoat UI provides a component library based on Tailwind and inspired by shadcn/ui. Its CLI copies components into the application so their design and functionality can be changed directly.

    Source: README

  • Integrated assets and Tailwind — The asset bundler discovers assets declared in Rust, places them in a local asset directory, and serves them with browser caching. An optional Tailwind feature integrates stylesheet generation into the asset pipeline.

    Source: README

Quick start

Copied verbatim from the project's README.

use topcoat::{
    Result,
    context::Cx,
    router::{module_router, page},
    view::{View, component, view},
};

#[tokio::main]
async fn main() {
    topcoat::start(module_router!().build()).await.unwrap();
}

#[page]
async fn home(cx: &Cx) -> Result<impl View> {
    Ok(view! {
        <!DOCTYPE html>
        <html>
            <body>
                hello(name: "World")
            </body>
        </html>
    })
}

#[component]
async fn hello(cx: &Cx, name: &str) -> Result<impl View> {
    Ok(view! { <h1>"Hello, " (name) "!"</h1> })
}

Who it may suit

This may suit Rust developers who want to build server-rendered full-stack applications with integrated routing, reactivity, assets, and UI components. It may also suit teams seeking a TypeScript-free application stack, although the project is early-stage and experimental.

Topics to discuss

  • Which server-rendering and client-reactivity workflows should Topcoat prioritize as the framework develops?

  • How should module-based routing and manual routing coexist as applications grow more complex?

  • Which integrations and application capabilities should be added to the roadmap next?


Written by ReadmeX AI from the project's README, source and public GitHub data; it may contain mistakes.

Read the original README https://github.com/tokio-rs/topcoat#readme

ReadmeX opened this community for a trending project; it is not run by the project. Maintainers can claim it from the community page.

github.comhttps://github.com/tokio-rs/topcoat

Comments

…