Cutting out the API layer and client build steps for Rust web apps
While the server fetches data and renders HTML, small interactions like button clicks respond instantly in the browser. There is no need to set up a separate API server or build a JavaScript bundle separately; logic written in Rust runs naturally on both the server and the client. Topcoat is a Rust framework for this kind of full-stack web application development.
Reactivity connecting server and client
Components are written as async functions and can send queries directly to the database. This reduces the overhead of a separate API layer required in traditional web development. The $(...) expression is type-checked Rust code that is evaluated on the server during initial rendering and converted to JavaScript in the browser for immediate execution. You can implement an interactive UI without a wasm bundle or a client build step. When a server update is needed, using #[shard] causes only that component to be re-rendered on the server, replacing the HTML.
Routing and templates following the module structure
The route tree is automatically inferred from the app's module structure and works without a separate build step. The view! macro allows you to write templates by naturally combining HTML with Rust control flow. You can use familiar Rust syntax like for loops and if condition statements directly within templates. The topcoat fmt command automatically tidies up the macro formatting across the entire codebase.
Modifiable UI components and asset management
Topcoat UI is a component library inspired by Tailwind and shadcn/ui. Using the topcoat ui command copies components into your project, allowing you to freely modify their design and functionality. The asset bundler scans for asset! calls in the compiled binary to copy files to a local directory or download them. This enables efficient asset serving by making full use of browser caching. Web font and icon integration, as well as Tailwind CSS support, are also built in.
Characteristics of an early-stage project
This project is in an early stage and has an experimental nature, so breaking changes may occur. Static export, more reactivity features, OpenAPI endpoints, authentication, and background jobs are planned features on the roadmap that have not yet been implemented. Deployment documentation, image optimization, and markdown support are also explicitly noted as planned for future addition. Before adopting it, you should fully consider this unfinished state and the possibility of changes.