- Added user, session, account, and verification models to Prisma schema. - Integrated better-auth for user authentication with email and password. - Created auth middleware for session validation. - Implemented auth context and client in frontend for managing user sessions. - Added login and settings pages for user authentication and password management. - Updated routes to include authentication checks and user-specific content. - Enhanced UI components to reflect authentication state.
32 lines
860 B
TypeScript
32 lines
860 B
TypeScript
import { StrictMode } from "react";
|
|
import { createRoot } from "react-dom/client";
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
import { ThemeProvider } from "@/lib/theme";
|
|
import { AuthProvider } from "@/lib/auth-context";
|
|
import App from "./App";
|
|
import "./index.css";
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 30_000,
|
|
retry: 2,
|
|
refetchOnWindowFocus: true,
|
|
},
|
|
},
|
|
});
|
|
|
|
createRoot(document.getElementById("root")!).render(
|
|
<StrictMode>
|
|
<ThemeProvider>
|
|
<QueryClientProvider client={queryClient}>
|
|
<AuthProvider>
|
|
<App />
|
|
</AuthProvider>
|
|
<ReactQueryDevtools initialIsOpen={false} />
|
|
</QueryClientProvider>
|
|
</ThemeProvider>
|
|
</StrictMode>,
|
|
);
|