https://github.com/codeforreal1/local-first-desktop-app-rust-nodejs
Cross platform desktop app with local-first architecture with Node.js backend server.
https://github.com/codeforreal1/local-first-desktop-app-rust-nodejs
Last synced: 9 months ago
JSON representation
Cross platform desktop app with local-first architecture with Node.js backend server.
- Host: GitHub
- URL: https://github.com/codeforreal1/local-first-desktop-app-rust-nodejs
- Owner: codeforreal1
- Created: 2024-06-06T14:22:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-06T14:41:05.000Z (over 1 year ago)
- Last Synced: 2024-06-06T16:15:27.168Z (over 1 year ago)
- Language: TypeScript
- Size: 54.2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cross platform desktop app with local-first architecture.
This project is an example of how to use Node.js as a sidecar in Tauri if you find building the backend in Rust very complex. While, the point of using Rust is to make the desktop app perform better and secure, but you still have the option to use other tech. You can even use Python with this approach. You can find this same project whose backend was written in Rust from [here](https://github.com/codeforreal1/Local-First-Desktop-App-Rust).
### Tech:
- Next.js(UI)
- Node.js(Server)
- Tauri
- Sqlite with Drizzle ORM
### Building
This project uses Hono server created in Node.js as a sidecar for Tauri. The project uses `@yao-pkg/pkg` for compiling the Node.js project into a single binary after making a single bundle js file using esbuild.
For local development:
```
cd src-server
pnpm install
pnpm server:build
```
`pnpm server:build` will create a bundle file and place the server binary inside `src-tauri/bin/server-. See [Tauri Sidecar](https://tauri.app/v1/guides/building/sidecar/) for more info.
Then you can run the tauri dev server using:
```
pnpm tauri:dev
pnpm next:dev
```
For prod app build:
```
pnpm tauri:build
```