diff --git a/src/App.tsx b/src/App.tsx index 4e00d6f5..654a662e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -26,56 +26,48 @@ const queryClient = new QueryClient(); const App = () => ( - - - -
- - - - - {/* Public routes - no auth required */} - } /> - } /> - } /> - } /> - } /> - } /> - - {/* Protected routes - auth required */} - - - - - - - - } /> - - - - - - - - } /> - - - - - - - - } /> - - -
-
-
-
+ + + + + +
+ + + + + {/* Public routes - no auth required */} + } /> + } /> + } /> + } /> + } /> + } /> + + {/* Protected routes - auth required */} + + + + } /> + + + + } /> + + + + } /> + + +
+
+
+
+
+
); diff --git a/src/lib/convex.ts b/src/lib/convex.ts index faa26bd7..fc1bfde5 100644 --- a/src/lib/convex.ts +++ b/src/lib/convex.ts @@ -3,7 +3,14 @@ import { ConvexReactClient } from "convex/react"; const convexUrl = import.meta.env.VITE_CONVEX_URL; if (!convexUrl) { - throw new Error("VITE_CONVEX_URL environment variable is not set"); + console.warn("⚠️ Missing Convex URL - Database will be disabled"); + console.log("💡 To enable database:"); + console.log(" 1. Get a Convex deployment URL from: https://dashboard.convex.dev"); + console.log(" 2. Add VITE_CONVEX_URL=https://your-app.convex.cloud to .env.local"); + console.log(" 3. Restart the development server"); } -export const convex = new ConvexReactClient(convexUrl); \ No newline at end of file +// Create a mock client for development when URL is missing +export const convex = convexUrl + ? new ConvexReactClient(convexUrl) + : new ConvexReactClient("https://mock-convex-url.convex.cloud"); // Mock URL for development \ No newline at end of file diff --git a/src/main.tsx b/src/main.tsx index c8ecae0e..affcf928 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -51,7 +51,11 @@ if (import.meta.env.PROD) { const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY; if (!PUBLISHABLE_KEY) { - throw new Error("Missing Clerk Publishable Key - Check your environment configuration"); + console.warn("⚠️ Missing Clerk Publishable Key - Authentication will be disabled"); + console.log("💡 To enable authentication:"); + console.log(" 1. Get a Clerk key from: https://dashboard.clerk.com"); + console.log(" 2. Add VITE_CLERK_PUBLISHABLE_KEY=pk_test_... to .env.local"); + console.log(" 3. Restart the development server"); } // Security validation for production - temporarily disabled for development @@ -76,27 +80,85 @@ const posthogOptions = { } }; +// Fallback component when authentication is not configured +const UnauthenticatedApp = () => ( +
+
+
+
+ + + +
+

ZapDev AI Platform

+

Authentication Setup Required

+
+ +
+

Quick Setup:

+
+
+ 1 +
+

Get Clerk API Key

+

Visit dashboard.clerk.com

+
+
+
+ 2 +
+

Get Convex URL

+

Visit dashboard.convex.dev

+
+
+
+ 3 +
+

Update .env.local

+ +VITE_CLERK_PUBLISHABLE_KEY=pk_test_...
+VITE_CONVEX_URL=https://your-app.convex.cloud +
+
+
+
+
+ + +
+
+); + root.render( - - - - - - - + + + + + + + ) : ( + + )} ); \ No newline at end of file