()
diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx
new file mode 100644
index 0000000..66c3636
--- /dev/null
+++ b/src/routes/__root.tsx
@@ -0,0 +1,11 @@
+import { createRootRoute, Outlet } from '@tanstack/react-router';
+import { TanStackRouterDevtools } from '@tanstack/router-devtools';
+
+export const Route = createRootRoute({
+ component: () => (
+
+
+ {import.meta.env.DEV && }
+
+ ),
+});
diff --git a/src/routes/index.tsx b/src/routes/index.tsx
new file mode 100644
index 0000000..5dad3a2
--- /dev/null
+++ b/src/routes/index.tsx
@@ -0,0 +1,59 @@
+import { createFileRoute } from '@tanstack/react-router';
+import { useState } from 'react';
+import { invoke } from '@tauri-apps/api/core';
+import { Button } from '@base-ui/react/button';
+import reactLogo from '../assets/react.svg';
+
+export const Route = createFileRoute('/')({
+ component: Index,
+});
+
+function Index() {
+ const [greetMsg, setGreetMsg] = useState('');
+ const [name, setName] = useState('');
+
+ async function greet() {
+ setGreetMsg(await invoke('greet', { name }));
+ }
+
+ return (
+
+ Welcome to LTK Forge
+ Tauri v2 + React + TypeScript + TanStack Router
+
+
+
+
+ {greetMsg && {greetMsg}
}
+
+ );
+}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
new file mode 100644
index 0000000..11f02fe
--- /dev/null
+++ b/src/vite-env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..a7fc6fb
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,25 @@
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "useDefineForClassFields": true,
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "react-jsx",
+
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true
+ },
+ "include": ["src"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
diff --git a/tsconfig.node.json b/tsconfig.node.json
new file mode 100644
index 0000000..42872c5
--- /dev/null
+++ b/tsconfig.node.json
@@ -0,0 +1,10 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "skipLibCheck": true,
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..c5cb7ff
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,41 @@
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+import tailwindcss from '@tailwindcss/vite';
+import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
+
+// @ts-expect-error process is a nodejs global
+const host = process.env.TAURI_DEV_HOST;
+
+// https://vite.dev/config/
+export default defineConfig(async () => ({
+ plugins: [
+ TanStackRouterVite({
+ routesDirectory: './src/routes',
+ generatedRouteTree: './src/routeTree.gen.ts',
+ }),
+ react(),
+ tailwindcss(),
+ ],
+
+ // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
+ //
+ // 1. prevent Vite from obscuring rust errors
+ clearScreen: false,
+ // 2. tauri expects a fixed port, fail if that port is not available
+ server: {
+ port: 1420,
+ strictPort: true,
+ host: host || false,
+ hmr: host
+ ? {
+ protocol: 'ws',
+ host,
+ port: 1421,
+ }
+ : undefined,
+ watch: {
+ // 3. tell Vite to ignore watching `src-tauri`
+ ignored: ['**/src-tauri/**'],
+ },
+ },
+}));