diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index d628be3..1759338 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -1,83 +1,86 @@
-import { useState } from 'react'
+import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
+import { AuthProvider, useAuth } from './contexts/AuthContext';
+import Login from './pages/Login';
+import Dashboard from './pages/Dashboard';
-function App() {
- const [count, setCount] = useState(0)
+// Protected route wrapper
+function ProtectedRoute({ children }: { children: React.ReactNode }) {
+ const { user, isLoading } = useAuth();
- return (
-
-
+ if (isLoading) {
+ return (
+
-
- 🏠 Family Hub
-
-
- Home Management System
-
-
-
-
Welcome!
-
- Family Hub is starting up. The backend API should be available at{' '}
-
- http://localhost:8000/docs
-
-
-
-
-
-
-
-
-
-
✅ Phase 1 Complete:
-
- - Backend API with authentication
- - Database models for users, chores, meals
- - React frontend foundation
- - Docker setup
-
-
-
-
-
🚧 Coming Next (Phase 2):
-
- - Chore management system
- - User login interface
- - Dashboard with today's tasks
- - Assignment and completion tracking
-
-
-
-
-
-
-
-
-
-
🏡 Home Assistant
-
Phase 6
-
-
+
+
Loading...
-
- )
+ );
+ }
+
+ if (!user) {
+ return
;
+ }
+
+ return <>{children}>;
}
-export default App
+// Public route wrapper (redirects to dashboard if already logged in)
+function PublicRoute({ children }: { children: React.ReactNode }) {
+ const { user, isLoading } = useAuth();
+
+ if (isLoading) {
+ return (
+
+ );
+ }
+
+ if (user) {
+ return
;
+ }
+
+ return <>{children}>;
+}
+
+function App() {
+ return (
+
+
+
+ {/* Public routes */}
+
+
+
+ }
+ />
+
+ {/* Protected routes */}
+
+
+
+ }
+ />
+
+ {/* Default route */}
+ } />
+
+ {/* 404 catch-all */}
+ } />
+
+
+
+ );
+}
+
+export default App;