- Add BandSettingsPage (/bands/:id/settings/:panel) with Members, Storage, and Band Settings panels matching the mockup design - Strip members list, invite controls, and NC folder config from BandPage — library view now focuses purely on recordings workflow - Add band-scoped nav section to AppShell sidebar (Members, Storage, Band Settings) with correct per-panel active states - Fix amAdmin bug: was checking if any member is admin; now correctly checks if the current user holds the admin role - Add 31 vitest tests covering BandPage cleanliness, routing, access control (admin vs member), and per-panel mutation behaviour - Add test:web, test:api:unit, test:feature (post-feature pipeline), and ci tasks to Taskfile; frontend tests run via podman node:20-alpine - Add README with architecture overview, setup guide, and test docs - Add @testing-library/dom and @testing-library/jest-dom to package.json Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
95 lines
2.6 KiB
TypeScript
95 lines
2.6 KiB
TypeScript
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { BrowserRouter, Route, Routes, Navigate } from "react-router-dom";
|
|
import "./index.css";
|
|
import { isLoggedIn } from "./api/client";
|
|
import { AppShell } from "./components/AppShell";
|
|
import { LoginPage } from "./pages/LoginPage";
|
|
import { HomePage } from "./pages/HomePage";
|
|
import { BandPage } from "./pages/BandPage";
|
|
import { BandSettingsPage } from "./pages/BandSettingsPage";
|
|
import { SessionPage } from "./pages/SessionPage";
|
|
import { SongPage } from "./pages/SongPage";
|
|
import { SettingsPage } from "./pages/SettingsPage";
|
|
import { InvitePage } from "./pages/InvitePage";
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: { queries: { retry: 1, staleTime: 30_000 } },
|
|
});
|
|
|
|
function PrivateRoute({ children }: { children: React.ReactNode }) {
|
|
return isLoggedIn() ? <>{children}</> : <Navigate to="/login" replace />;
|
|
}
|
|
|
|
function ShellRoute({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<PrivateRoute>
|
|
<AppShell>{children}</AppShell>
|
|
</PrivateRoute>
|
|
);
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
<BrowserRouter>
|
|
<Routes>
|
|
<Route path="/login" element={<LoginPage />} />
|
|
<Route path="/invite/:token" element={<InvitePage />} />
|
|
<Route
|
|
path="/"
|
|
element={
|
|
<ShellRoute>
|
|
<HomePage />
|
|
</ShellRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/bands/:bandId"
|
|
element={
|
|
<ShellRoute>
|
|
<BandPage />
|
|
</ShellRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/bands/:bandId/settings"
|
|
element={<Navigate to="members" replace />}
|
|
/>
|
|
<Route
|
|
path="/bands/:bandId/settings/:panel"
|
|
element={
|
|
<ShellRoute>
|
|
<BandSettingsPage />
|
|
</ShellRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/bands/:bandId/sessions/:sessionId"
|
|
element={
|
|
<ShellRoute>
|
|
<SessionPage />
|
|
</ShellRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/bands/:bandId/songs/:songId"
|
|
element={
|
|
<ShellRoute>
|
|
<SongPage />
|
|
</ShellRoute>
|
|
}
|
|
/>
|
|
<Route
|
|
path="/settings"
|
|
element={
|
|
<ShellRoute>
|
|
<SettingsPage />
|
|
</ShellRoute>
|
|
}
|
|
/>
|
|
</Routes>
|
|
</BrowserRouter>
|
|
</QueryClientProvider>
|
|
);
|
|
}
|