Skip to content

Commit f35b53d

Browse files
prompts & settings optimized
1 parent cde5791 commit f35b53d

File tree

21 files changed

+3020
-295
lines changed

21 files changed

+3020
-295
lines changed

app/layout.tsx

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,66 @@
1-
import { ThemeProvider } from 'next-themes'
2-
import { Toaster } from '@/components/ui/toaster'
31
import './globals.css'
2+
import { AuthProvider, PostHogProvider, ThemeProvider } from './providers'
3+
import { Toaster } from '@/components/ui/toaster'
4+
import type { Metadata } from 'next'
5+
import { Inter } from 'next/font/google'
6+
7+
const inter = Inter({ subsets: ['latin'] })
8+
9+
export const metadata: Metadata = {
10+
metadataBase: new URL('https://codingit.vercel.app'),
11+
title: 'CodinIT',
12+
keywords: [
13+
'AI software engineer',
14+
'open source',
15+
'live code execution',
16+
'file uploads',
17+
'real-time chat',
18+
'codinit',
19+
'codingit',
20+
'lovable.dev alternative',
21+
'bolt.new alternative',
22+
'v0.dev alternative'
23+
],
24+
description: 'Open-source alternative to lovable.dev, bolt.new & v0.dev. AI software engineer — live code execution, file uploads, & real-time chat blazing-fast.',
25+
icons: [
26+
{ rel: "apple-touch-icon", sizes: "180x180", url: "/apple-touch-icon.png" },
27+
{ rel: "icon", type: "image/x-icon", url: "/favicon.ico" },
28+
{ rel: "icon", type: "image/png", sizes: "32x32", url: "/icons/favicon-32x32.png" },
29+
{ rel: "icon", type: "image/png", sizes: "16x16", url: "/icons/favicon-16x16.png" },
30+
{ rel: "icon", type: "image/png", sizes: "192x192", url: "/android-chrome-192x192.png" },
31+
{ rel: "icon", type: "image/png", sizes: "512x512", url: "/android-chrome-512x512.png" }
32+
],
33+
openGraph: {
34+
title: "CodinIT.dev",
35+
description: "Open-source alternative to lovable.dev, bolt.new & v0.dev. AI software engineer — live code execution, file uploads, & real-time chat blazing-fast.",
36+
images: ["/opengraph.png"],
37+
url: "https://codingit.vercel.app",
38+
siteName: "CodinIT.dev",
39+
type: "website",
40+
locale: "en_US",
41+
}
42+
}
443

544
export default function RootLayout({
645
children,
7-
}: {
46+
}: Readonly<{
847
children: React.ReactNode
9-
}) {
48+
}>) {
1049
return (
1150
<html lang="en" suppressHydrationWarning>
1251
<body>
1352
<ThemeProvider
1453
attribute="class"
15-
defaultTheme="system"
54+
defaultTheme="dark"
1655
enableSystem
1756
disableTransitionOnChange
1857
>
19-
{children}
58+
<PostHogProvider>
59+
<AuthProvider>{children}</AuthProvider>
60+
</PostHogProvider>
2061
<Toaster />
2162
</ThemeProvider>
2263
</body>
2364
</html>
2465
)
25-
}
66+
}

app/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,6 @@ export default function Home() {
341341
)}
342342

343343
<Sidebar
344-
onStateChange={setSidebarOpen}
345-
userName={userTeam?.name}
346344
userPlan={userTeam?.tier}
347345
/>
348346

@@ -421,4 +419,4 @@ export default function Home() {
421419
</div>
422420
</main>
423421
)
424-
}
422+
}

app/providers.tsx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,31 @@
22

33
import { ThemeProvider as NextThemesProvider } from 'next-themes'
44
import { type ThemeProviderProps } from 'next-themes/dist/types'
5-
import posthog from 'posthog-js'
6-
import { PostHogProvider as PostHogProviderJS } from 'posthog-js/react'
5+
import { PostHogProvider as PHProvider } from 'posthog-js/react'
6+
import { AuthProvider as AuthContextProvider } from '@/lib/auth-provider'
77

8-
if (typeof window !== 'undefined' && process.env.NEXT_PUBLIC_ENABLE_POSTHOG) {
9-
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY ?? '', {
10-
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
11-
person_profiles: 'identified_only',
12-
session_recording: {
13-
recordCrossOriginIframes: true,
14-
}
15-
})
8+
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
9+
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
1610
}
1711

1812
export function PostHogProvider({ children }: { children: React.ReactNode }) {
19-
return process.env.NEXT_PUBLIC_ENABLE_POSTHOG ? (
20-
<PostHogProviderJS client={posthog}>{children}</PostHogProviderJS>
21-
) : (
22-
children
13+
if (!process.env.NEXT_PUBLIC_POSTHOG_KEY) {
14+
return <>{children}</>
15+
}
16+
17+
return (
18+
<PHProvider
19+
apiKey={process.env.NEXT_PUBLIC_POSTHOG_KEY}
20+
options={{
21+
api_host: process.env.NEXT_PUBLIC_POSTHog_HOST,
22+
capture_pageview: false // Disable automatic pageview capture, as we capture manually
23+
}}
24+
>
25+
{children}
26+
</PHProvider>
2327
)
2428
}
2529

26-
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
27-
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
30+
export function AuthProvider({ children }: { children: React.ReactNode }) {
31+
return <AuthContextProvider>{children}</AuthContextProvider>
2832
}

app/settings/billing/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ export default function BillingSettings() {
294294
Cancels on {formatDate(billingInfo.subscription.current_period_end)}
295295
</p>
296296
)}
297-
{!billingInfo?.subscription.cancel_at_period_end && billingInfo?.subscription.plan !== 'free' && (
297+
{billingInfo && !billingInfo.subscription.cancel_at_period_end && billingInfo.subscription.plan !== 'free' && (
298298
<p className="text-sm text-muted-foreground mt-1">
299-
Renews on {formatDate(billingInfo?.subscription.current_period_end || '')}
299+
Renews on {formatDate(billingInfo.subscription.current_period_end)}
300300
</p>
301301
)}
302302
</div>

app/settings/integrations/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,9 @@ export default function IntegrationsSettings() {
164164
const success = await disconnectUserIntegration(session.user.id, serviceId)
165165

166166
if (success) {
167-
// Update local state
168167
setIntegrations(integrations.map(integration =>
169168
integration.service_name === serviceId
170-
? { ...integration, is_connected: false, connection_data: undefined }
169+
? { ...integration, is_connected: false, connection_data: {} }
171170
: integration
172171
))
173172

app/settings/privacy/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// File: app/settings/privacy/page.tsx
21
'use client'
32

43
import { Button } from '@/components/ui/button'

app/settings/profile/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Separator } from '@/components/ui/separator'
1616
import { useToast } from '@/components/ui/use-toast'
1717
import { Sparkles, Zap, Loader2 } from 'lucide-react'
1818
import { useState, useEffect } from 'react'
19-
import { useAuth } from '@/lib/auth'
19+
import { useAuthContext } from '@/lib/auth-provider'
2020
import {
2121
getUserProfile,
2222
getUserPreferences,
@@ -27,7 +27,7 @@ import {
2727
} from '@/lib/user-settings'
2828

2929
export default function ProfileSettings() {
30-
const { session } = useAuth(() => {}, () => {})
30+
const { session } = useAuthContext()
3131
const { toast } = useToast()
3232

3333
// Form state
@@ -279,4 +279,4 @@ export default function ProfileSettings() {
279279
</div>
280280
</div>
281281
)
282-
}
282+
}

0 commit comments

Comments
 (0)