Tuono Framework

repository·main·Indexed 22 days ago

https://github.com/tuono-labs/tuono

A superfast full-stack web framework for building React applications. Tuono leverages a Rust backend for high performance while providing a developer experience similar to Next.js, featuring native TypeScript support, file-system based routing, server-side rendering (SSR), and Hot Module Reload (HMR). It includes a CLI for project scaffolding with templates for MDX and Tailwind CSS, as well as specialized packages like tuono-router and tuono-fs-router-vite-plugin.

Tokens
18K
Snippets
92
Records
106
Agent score
77%

What's inside tuono

  1. Overview of Tuono features

    main

    Tuono is a full-stack web framework for building React applications that uses Rust for the backend. It is designed to feel familiar to Next.js users and provides the following core features:

    • Native Typescript: Full support for TypeScript.
    • Next.js like Routing: File-system based routing similar to Next.js.
    • CSS/SCSS modules: Support for modular styling.
    • Server Side Rendering (SSR): Built-in support for rendering on the server.
    • Hot Module Reload (HMR): Fast development feedback loop.
  2. Scaffold a project from a specific template

    main

    Tuono allows you to scaffold projects using specific starter templates. Use the --template flag followed by the name of the template folder (found in the examples/ directory) to apply that specific configuration to your new project.

    tuono new [NAME] --template [TEMPLATE]
  3. Create a new Tuono project with Tailwind CSS

    main

    You can scaffold a new Tuono project pre-configured with Tailwind CSS using the tuono new command and the with-tailwind template. This is the fastest way to start a project that includes the necessary Tailwind CSS setup.

    tuono new tuono-with-tailwind --template with-tailwind
  4. Start the Tuono development environment

    main

    After creating your project and installing dependencies (e.g., via npm install), run the following command to start the development server with Hot Module Reload (HMR) enabled:

    tuono dev
  5. Create a new Tuono project

    main

    To start a new project, use the tuono new command. You can optionally specify a template using the --template or -t flag to scaffold your project from one of the available examples.

    tuono new [PROJECT_NAME]

    Using a template:

    tuono new [PROJECT_NAME] --template [TEMPLATE_NAME]
  6. How Tuono handles API routes and HTTP methods

    main

    Tuono identifies API routes by checking if the path starts with /api/. For these routes, it scans the corresponding source file in src/routes{path}.rs for the tuono_lib::api(...) macro to extract supported HTTP methods.

    If a route is identified as an API route, it is excluded from Static Site Generation (SSG) processes, as API endpoints typically return data rather than HTML pages.