Skip to content

Conversation

Copy link

Copilot AI commented Dec 24, 2025

Scaffolds a Tauri v2 desktop application with React 19, TanStack Router file-based routing, Tailwind CSS v4, and modern tooling. Sets bundle identifier to com.leaguetoolkit.forge.

Stack

  • Desktop: Tauri v2.9 with Rust backend
  • Frontend: React 19 + Vite 7 + TypeScript 5.8
  • Routing: TanStack Router with file-based routes and automatic type generation
  • Styling: Tailwind CSS v4 via Vite plugin + Base UI components
  • Tooling: ESLint flat config, Prettier with Tailwind plugin
  • CI: GitHub Actions workflow (lint → typecheck → build)

Structure

src/
├── routes/
│   ├── __root.tsx          # Root layout with Router Devtools
│   └── index.tsx           # Landing page with Base UI Button demo
├── main.tsx                # RouterProvider setup
├── index.css               # Tailwind import
└── routeTree.gen.ts        # Auto-generated by router plugin

src-tauri/
├── src/lib.rs              # Greet command example
├── tauri.conf.json         # v2 schema, bundle ID configured
└── Cargo.toml

Example Route

// src/routes/index.tsx
import { createFileRoute } from '@tanstack/react-router';
import { Button } from '@base-ui/react/button';

export const Route = createFileRoute('/')({
  component: Index,
});

function Index() {
  return (
    <main className="container mx-auto flex min-h-screen flex-col items-center justify-center">
      <h1 className="text-4xl font-bold">Welcome to LTK Forge</h1>
      <Button className="rounded-lg bg-blue-500 px-6 py-2 text-white hover:bg-blue-600">
        Greet
      </Button>
    </main>
  );
}

Screenshots

Initial UI with Tailwind CSS and Base UI components:

LTK Forge UI

Router Devtools active in development:

Router Devtools

Scripts

pnpm dev          # Vite dev server (localhost:1420)
pnpm tauri dev    # Desktop app in dev mode
pnpm build        # Production build
pnpm lint         # ESLint
pnpm typecheck    # TypeScript validation
pnpm format       # Prettier

Note: pnpm tauri dev requires system dependencies (webkit2gtk on Linux, etc.). See Tauri prerequisites.

Original prompt

Create a complete scaffold for a Tauri v2 + React (Vite + TypeScript) desktop app in LeagueToolkit/ltk-forge.

Context:

Requirements

  1. Tauri
  • Initialize Tauri v2 project structure including src-tauri/.
  • Ensure tauri.conf.json (or v2 equivalent) uses identifier/bundle id com.leaguetoolkit.forge.
  • Provide pnpm scripts to run Tauri dev/build.
  1. Frontend
  • Use Vite + React + TypeScript.
  • Add TanStack Router with file-based routing and type generation enabled.
    • Configure the TanStack router Vite plugin.
    • Include a minimal working route structure: root route + index route.
    • Include router provider wiring in src/main.tsx.
    • Optionally include Router Devtools in development.
  1. UI/Styling
  • Add @base-ui-components/react and create at least one example component usage in the UI.
  • Configure Tailwind CSS v4 using tailwindcss and @tailwindcss/vite.
  • Ensure Tailwind is active and working in the starter UI.
  1. Linting/Formatting
  • Configure ESLint flat config (new ESLint config format).
    • Include TypeScript + React recommendations, React hooks, and React Refresh plugin for Vite.
  • Configure Prettier and include prettier-plugin-tailwindcss.
  • Add pnpm scripts:
    • lint, format, format:check, typecheck.
  1. CI
  • Add a GitHub Actions workflow that runs on PRs and pushes to main.
  • Workflow should:
    • Set up Node and pnpm
    • Install dependencies
    • Run pnpm lint, pnpm typecheck, and pnpm build
  1. Docs
  • Add/update a README.md with:
    • prerequisites
    • commands to run dev (frontend + tauri dev)
    • lint/format/typecheck commands

Acceptance criteria

  • pnpm install works.
  • pnpm dev runs the Vite frontend.
  • pnpm tauri dev runs the Tauri app.
  • pnpm lint, pnpm typecheck, pnpm build succeed.
  • Router typegen is functional (route tree generated/updated) and file-based routes resolve.

Notes

  • Keep structure at repository root (single app), not monorepo apps/.
  • Keep changes minimal but complete and consistent.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 24, 2025
Copilot AI and others added 2 commits December 24, 2025 23:32
… tooling

Co-authored-by: Crauzer <18646077+Crauzer@users.noreply.github.com>
Co-authored-by: Crauzer <18646077+Crauzer@users.noreply.github.com>
Copilot AI changed the title [WIP] Create complete scaffold for Tauri v2 and React desktop app Initialize Tauri v2 + React scaffold with file-based routing and Tailwind v4 Dec 24, 2025
Copilot AI requested a review from Crauzer December 24, 2025 23:40
@Crauzer Crauzer requested a review from Copilot December 27, 2025 20:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR scaffolds a complete Tauri v2 desktop application with React 19, TanStack Router (file-based routing), Tailwind CSS v4, and modern tooling for the LeagueToolkit/ltk-forge project. The scaffold includes a working example with a "greet" command demonstrating Rust-frontend communication.

Key changes:

  • Full Tauri v2 project structure with Rust backend and React frontend
  • TanStack Router with file-based routing and automatic type generation
  • Tailwind CSS v4 via Vite plugin with Base UI component library
  • Complete development toolchain: ESLint flat config, Prettier, TypeScript 5.8
  • CI/CD workflow for linting, type checking, and building

Reviewed changes

Copilot reviewed 24 out of 48 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
package.json Defines dependencies and npm scripts for the scaffold
vite.config.ts Configures Vite with React, TanStack Router, and Tailwind plugins
tsconfig.json / tsconfig.node.json TypeScript configuration for source and build files
src/main.tsx React app entry point with RouterProvider setup
src/routes/__root.tsx Root route with Router Devtools
src/routes/index.tsx Landing page with example Tauri command integration
src/routeTree.gen.ts Auto-generated route tree from TanStack Router
src-tauri/Cargo.toml Rust dependencies for Tauri v2 application
src-tauri/src/lib.rs Rust library with "greet" command example
src-tauri/src/main.rs Rust main entry point
src-tauri/tauri.conf.json Tauri v2 configuration with bundle identifier
eslint.config.js ESLint flat config with TypeScript and React support
.prettierrc Prettier configuration with Tailwind plugin
.github/workflows/ci.yml CI workflow for lint, typecheck, and build
index.html HTML entry point for the application

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + React + Typescript</title>
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTML title "Tauri + React + Typescript" doesn't match the application name "LTK Forge" used throughout the rest of the codebase. This should be updated to "LTK Forge" for consistency with the product name defined in tauri.conf.json.

Suggested change
<title>Tauri + React + Typescript</title>
<title>LTK Forge</title>

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +7
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @ts-expect-error directive suppresses the error for process.env.TAURI_DEV_HOST, but this is a valid Node.js global in the Vite config context. Consider adding proper type definitions instead of suppressing the error, or use import.meta.env.TAURI_DEV_HOST if available in Tauri v2, as this would be more idiomatic for Vite projects.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +26
"react": "^19.1.0",
"react-dom": "^19.1.0",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tanstack/react-router": "^1.98.0",
"@base-ui/react": "^1.0.0-rc.0"
},
"devDependencies": {
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package.json lists React 19.1.0 as a dependency. React 19 is a relatively new major release that may have breaking changes and limited ecosystem support. Consider verifying that all dependencies (particularly @base-ui/react at rc.0) are fully compatible with React 19, or consider using React 18 LTS for better stability and ecosystem support.

Suggested change
"react": "^19.1.0",
"react-dom": "^19.1.0",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tanstack/react-router": "^1.98.0",
"@base-ui/react": "^1.0.0-rc.0"
},
"devDependencies": {
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tanstack/react-router": "^1.98.0",
"@base-ui/react": "^1.0.0-rc.0"
},
"devDependencies": {
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",

Copilot uses AI. Check for mistakes.
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-opener": "^2",
"@tanstack/react-router": "^1.98.0",
"@base-ui/react": "^1.0.0-rc.0"
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @base-ui/react package is at version 1.0.0-rc.0 (release candidate). Using pre-release versions in production can introduce instability and breaking changes. Consider either using a stable version or documenting that this is an experimental dependency that may require updates.

Suggested change
"@base-ui/react": "^1.0.0-rc.0"
"@base-ui/react": "^1.0.0"

Copilot uses AI. Check for mistakes.
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "ltk_forge_lib"
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The library name in Cargo.toml uses an incorrect suffix. The comment states "The _lib suffix may seem redundant but it is necessary", but the actual name defined is "ltk_forge_lib" which doesn't match the expected binary name "ltk-forge" (note the underscore vs hyphen mismatch). According to the comment referencing the Windows issue, the lib name should be "ltk_forge_temp_lib" or similar to truly avoid conflicts, but it currently just mirrors the package name with underscores.

Suggested change
name = "ltk_forge_lib"
name = "ltk_forge_temp_lib"

Copilot uses AI. Check for mistakes.
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

fn main() {
ltk_forge_temp_lib::run()
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main.rs file references "ltk_forge_temp_lib::run()" but the library is named "ltk_forge_lib" in Cargo.toml (line 14). This mismatch will cause a compilation error. The library name should be consistent between the Cargo.toml definition and the Rust code reference.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants