Adds a complete user authentication system and a protected dashboard. - Implements JWT-based authentication using ElysiaJS. - Integrates Prisma for database access and user management. - Creates a login page and protected routes for the dashboard. - Adds a dashboard layout with pages for API key management. - Includes necessary UI components from Mantine.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
|
|
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
|
import Home from "./pages/Home";
|
|
import NotFound from "./pages/NotFound";
|
|
import Login from "./pages/Login";
|
|
import ProtectedRoute from "./components/ProtectedRoute";
|
|
import Dashboard from "./pages/dashboard/dashboard_page";
|
|
import DashboardLayout from "./pages/dashboard/dashboard_layout";
|
|
import ApiKeyPage from "./pages/dashboard/apikey/apikey_page";
|
|
|
|
export default function AppRoutes() {
|
|
return (
|
|
<BrowserRouter>
|
|
<Routes>
|
|
<Route path="/" element={<Home />} />
|
|
<Route path="/login" element={<Login />} />
|
|
<Route element={<ProtectedRoute />}>
|
|
<Route path="/dashboard" element={<DashboardLayout />}>
|
|
<Route index element={<Dashboard />} />
|
|
<Route path="landing" element={<Dashboard />} />
|
|
<Route path="apikey" element={<ApiKeyPage />} />
|
|
</Route>
|
|
</Route>
|
|
|
|
<Route path="*" element={<NotFound />} />
|
|
</Routes>
|
|
</BrowserRouter>
|
|
);
|
|
}
|
|
|
|
|
|
|