A Nix template for full-stack web apps in Rust using Leptos

Overview

leptos-fullstack

A Nix template for full-stack web apps in Rust using Leptos. Tech used:

Running locally

Enter the Nix shell, and run:

just watch

Building

nix build

You can also nix run the app directly.

Using as flake-parts module

Import ./nix/flake-module.nix from this repos as a flake-parts module.

In future, we might create a standalone flake-parts module for Leptos.

Notes

Single-crate model

This repo uses the single-crate model primarily because the backend-common-frontend split (prior to PR #5; similar to start-axum-workspace template) is not suitable when using server functions in leptos. Consequently, expect a bunch of cfg attributes or macros that make backend-only code conditional upon the ssr flag (which is set when compiling the crate for backend, as opposed to wasm frontend, which uses csr)

Credits

The Rust code is largely based on start-axum. Also, credit goes to @benwis for pointers to how crane can be made to work with cargo-leptos.

You might also like...
A simple solution for scoped styles in Leptos

Styled: Easy Styling for Leptos Components If you're looking for an easy way to apply scoped styles to your Leptos components, Styled is the Leptos ma

A formatter for the leptos view! macro

leptosfmt A formatter for the leptos view! macro All notable changes are documented in: CHANGELOG.md Install cargo install leptosfmt or for trying out

A zero-config leptos component to display markdown
A zero-config leptos component to display markdown

A port of yew-markdown using leptos ! Usage You can use this component to render both static and dynamic markdown. Static markdown use leptos::*; {

Leptos server signals synced through Server-Sent-Events (SSE)

Leptos Server Sent Events Server signals are leptos signals kept in sync with the server through server-sent-events (SSE). The signals are read-only o

Leptos integration with Golden Layout.

Leptos Golden Layout Leptos integration with Golden Layout. This has many features missing but covers the basics for integrating leptos with golden la

A UI component library for Leptos, based on Tailwind Elements.

leptos-twelements A UI component library for Leptos, based on Tailwind Elements. Installation (for projects using cargo leptos) Use the nightly rust c

A binary that bootstraps a Leptos application with client side rendering, tailwind, and vercel

create-leptos-csr-tw This CLI provides a quick setup to start building web applications using the Leptos web framework integrated with TailwindCSS. It

💫 List-rendering component utilizing FLIP position transitions for Leptos
💫 List-rendering component utilizing FLIP position transitions for Leptos

AnimatedFor / component for Leptos FLIP animations for element and component groups inspired by Vue's TransitionGroup. This crate exports a compon

A fully extensible command interface to navigate around your leptos application.

leptos-kbar A fully extensible command interface to navigate around your leptos application. See demo: https://leptos-kbar.vercel.app/ Roadmap leptos-

Comments
  • Add 404 handler view

    Add 404 handler view

    https://github.com/leptos-rs/start-axum/blob/182477f366dc0b43b909a6a845958382afcab613/src/error_template.rs

    Should work both client-side and server-side (ssr).

    opened by srid 0
  • Expose as flake module

    Expose as flake module

    Expose a flake-module.nix for re-use in other repos, as our top-level flake.nix has already gotten quite complex.

    Use in https://github.com/juspay/nix-browser/issues/8

    opened by srid 0
Owner
Sridhar Ratnakumar
I enjoy Haskell & Nix.
Sridhar Ratnakumar
Simple template to use csr and ssr leptos with tauri for ios/android/windows/macos/linux and web dev

Tailwind-Leptos-Tauri Template Simple template to use csr and ssr leptos with tauri for ios/android/windows/macos/linux and web dev Just clone the rep

Victor Batarse 11 Mar 10, 2024
A `nix` and `nix-shell` wrapper for shells other than `bash`

nix-your-shell A nix and nix-shell wrapper for shells other than bash. nix develop and nix-shell use bash as the default shell, so nix-your-shell prin

Mercury 15 Apr 10, 2023
Progress In Nix - Pacman inspired frontend for Nix

Progress In Nix Pinix is a Pacman inspired frontend for Nix. It wraps a regular Nix command and replaces the output with a more modern and informative

Rémi Dupré 23 Mar 9, 2024
Dragonfly, POC full-stack web app DSL

Dragonfly Dragonfly is a toy DSL that explores ways to describe the structure of full-stack web applications. You should not use it in production. For

Bas Dirks 9 Mar 15, 2023
🦀🔨 DevBcn Workshop - Full Stack Rust - Actix - Postgres - Shuttle - Dioxus

Building a Movie Collection Manager - Full Stack Workshop with Rust, Actix, SQLx, Dioxus, and Shuttle Welcome to the this workshop! In this hands-on w

BcnRust 57 Jul 12, 2023
A website for the Leptos Web Framework!

Leptos Website A Repo for the public facing Leptos website. Still a WIP. Client Side Rendering This example cannot be built as a trunk standalone CSR-

Leptos 7 May 2, 2023
Experimental integration of `fedimint-client` with the Leptos web frontend framework

CAUTION: highly experimental, the Database implementation is likely horribly broken Fedimint Client built with Leptos This repo contains a proof-of-co

null 3 Aug 27, 2023
Sero is a web server that allows you to easily host your static sites without pain. The idea was inspired by surge.sh but gives you full control.

sero Lightning-fast, static web publishing with zero configuration and full control ?? Table Of Contents ?? Table Of Contents ?? Tools ❓ About The Pro

Dmitry Miasnenko 6 Nov 13, 2023
A CLI screentime monitoring tool. Shows how much time are you using certain apps.

A screentime monitoring tool, shows how much time are you really using certain apps. It work nicely with i3status or py3status on I3 window manager fo

Piotr Czajka 6 Dec 8, 2022
Following "ZK HACK III - Building On-chain Apps Off-chain Using RISC Zero"

RISC Zero Rust Starter Template Welcome to the RISC Zero Rust Starter Template! This template is intended to give you a starting point for building a

drCathieSo.eth 3 Dec 22, 2022