Coder Social home page Coder Social logo

tauri-react-template-app's Introduction

Tauri + React + Vite Template

Simple project template for Tauri and React.

Features

  • React / TypeScript frontend
  • Simple and fast Vite config w/ HMR in development and optimizations for production builds
  • Github Actions for testing and building\release

Setting Up

  1. Install Tauri Prerequisites
  2. Clone and install dependencies (this template uses pnpm by default):
pnpm i

Usage

A Tauri app has at least two processes:

  • the Core Process (backend, or main process in Electron terminology), and
  • the WebView process (frontend, or renderer in Electron)

๐Ÿฆข Frontend (TS, PnPM)

Running Development Server

Both back- and frontend start with a single command:

pnpm dev

Testing

pnpm test

๐Ÿฆ€ Backend (Rust, Cargo)

Backend code lives in src-tauri/ (Following commands are to be run from there.)

Finding Outdated Rust Dependencies

If you have cargo-outdated installed:

cargo outdated

Upgrading Rust Dependencies

If you have cargo-edit installed:

cargo upgrade

Debugging

  • The dev command has by default RUST_BACKTRACE=1 set which makes Rust output full backtraces to the console. (Remove it from the package.json command if you don't want it).
  • If you use VS Code, you can debug Rust code with the included Debug Tauri config.

Building and releasing

Building

The project has GitHub Actions set up which will automatically test and build your app with every push and PR. For building manually:

pnpm build

Releasing a new version

  1. Bump version number (In package.json, and src-tauri/tauri.conf.json)
  2. Run pnpm check to update Cargo.lock
  3. Tag the commit you want to release with vX.Y.Z
  4. Edit the release notes and push (also tags!)
  5. Github workflow will automatically build a new draft release for this version. Publish when ready ๐ŸŽ‰

tauri-react-template-app's People

Watchers

Kevlin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.