c5ca3ca992
Implement local user authentication with password hashing, add admin roles for user management and audit log viewing, and introduce audit logging for critical actions. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 776963d0-f75d-42e2-a57b-cc36bdff8495 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 832a44ff-12ae-4096-8a0d-666ec083d536 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0683fb79-a27c-485c-9333-5f4b288c4567/776963d0-f75d-42e2-a57b-cc36bdff8495/1p7jhzu Replit-Helium-Checkpoint-Created: true
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { Switch, Route, Router as WouterRouter } from "wouter";
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { Toaster } from "@/components/ui/toaster";
|
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
|
|
// Pages
|
|
import Home from "@/pages/home";
|
|
import ToolsBrowse from "@/pages/tools-browse";
|
|
import ToolDetail from "@/pages/tool-detail";
|
|
import ToolNew from "@/pages/tool-new";
|
|
import ToolEdit from "@/pages/tool-edit";
|
|
import Analytics from "@/pages/analytics";
|
|
import Admin from "@/pages/admin";
|
|
import Login from "@/pages/login";
|
|
import NotFound from "@/pages/not-found";
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
refetchOnWindowFocus: false,
|
|
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
},
|
|
},
|
|
});
|
|
|
|
function Router() {
|
|
return (
|
|
<Switch>
|
|
<Route path="/" component={Home} />
|
|
<Route path="/login" component={Login} />
|
|
<Route path="/tools" component={ToolsBrowse} />
|
|
<Route path="/tools/new" component={ToolNew} />
|
|
<Route path="/tools/:id/edit" component={ToolEdit} />
|
|
<Route path="/tools/:id" component={ToolDetail} />
|
|
<Route path="/analytics" component={Analytics} />
|
|
<Route path="/admin" component={Admin} />
|
|
<Route component={NotFound} />
|
|
</Switch>
|
|
);
|
|
}
|
|
|
|
function App() {
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
<TooltipProvider>
|
|
<WouterRouter base={import.meta.env.BASE_URL.replace(/\/$/, "")}>
|
|
<Router />
|
|
</WouterRouter>
|
|
<Toaster />
|
|
</TooltipProvider>
|
|
</QueryClientProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|