6cfeb2b865
- Vite + React 18 + TypeScript + Mantine + TanStack Query + react-router-dom - typed client: openapi-typescript -> src/api/schema.d.ts (committed), openapi-fetch - fetch wrapper middleware: cookies, X-CSRF-Token on writes, 401 -> /login, non-401 errors carry parsed JSON body - SessionProvider/useSession (GET /api/session), ProtectedRoute skeleton - app shell (Mantine + router) with placeholder login/home/config pages + gear nav - dev proxy to FastAPI; vitest smoke test; frontend README - npm scripts: dev/build/preview/lint/typecheck/test/codegen
25 lines
564 B
TypeScript
25 lines
564 B
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
|
|
server: {
|
|
proxy: {
|
|
'/api': 'http://localhost:8000',
|
|
'/login': 'http://localhost:8000',
|
|
'/logout': 'http://localhost:8000',
|
|
'/static': 'http://localhost:8000',
|
|
'/docs': 'http://localhost:8000',
|
|
'/openapi.json': 'http://localhost:8000',
|
|
},
|
|
},
|
|
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./src/test-setup.ts'],
|
|
},
|
|
})
|