https://github.com/dieharders/example-tauri-python-server-sidecar
An example desktop app built using the Tauri framework to bundle Next.js with a Python server.
https://github.com/dieharders/example-tauri-python-server-sidecar
desktop-app fastapi native-apps nextjs pnpm python scaffold-template tauri-app
Last synced: 5 months ago
JSON representation
An example desktop app built using the Tauri framework to bundle Next.js with a Python server.
- Host: GitHub
- URL: https://github.com/dieharders/example-tauri-python-server-sidecar
- Owner: dieharders
- License: apache-2.0
- Created: 2023-08-17T04:15:51.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-08T00:13:01.000Z (over 1 year ago)
- Last Synced: 2024-12-08T00:21:47.267Z (over 1 year ago)
- Topics: desktop-app, fastapi, native-apps, nextjs, pnpm, python, scaffold-template, tauri-app
- Language: TypeScript
- Homepage:
- Size: 153 KB
- Stars: 61
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example Tauri v1 app using Python sidecar
A native app built with Tauri v1 that spawns a Python sub-process (sidecar) which starts a FastAPI server.






> [!IMPORTANT]
>
> Tauri v2 example is now available 👇
>
> example-tauri-v2-python-server-sidecar
>
> More features and documentation with example app.exe.

## Introduction
This example app uses Next.js as the frontend and Python (FastAPI) as the backend. Tauri is a Rust framework that orchestrates the frontend and backend(s) into a native app experience.
## How It Works

Tauri takes your frontend UI written in html/javascript and displays it in a native webview. This makes the resulting file size smaller since it does not need to include a web browser.
## Getting Started
### Dependencies
Install dependencies for javascript:
```bash
pnpm install
```
To install python dependencies listed in requirements.txt:
```bash
pnpm dev-reqs
```
In case you dont have PyInstaller installed:
```bash
pip install -U pyinstaller
```
### Run
To run the app in development mode with hot-reload (js):
```bash
pnpm tauri dev
```
### Build
#### Compile python sidecar
Run this at least once before running `pnpm tauri dev` and each time you make changes to your python code. This command is also called by `pnpm tauri build`:
```bash
pnpm build:fastapi
```
#### Build app for production:
```bash
pnpm tauri build
```
This creates an installer located here:
- \\src-tauri\target\release\bundle\nsis
## Learn More
- [Tauri Framework](https://tauri.app/) - learn about native app development in javascript and rust.
- [NextJS](https://nextjs.org/docs) - learn about the popular react framework Next.js
- [FastAPI](https://fastapi.tiangolo.com/) - learn about FastAPI server features and API.
- [PyInstaller](https://pyinstaller.org/en/stable/) - learn about packaging python code.