Index: my-react-app/src/App.js
===================================================================
--- my-react-app/src/App.js	(revision 24819a83a22dbf359fe4db74b58795491d96338b)
+++ my-react-app/src/App.js	(revision 8ca35dc93473fb5be3777778a84fedee941c8790)
@@ -1,3 +1,3 @@
-import {BrowserRouter as Router, Route, Routes, useNavigate} from 'react-router-dom';
+import {BrowserRouter as Router, Navigate, Route, Routes, useNavigate} from 'react-router-dom';
 import Customers from './components/Customers';
 import Layout from "./components/Layout";
@@ -14,8 +14,22 @@
 import { CuisineContext } from './components/CuisineContext';
 import RestaurantInfo from "./components/RestaurantInfo";
-import LoginForm from "./components/Login";
+import AuthForm from "./components/AuthForm";
 import AppContent from "./components/AppContent";
+import ReservationHistory from "./components/ReservationHistory";
+
+const ProtectedRoute = ({ element, isAuthenticated }) => {
+    return isAuthenticated ? element : <Navigate to="/login" />;
+};
 
 const App = () => {
+    const [isAuthenticated, setIsAuthenticated] = React.useState(false);
+
+    React.useEffect(() => {
+        const token = localStorage.getItem('token');
+        if (token) {
+            setIsAuthenticated(true);
+        }
+    }, []);
+
     return (
         <Router>
@@ -23,21 +37,22 @@
                 <Routes>
                     <Route path="/" element={<Home />} />
-                    <Route path="/customers" element={<Customers />} />
-                    <Route path="/customers/add" element={<CustomerFormContainer/>} />
-                    <Route path="/customers/:id" element={<CustomerDetails />} />
-                    <Route path="/customers/edit/:id" element={<CustomerFormContainer/>} />
-                    <Route path="/restaurants" element={<Restaurants />} />
-                    <Route path="/restaurants/:id" element={<RestaurantDetails />} />
-                    <Route path="/reservations" element={<Reservations />} />
-                    <Route path="/reservationConfirmation/:tableNumber/:timeSlot/:restaurantId" element={<ReservationConfirmation />} />
-                    <Route path="/reservations/reservationEdit/:reservationId" element={<ReservationEdit />} />
-                    <Route path="/login" element={<LoginForm/>}/>
-                    <Route path="/error" element={<ErrorPage/>}/>
+                    <Route path="/customers" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<Customers />} />} />
+                    <Route path="/customers/add" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<CustomerFormContainer />} />} />
+                    <Route path="/customers/:id" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<CustomerDetails />} />} />
+                    <Route path="/customers/edit/:id" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<CustomerFormContainer />} />} />
+                    <Route path="/restaurants" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<Restaurants />} />} />
+                    <Route path="/restaurants/:id" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<RestaurantDetails />} />} />
+                    <Route path="/reservations" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<Reservations />} />} />
+                    <Route path="/reservationConfirmation/:tableNumber/:timeSlot/:restaurantId" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<ReservationConfirmation />} />} />
+                    <Route path="/reservations/reservationEdit/:reservationId" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<ReservationEdit />} />} />
+                    <Route path="/reservations-past" element={<ProtectedRoute isAuthenticated={isAuthenticated} element={<ReservationHistory />} />} />
+                    <Route path="/login" element={<AuthForm setIsAuthenticated={setIsAuthenticated} />} />
+
+                    <Route path="/error" element={<ErrorPage />} />
                 </Routes>
-                <AppContent/>
             </Layout>
         </Router>
     );
-}
+};
 
 
@@ -149,5 +164,5 @@
 
         try {
-            const response = await axios.post('http://localhost:8080/api/search', data);
+            const response = await axios.post('http://localhost:8081/api/search', data);
             const filteredRestaurants = response.data;
             setFilteredRestaurants(filteredRestaurants);
@@ -163,5 +178,5 @@
         const cuisineName = cuisine.replace('Searching by cuisine: ', '');
         try {
-            const response = await axios.post(`http://localhost:8080/api/search/shortcut/${cuisineName}`, cuisineName);
+            const response = await axios.post(`http://localhost:8081/api/search/shortcut/${cuisineName}`, cuisineName);
             console.log(response.data);
             setFilteredRestaurants(response.data)
