nerdware/apps/web/src/App.tsx
AyoubBenziza d3ce52b60a feat(admin): manual quiz back-office + rewrite README
Back-office (roadmap V1 step 7):
- server: token-protected HTTP API under /api/admin (ADMIN_TOKEN), Drizzle-backed
  CRUD for manual questions — list, create (mcq/truefalse/free, category upsert,
  dedup on prompt, validation), delete; 401/503 when unauthorized/unconfigured
- client: /admin page with token login + TanStack Query (list/create/delete),
  format-aware form (QCM / vrai-faux / réponse libre)
- env: ADMIN_TOKEN

README: replace the shadcn template with a real NerdWare overview (stack,
structure, getting started, scripts, game modes, back-office).

Verified against real Postgres: auth (401), create (201), dedup (409),
validation (400), list, delete (200/404).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 16:43:19 +02:00

25 lines
794 B
TypeScript

import { Route, Switch } from "wouter"
import { HomePage } from "@/pages/home"
import { JoinPage } from "@/pages/join"
import { RoomPage } from "@/pages/room"
import { AdminPage } from "@/pages/admin"
export function App() {
return (
<Switch>
<Route path="/" component={HomePage} />
<Route path="/join/:code">
{(params) => <JoinPage code={params.code.toUpperCase()} />}
</Route>
<Route path="/room/:code">
{(params) => <RoomPage code={params.code.toUpperCase()} />}
</Route>
<Route path="/admin" component={AdminPage} />
<Route>
<div className="flex min-h-svh items-center justify-center p-6">
<p className="text-muted-foreground text-sm">Page introuvable.</p>
</div>
</Route>
</Switch>
)
}