Add a new frontend page — component, route, navigation link
Follow this workflow when adding a new page to NeuroBoost.
Create web/src/pages/{Name}/{Name}Page.tsx:
export default function ExamplePage() {
const { user } = useAuth();
return (
<div className="p-6">
<h1 className="text-2xl font-bold mb-4">Page Title</h1>
{/* Page content */}
</div>
);
}
useAuth() from contexts/AuthContext for user dataapi/ for data fetchingIn web/src/router.tsx, add:
{
path: '/example',
element: <ProtectedRoute><ExamplePage /></ProtectedRoute>,
}
<ProtectedRoute> wrapper for authenticated pagesIn web/src/components/Layout/NavigationMenu.tsx, add a menu item:
{ path: '/example', label: 'Example', icon: ExampleIcon }
cd web && pnpm typecheck && pnpm build
Check that the page renders correctly at the route URL.