tauri-desktop-app

v0.1.0curated

Full-stack architecture for data-driven desktop apps — Tauri v2, Hono BFF, SQLite + Drizzle, React 19 + MUI + TanStack, Bun, Moonrepo.

stack:desktopframework:tauriframework:reactframework:honoruntime:bunlanguage:typescriptlanguage:pythondatabase:sqliteorm:drizzlebuild:moonrepo
archgate adr import packs/tauri-desktop-app

Decisions (38)

TypeScript as Primary Language

To ensure consistency and maintainability across the project, we must standardize on a primary programming language.

1 rule
Bun as Package Manager and Runtime

The project uses TypeScript as its primary language and relies heavily on external packages from the npm registry.

1 rule
Monorepo with Moonrepo

A Tauri desktop application is inherently composed of multiple discrete components: frontends, backends, data models, shared libraries, and potentially data jobs.

1 rule
Standardized Monorepo Folder Structure

A monorepo containing multiple polyglot projects can become chaotic without a strictly enforced folder structure.

1 rule
Toolchain Version Management with Proto

The project's technology stack is composed of multiple, independent tools, each with its own release cycle: `bun` (package manager and runtime), `node` (as a peer runtime for incompatible developme...

1 rule
Code Formatting (Prettier + Ruff)

Code formatting is a major source of debate and developer friction.

1 rule
Code Linting (Oxlint + Ruff)

Maintaining code quality and correctness is critical for long-term maintainability, especially in a hybrid workforce of human and AI/LLM developers, where AI-generated code must be held to the same...

1 rule
No Path Aliases in TypeScript

In TypeScript projects, developers often configure path aliases in `tsconfig.json` to avoid long relative import paths.

1 rule
Centralized Dependency Versions

In a monorepo structure with multiple TypeScript packages (backend, frontend, datamodels, desktop, jobs), managing dependency versions consistently across all packages is challenging.

1 rule
Tauri v2 Desktop Shell

Desktop applications need a native shell to wrap web-based user interfaces.

1 rule
Python for Data-Related Tasks

TypeScript is the primary language for general-purpose application development (backend APIs, frontend UIs, business logic).

1 rule
UV as Python Package Manager

Python projects are highly dependent on external packages from registries like PyPI.

1 rule
ty as Python Type Checker

Python's dynamic typing benefits from static type checking to catch bugs early, improve code documentation, and enable better IDE support.

1 rule
Backend for Frontend with Hono

Desktop applications built with Tauri benefit from a dedicated backend that serves the frontend's exact data needs.

1 rule
Type-Safe API with Hono RPC and Zod OpenAPI

End-to-end type safety between frontend and backend is critical for building robust, maintainable desktop applications.

1 rule
Backend Folder Structure

To ensure consistency and maintainability for backend services, we must standardize on a clear folder structure.

1 rule
CORS Support for Desktop Apps

Desktop applications built with frameworks like Tauri run the frontend inside a webview that loads content from a local origin (e.g., `tauri://localhost` or `https://tauri.localhost`).

1 rule
SQLite as Embedded Database

Desktop applications require a database for persistent storage.

1 rule
Drizzle ORM for Schema and Data Access

Applications need a clear, maintainable way to define data models and access the database from TypeScript code.

1 rule
Schema Migrations with Drizzle Kit

As applications evolve, database schemas must change to support new features, fix issues, or optimize performance.

1 rule
UUID v7 Primary Keys

Traditional auto-incrementing integer primary keys require the database to generate the next sequential ID, which only works when connected to the database.

1 rule
Audit Fields (created_at and updated_at)

Understanding when records were created and last modified is essential for debugging, data analysis, user experience (e.g., "last updated 5 minutes ago"), and synchronization in offline-first appli...

1 rule
Field Naming Convention

When working with Drizzle ORM and TypeScript, there is a fundamental naming mismatch between language conventions.

1 rule
Database Environment Separation

SQLite databases are stored as single files on the filesystem.

1 rule
Sidecar Data Import Jobs

Desktop applications often need to import data from external services such as APIs, file exports, or third-party platforms.

1 rule
React 19 SPA Architecture

Desktop applications built with Tauri render their UI in a webview, making web technologies the natural choice for building the interface.

1 rule
Vite as Frontend Build Tool

Modern frontend applications require a build tool to transform TypeScript and JSX into browser-compatible JavaScript, bundle modules for production, provide hot module replacement during developmen...

1 rule
MUI as UI Component Library

Building a desktop application frontend requires a comprehensive component library that provides pre-built, accessible UI components for common patterns: buttons, forms, tables, dialogs, navigation...

1 rule
TanStack Router for File-Based Routing

Single Page Applications require client-side routing to manage navigation between different views without full page reloads.

1 rule
TanStack Query for Server State

Modern applications require efficient data fetching, caching, and synchronization with backend APIs.

1 rule
TanStack Form for Form Management

Frontend applications require robust form handling for user input validation, state management, and submission.

1 rule
Jotai for Client State

Modern React applications need to manage different types of state: server state (data from APIs), UI state (component-local toggles, modals), and global client state (theme preference, sidebar open...

1 rule
Stateful and Stateless Component Separation

React components can be categorized into two types based on their responsibilities.

1 rule
End-to-End Type Safety with Backend

TypeScript provides type safety within the frontend codebase, but traditionally there is a gap between frontend and backend.

1 rule
Storybook for Component Development

Developing UI components in isolation provides significant benefits for desktop application frontends:

1 rule
i18next for Internationalization

Desktop applications often need to support multiple languages for their user interface.

1 rule
No Barrel Files

Barrel files (also known as index files or re-export files) are `index.ts` or `index.tsx` files that re-export modules from a directory, allowing shorter import paths.

1 rule
Frontend Folder Structure

React applications can quickly become difficult to navigate without a standardized folder structure.

1 rule