File size: 6,536 Bytes
bcce530
 
 
 
 
 
9f93ce6
bcce530
 
 
 
 
 
 
9f93ce6
 
 
bcce530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9f93ce6
bcce530
 
 
 
 
 
 
 
 
 
 
 
 
 
9f93ce6
bcce530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9f93ce6
 
 
 
 
 
 
bcce530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9f93ce6
 
bcce530
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
import type { Metadata } from "next"
import "./globals.css"
import { Suspense } from "react"
import { Inter, Playfair_Display, JetBrains_Mono } from "next/font/google"
import { ThemeProvider } from "@/components/providers/theme-provider"
import { AuthProvider } from "@/components/providers/auth-provider"
import { ServiceWorkerRegistration } from "@/components/providers/service-worker"
import { OllamaProvider } from "@/contexts/ollama-context"
import { Header } from "@/components/layout/header"
import { Footer } from "@/components/layout/footer"
import { KeyboardShortcuts } from "@/components/layout/keyboard-shortcuts"
import { OnboardingTour } from "@/components/onboarding/onboarding-tour"
import { generateWebsiteSchema, generateOrganizationSchema, generateSoftwareApplicationSchema } from "@/lib/seo"

// Validate environment on import (dev only)
import "@/lib/env"

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-inter",
  display: "swap",
})

const playfair = Playfair_Display({
  subsets: ["latin"],
  variable: "--font-playfair",
  display: "swap",
})

const jetbrainsMono = JetBrains_Mono({
  subsets: ["latin"],
  variable: "--font-jetbrains",
  display: "swap",
})

const BASE_URL = process.env.NEXT_PUBLIC_APP_URL || 'https://open-prompt.netlify.app'

export const metadata: Metadata = {
  metadataBase: new URL(BASE_URL),
  title: {
    default: "OpenPrompt | The GitHub for AI Prompts",
    template: "%s | OpenPrompt",
  },
  description: "Transform AI prompts into shareable micro-apps. Create, remix, and run prompts with zero friction. 177+ AI tools, multi-model support, and browser extension.",
  keywords: [
    "AI prompts",
    "prompt engineering",
    "ChatGPT prompts",
    "Claude prompts",
    "Gemini prompts",
    "AI tools",
    "prompt marketplace",
    "micro-apps",
    "GPT-4",
    "prompt optimizer",
    "AI writing tools",
    "prompt templates",
    "Midjourney prompts",
    "DALL-E prompts",
    "Stable Diffusion prompts",
  ],
  authors: [{ name: "Anky9972", url: "https://github.com/Anky9972" }],
  creator: "OpenPrompt",
  publisher: "OpenPrompt",
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      "max-video-preview": -1,
      "max-image-preview": "large",
      "max-snippet": -1,
    },
  },
  openGraph: {
    title: "OpenPrompt | The GitHub for AI Prompts",
    description: "Transform AI prompts into shareable micro-apps. 177+ AI tools, multi-model support, and browser extension.",
    url: BASE_URL,
    siteName: "OpenPrompt",
    images: [
      {
        url: `${BASE_URL}/api/og?title=OpenPrompt&description=The+GitHub+for+AI+Prompts`,
        width: 1200,
        height: 630,
        alt: "OpenPrompt - The GitHub for AI Prompts",
      },
    ],
    locale: "en_US",
    type: "website",
  },
  twitter: {
    card: "summary_large_image",
    title: "OpenPrompt | The GitHub for AI Prompts",
    description: "Transform AI prompts into shareable micro-apps. 177+ AI tools, multi-model support.",
    creator: "@anky_vivek",
    site: "@openprompt",
    images: [`${BASE_URL}/api/og?title=OpenPrompt&description=The+GitHub+for+AI+Prompts`],
  },
  icons: {
    icon: [
      { url: "/logos/logo.svg", type: "image/svg+xml" },
      { url: "/favicon.ico", sizes: "32x32" },
    ],
    shortcut: "/logos/logo.svg",
    apple: [
      { url: "/logos/icon.png", sizes: "180x180" },
    ],
    other: [
      {
        rel: "apple-touch-icon-precomposed",
        url: "/logos/icon.png",
      },
      {
        rel: "mask-icon",
        url: "/logos/logo.svg",
        color: "#6366f1",
      },
    ],
  },
  manifest: "/manifest.json",
  alternates: {
    canonical: BASE_URL,
  },
  verification: {
    google: "google60f35921954050fd",
  },
  category: "technology",
  classification: "AI Tools, Productivity, Developer Tools",
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode
}>) {
  const websiteSchema = generateWebsiteSchema()
  const organizationSchema = generateOrganizationSchema()
  const softwareSchema = generateSoftwareApplicationSchema()

  return (
    <html lang="en" className={`${inter.variable} ${playfair.variable} ${jetbrainsMono.variable}`} suppressHydrationWarning>
      <head>
        {/* JSON-LD Structured Data */}
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(websiteSchema) }}
        />
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(organizationSchema) }}
        />
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(softwareSchema) }}
        />
        {/* Preconnect to external services for faster loading */}
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
        {/* DNS prefetch for AI API endpoints */}
        <link rel="dns-prefetch" href="https://api.openai.com" />
        <link rel="dns-prefetch" href="https://api.anthropic.com" />
        <link rel="dns-prefetch" href="https://generativelanguage.googleapis.com" />
      </head>
      <body className="min-h-screen bg-background antialiased" suppressHydrationWarning>
        <AuthProvider>
          <ThemeProvider
            attribute="class"
            defaultTheme="dark"
            enableSystem
            disableTransitionOnChange
          >
            <OllamaProvider>
              <Suspense fallback={
                <div className="relative flex min-h-screen flex-col">
                  <div className="h-16 border-b border-border" />
                  <main className="flex-1 flex items-center justify-center">
                    <div className="h-8 w-8 border-4 border-primary border-t-transparent rounded-full animate-spin" />
                  </main>
                </div>
              }>
                <div className="relative flex min-h-screen flex-col">
                  <Header />
                  <main className="flex-1">{children}</main>
                  <Footer />
                  <KeyboardShortcuts />
                  <OnboardingTour />
                </div>
              </Suspense>
              {/* PWA Service Worker Registration */}
              <ServiceWorkerRegistration />
            </OllamaProvider>
          </ThemeProvider>
        </AuthProvider>
      </body>
    </html>
  )
}