From 8b5c53ef4c93a5a73eb790f3f47836312813c190 Mon Sep 17 00:00:00 2001 From: Chandini Date: Wed, 17 Sep 2025 10:16:20 +0530 Subject: [PATCH] frontend changes --- package.json | 2 +- src/app/auth/emailVerification.tsx | 4 +-- src/app/layout.tsx | 17 +++++------ src/components/main-dashboard.tsx | 13 +++++--- src/config/backend.ts | 4 +-- src/lib/template-service.ts | 49 +++--------------------------- 6 files changed, 26 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index 86232ea..9eb06de 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev --turbopack -p 3001", + "dev": "next dev -p 3001", "build": "next build", "start": "next start -p 3001", "lint": "next lint" diff --git a/src/app/auth/emailVerification.tsx b/src/app/auth/emailVerification.tsx index 03f5dac..b0a3cb3 100644 --- a/src/app/auth/emailVerification.tsx +++ b/src/app/auth/emailVerification.tsx @@ -14,7 +14,7 @@ interface VerificationResponse { } // Removed unused ErrorResponse interface - + const EmailVerification: React.FC = () => { const searchParams = useSearchParams(); @@ -57,7 +57,7 @@ const EmailVerification: React.FC = () => { console.log("Raw response text:", txt); console.log("Response status:", res.status); console.log("Response headers:", Object.fromEntries(res.headers.entries())); - + let data: Record = {}; try { data = JSON.parse(txt || "{}"); } catch { /* ignore non-JSON */ } console.log("Parsed response data:", data); diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 298070c..0ec7c73 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,18 +1,11 @@ import type React from "react" import type { Metadata } from "next" -import { Poppins } from "next/font/google" import { AuthProvider } from "@/contexts/auth-context" import { AppLayout } from "@/components/layout/app-layout" import { ToastProvider } from "@/components/ui/toast" import "./globals.css" import "@tldraw/tldraw/tldraw.css" -const poppins = Poppins({ - subsets: ["latin"], - weight: ["300", "400", "500", "600", "700"], - variable: "--font-poppins", -}) - export const metadata: Metadata = { title: "Codenuk - AI-Powered Project Builder", description: "Build scalable applications with AI-generated architecture and code", @@ -27,10 +20,16 @@ export default function RootLayout({ return ( + + + diff --git a/src/components/main-dashboard.tsx b/src/components/main-dashboard.tsx index 73a99e6..ecdf34f 100644 --- a/src/components/main-dashboard.tsx +++ b/src/components/main-dashboard.tsx @@ -884,6 +884,8 @@ function FeatureSelectionStep({ }: { template: Template; onNext: (selected: TemplateFeature[]) => void; onBack: () => void }) { const { fetchFeatures, createFeature, updateFeature, deleteFeature } = useTemplates() const [features, setFeatures] = useState([]) + const [essentialFeatures, setEssentialFeatures] = useState([]) + const [customFeatures, setCustomFeatures] = useState([]) const [loading, setLoading] = useState(true) const [error, setError] = useState(null) const [selectedIds, setSelectedIds] = useState>(new Set()) @@ -917,6 +919,9 @@ function FeatureSelectionStep({ }) console.log('[FeatureSelectionStep] All features with types:', data.map(f => ({ name: f.name, type: f.feature_type }))) setFeatures(data) + // Separate custom features from essential features + setEssentialFeatures(data.filter(f => f.feature_type !== 'custom')) + setCustomFeatures(data.filter(f => f.feature_type === 'custom')) } catch (e) { console.error('[FeatureSelectionStep] Error loading features:', e) setError(e instanceof Error ? e.message : 'Failed to load features') @@ -1085,10 +1090,10 @@ function FeatureSelectionStep({

Select Features for {template.title}

-

Choose defaults or add your own custom features.

+

Choose from essential and suggested features.

- {features.length > 0 && section('Template Features', features)} + {essentialFeatures.length > 0 && section('Essential Features', essentialFeatures)} {/* Add custom feature with AI */}
@@ -1110,7 +1115,7 @@ function FeatureSelectionStep({
- {section('Your Custom Features', custom)} + {customFeatures.length > 0 && section('Custom Features', customFeatures)} {(showAIModal || editingFeature) && (