M2-T06: scaffold React SPA frontend with typed OpenAPI client
- 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
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* ConfigPage — placeholder for M2-T08.
|
||||
*
|
||||
* T08 replaces this with the real config UI: all config sections rendered as editable
|
||||
* fields, secret masking, save button (PUT /api/config), and SMTP test action.
|
||||
*/
|
||||
|
||||
import { Container, Title, Text } from '@mantine/core'
|
||||
|
||||
export function ConfigPage() {
|
||||
return (
|
||||
<Container pt="xl">
|
||||
<Title order={2}>Configuration</Title>
|
||||
<Text c="dimmed" mt="sm">
|
||||
Config editor — implemented in M2-T08.
|
||||
</Text>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* HomePage — placeholder for M2-T09.
|
||||
*
|
||||
* T09 replaces this with the real home view: Leaflet map, heatmap layer,
|
||||
* time-range selector, scatter-point layer, and poo overlay.
|
||||
*/
|
||||
|
||||
import { Container, Title, Text } from '@mantine/core'
|
||||
|
||||
export function HomePage() {
|
||||
return (
|
||||
<Container pt="xl">
|
||||
<Title order={2}>Home</Title>
|
||||
<Text c="dimmed" mt="sm">
|
||||
Map / heatmap visualisation — implemented in M2-T09.
|
||||
</Text>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* LoginPage — placeholder for M2-T07.
|
||||
*
|
||||
* T07 replaces this with the real login form (username/password → POST /api/auth/login,
|
||||
* force-password-change flow, redirect to home on success).
|
||||
*/
|
||||
|
||||
import { Container, Title, Text } from '@mantine/core'
|
||||
|
||||
export function LoginPage() {
|
||||
return (
|
||||
<Container size="xs" pt="xl">
|
||||
<Title order={2}>Login</Title>
|
||||
<Text c="dimmed" mt="sm">
|
||||
Login form — implemented in M2-T07.
|
||||
</Text>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user