Files
rehearshalhub/web/src/App.tsx
Mistral Vibe d9035acdff feat: app shell with sidebar + bug fixes
UI:
- Add persistent sidebar (210px) with band switcher dropdown, Library/Player/Settings nav, user avatar row, and sign-out button
- Align design system CSS vars to CLAUDE.md spec (#0f0f12 bg, #e8a22a amber accent, rgba borders/text)
- Remove light mode toggle (no light mode in v1)
- Homepage auto-redirects to first band; shows create-band form only when no bands exist
- Strip full-page wrappers from all pages (shell owns layout)
- Remove debug console.log statements from SongPage

Bug fixes:
- nginx: trailing slash on `location ^~ /api/v1/bands/` caused 301 redirect on POST, dropping the request body — removed trailing slash
- API: _member_from_request (used by nc-scan stream) only accepted Bearer token, not httpOnly cookie — add rh_token cookie fallback
- API: internal_secret config field now has a dev default so the service starts without INTERNAL_SECRET env var set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 09:43:47 +02:00

82 lines
2.2 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 { 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/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>
);
}