No description
Find a file
2025-09-27 21:38:39 +02:00
public Initial commit 2025-09-27 21:38:39 +02:00
src Initial commit 2025-09-27 21:38:39 +02:00
src-tauri Initial commit 2025-09-27 21:38:39 +02:00
.gitignore Initial commit 2025-09-27 21:38:39 +02:00
AGENTS.md Initial commit 2025-09-27 21:38:39 +02:00
biome.json Initial commit 2025-09-27 21:38:39 +02:00
components.json Initial commit 2025-09-27 21:38:39 +02:00
Dockerfile Initial commit 2025-09-27 21:38:39 +02:00
eslint.config.js Initial commit 2025-09-27 21:38:39 +02:00
index.html Initial commit 2025-09-27 21:38:39 +02:00
Jenkinsfile Initial commit 2025-09-27 21:38:39 +02:00
package.json Initial commit 2025-09-27 21:38:39 +02:00
pnpm-lock.yaml Initial commit 2025-09-27 21:38:39 +02:00
README.md Initial commit 2025-09-27 21:38:39 +02:00
tsconfig.app.json Initial commit 2025-09-27 21:38:39 +02:00
tsconfig.json Initial commit 2025-09-27 21:38:39 +02:00
tsconfig.node.json Initial commit 2025-09-27 21:38:39 +02:00
vite.config.ts Initial commit 2025-09-27 21:38:39 +02:00

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default tseslint.config([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      ...tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      ...tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      ...tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default tseslint.config([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

TanStack Router + Query setup

  • Router: @tanstack/react-router with a simple tree under src/app/router/router.tsx and example routes in src/routes/.
  • Query: @tanstack/react-query with a shared QueryClient provider in src/app/providers/QueryProvider.tsx.
  • Devtools: Included for both Router and React Query in development.

Entry point src/main.tsx wraps the app with QueryProvider and AppRouter.

Adding routes

  • Create a new component under src/routes/ and register it in src/app/router/router.tsx using createRoute.

Typesafe environment variables

  • Runtime validation lives in src/env.ts using zod.
  • Type declarations are in src/vite-env.d.ts.
  • Copy .env.example to .env and adjust values. Vite only exposes variables prefixed with VITE_.

Example:

VITE_ENV=development
VITE_API_URL=https://api.example.com

Use in code:

import { env } from './env'

fetch(`${env.VITE_API_URL}/ping`)