Skip to content
/ tauri-template Public template

Quickly bootstrap personal, local desktop apps!

Notifications You must be signed in to change notification settings

abilityapps/tauri-template

Repository files navigation

Tauri Template

This template should help get you started developing completely local, cross-platform desktop apps.

Starting the app

  1. bun i
  2. bunx tauri dev

Database Setup

By default, tauri-template comes with an embedded SQLite database named tauri-template.db. You can override this with the following steps:

  1. Choose between SQLite or PostgreSQL

  2. Set DATABASE_URL in src-tauri/.env:

    sqlite:<name>.db for SQLite

    postgres://postgres@localhost/<name> for Postgres (or cloud-hosted URL)

  3. sqlx migrate add <name> creates a migration file in migrations/<timestamp>-<name>.sql. Run this command in src-tauri/ Add your database schema changes here.

  4. Next time you restart your app, your migrations will be applied. sqlx migrate run applies your migrations manually.

Go here for information on migration reverts.

Rust does not support cetain database types. You must create serializers for those data types. Read here for Sqlite and here for Postgres.

You can look here for an example on how to serialize Postgres Numeric and Date types in Rust using the time and rust_decimal crates.

Building the app

bun run tauri build

Recommended IDE Setup

Rust Rover - this is the default recommendation. It is free for non-commercial use.

VS Code - install all the recommendations from .vscode/extensions.json. This should be an automatic popup.

Stack

Backend

Easiest way to use Postgres on Mac is Postgres.app

Frontend