Skip to content
/ taupy Public template

Template repository to get you started with Tauri, React and a Python backend API

License

Notifications You must be signed in to change notification settings

whatphilipcodes/taupy

Repository files navigation

logo   TauPy

This template is supposed to help with the creation of desktop applications that rely on a python backend. It uses tauri for the main runtime and vanilla react with tailwind for the frontend. The python environment is managed by poetry and the frontend packages are managed by pnpm. The project aims to be a scarce starting point to be easily transformed into the desired application.

Features

  • preset pipelines seamlessly hooking into tauri dev and tauri build
  • custom port manager to handle dev and build environments
  • automatic process shutdown upon exiting the application
  • built-in python env management via poetry
  • easy to understand folder structure

Prerequisites

  • rust (tauri runtime)

    for macOS use homebrew

    brew install rustup

    for windows use scoop

    scoop install main/rustup

    this project was built using rust 1.82.0, feel free to try newer stable versions

    rustup install 1.82.0
    rustup default 1.82.0

    for more in-depth OS specific information refer to the tauri docs

  • node (frontend runtime)

    for macOS use homebrew

    brew install node
    brew install pnpm

    for windows use scoop

    scoop install main/nodejs
    scoop install nodejs pnpm
  • python (backend runtime)

    for macOS use homebrew

    brew install python@3.12

    for windows use scoop

    scoop bucket add versions
    scoop install versions/python312
  • poetry (py env management)

    it is remommended to use pipx to install poetry

    pipx

    for macOS use homebrew

    brew install pipx
    pipx ensurepath

    for windows use scoop

    scoop install main/pipx
    pipx ensurepath

    poetry

    pipx install poetry

Installation

  • required

    create the python env and install the dependencies

    poetry install

    download the frontend dependencies

    pnpm install

Debugging

Be aware that even though running the dev command will put executable files into the ./src-tauri/target/debug directory, these artifacts cannot be run. To generate an actual usable debug build in that location, run the debug-build command first. For more information on debugging in Tauri in general refer to the tauri docs.

Template Sync

This repo includes a sync workflow using the template-sync action. For this to work correctly, in your repository settings, you have to enable 'Allow GitHub Actions to create and approve pull requests' under Actions > General. Once configured you can create a PR with all changes from the template using the workflow dispatch trigger. Keep in mind however, this will overwrite any code shared between the template and your repository, so you have to manually cherry-pick from the PR before merging. Usage of this feature is entirely optional.

Disclaimer

As I am only getting started with Rust, Tauri and writing desktop applications in general, I cannot guarantee the security of this template. If you find any security issues, please report them in the issues section, prefably with a PR attached, and I will do my best to incorporate the changes. Any other suggestions or ideas on how to improve this template are also welcome.