Skip to main content

ReactRouter

Maintenance Log Frontend - Tenth Week: Frontend Auth, Routing, and API Client Structure

Devlog Week 10: Frontend Auth, Routing, and API Client Structure # This entry covers the “plumbing” for the React frontend: the route layout, guarded routes by role, auth rehydration, and an API layer split by domain. What Changed # Vite + React + React Router setup with a domain-organized structure (pages/, components/, utils/, context/, styles/) Declarative nested routing with a layout route and <Outlet /> Auth context for user state, token rehydration, and role checks ProtectedRoute component for nestable route protection API layer split by domain with a shared apiRequest() helper Routing: Nested Layout + Guards # The router is set up as nested routes: