2026-02-06 19:43:14 +05:30
import type { Metadata , Viewport } from "next" ;
2025-04-07 23:47:06 -07:00
import "./globals.css" ;
2025-12-20 04:24:40 -08:00
import { RootProvider } from "fumadocs-ui/provider/next" ;
2025-04-07 23:47:06 -07:00
import { Roboto } from "next/font/google" ;
2026-06-19 03:56:26 +05:30
import Script from "next/script" ;
2026-02-12 16:12:45 -08:00
import { AnnouncementToastProvider } from "@/components/announcements/AnnouncementToastProvider" ;
2026-05-26 11:57:50 +05:30
import { DesktopUpdateToast } from "@/components/desktop/desktop-update-toast" ;
2026-06-24 03:55:40 +05:30
import { AuthCutoverPurge } from "@/components/providers/AuthCutoverPurge" ;
2026-01-25 16:15:25 +05:30
import { GlobalLoadingProvider } from "@/components/providers/GlobalLoadingProvider" ;
2025-10-27 20:30:10 -07:00
import { I18nProvider } from "@/components/providers/I18nProvider" ;
2025-12-25 13:53:41 -08:00
import { PostHogProvider } from "@/components/providers/PostHogProvider" ;
2026-03-24 16:07:28 +02:00
import { ZeroProvider } from "@/components/providers/ZeroProvider" ;
2026-04-14 21:26:00 -07:00
import {
OrganizationJsonLd ,
SoftwareApplicationJsonLd ,
WebSiteJsonLd ,
} from "@/components/seo/json-ld" ;
2025-04-07 23:47:06 -07:00
import { ThemeProvider } from "@/components/theme/theme-provider" ;
2025-07-27 10:05:37 -07:00
import { Toaster } from "@/components/ui/sonner" ;
feat(i18n): Add next-intl framework with full bilingual support (EN/ZH)
- Implement next-intl framework for scalable i18n
- Add complete Chinese (Simplified) localization
- Support 400+ translated strings across all pages
- Add language switcher with persistent preference
- Zero breaking changes to existing functionality
Framework additions:
- i18n routing and middleware
- LocaleContext for client-side state
- LanguageSwitcher component
- Translation files (en.json, zh.json)
Translated components:
- Homepage: Hero, features, CTA, navbar
- Auth: Login, register
- Dashboard: Main page, layout
- Connectors: Management, add page (all categories)
- Documents: Upload, manage, filters
- Settings: LLM configs, role assignments
- Onboarding: Add provider, assign roles
- Logs: Task logs viewer
Adding a new language now requires only:
1. Create messages/<locale>.json
2. Add locale to i18n/routing.ts
2025-10-26 14:05:46 +08:00
import { LocaleProvider } from "@/contexts/LocaleContext" ;
2026-04-07 00:43:40 -07:00
import { PlatformProvider } from "@/contexts/platform-context" ;
2026-06-25 04:31:22 +05:30
import { BUILD_TIME_AUTH_TYPE } from "@/lib/env-config" ;
2025-11-11 04:02:04 +02:00
import { ReactQueryClientProvider } from "@/lib/query-client/query-client.provider" ;
2026-06-25 04:31:22 +05:30
import { getRuntimeAuthInitScript , resolveRuntimeAuthUiMode } from "@/lib/runtime-auth-config" ;
2025-10-27 20:30:10 -07:00
import { cn } from "@/lib/utils" ;
2025-04-07 23:47:06 -07:00
2025-07-27 10:05:37 -07:00
const roboto = Roboto ( {
subsets : [ "latin" ] ,
weight : [ "400" , "500" , "700" ] ,
display : "swap" ,
variable : "--font-roboto" ,
2025-04-07 23:47:06 -07:00
} ) ;
2026-02-06 19:43:14 +05:30
/ * *
* Viewport configuration for mobile keyboard handling .
* - interactiveWidget : 'resizes-content' tells mobile browsers ( especially Chrome Android )
* to resize the CSS layout viewport when the virtual keyboard opens , so sticky elements
* ( like the chat input bar ) stay visible above the keyboard .
* - viewportFit : 'cover' enables env ( safe - area - inset - * ) for notched / home - indicator devices .
* /
export const viewport : Viewport = {
width : "device-width" ,
initialScale : 1 ,
viewportFit : "cover" ,
interactiveWidget : "resizes-content" ,
} ;
2025-04-07 23:47:06 -07:00
export const metadata : Metadata = {
2026-05-15 12:35:15 -07:00
metadataBase : new URL ( "https://www.surfsense.com" ) ,
2026-04-11 23:38:12 -07:00
alternates : {
2026-05-15 12:35:15 -07:00
canonical : "https://www.surfsense.com" ,
2026-04-11 23:38:12 -07:00
} ,
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
title : "SurfSense - Competitive Intelligence Platform for AI Agents" ,
2025-07-27 10:05:37 -07:00
description :
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
"SurfSense is an open-source competitive intelligence platform. Your AI agents monitor competitors, track rankings, and listen to your market through one API or MCP server." ,
2025-07-27 10:05:37 -07:00
keywords : [
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
"competitive intelligence platform" ,
"competitive intelligence software" ,
"market intelligence tools" ,
"competitor monitoring" ,
"competitor price monitoring" ,
"brand monitoring" ,
"rank tracking" ,
"social listening" ,
"mcp server" ,
"agent harness" ,
"open source competitive intelligence" ,
2025-07-27 10:05:37 -07:00
"SurfSense" ,
] ,
openGraph : {
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
title : "SurfSense - Competitive Intelligence Platform for AI Agents" ,
2025-07-27 10:05:37 -07:00
description :
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
"SurfSense is an open-source competitive intelligence platform. Your AI agents monitor competitors, track rankings, and listen to your market through one API or MCP server." ,
2026-05-15 12:35:15 -07:00
url : "https://www.surfsense.com" ,
2025-07-27 10:05:37 -07:00
siteName : "SurfSense" ,
type : "website" ,
images : [
{
2026-04-11 23:38:12 -07:00
url : "/og-image.png" ,
2025-07-27 10:05:37 -07:00
width : 1200 ,
height : 630 ,
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
alt : "SurfSense - Competitive Intelligence Platform for AI Agents" ,
2025-07-27 10:05:37 -07:00
} ,
] ,
locale : "en_US" ,
} ,
twitter : {
card : "summary_large_image" ,
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
title : "SurfSense - Competitive Intelligence Platform for AI Agents" ,
2025-07-27 10:05:37 -07:00
description :
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
"SurfSense is an open-source competitive intelligence platform. Your AI agents monitor competitors, track rankings, and listen to your market through one API or MCP server." ,
2026-04-11 23:38:12 -07:00
creator : "@SurfSenseAI" ,
site : "@SurfSenseAI" ,
2025-07-27 10:05:37 -07:00
images : [
{
2026-04-11 23:38:12 -07:00
url : "/og-image-twitter.png" ,
2025-07-27 10:05:37 -07:00
width : 1200 ,
height : 630 ,
feat(marketing): CI-first homepage, connector API pages, and hero chat demo
- Homepage rebuilt around competitive-intelligence positioning: connector grid,
how-it-works, use-case art, compare table, FAQ, and a scripted new-chat hero
demo (typewriter prompt, agent timeline, streamed answer, /login on send)
- Marketing pages for the Reddit/YouTube/Maps/SERP/Web Crawl scrape APIs at
/<slug>, a /connectors hub, and a bespoke /mcp-connector page
- Remove stale app/dashboard/[search_space_id] tree that broke the build
(canonical route is [workspace_id])
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 20:28:27 -07:00
alt : "SurfSense - Competitive Intelligence Platform for AI Agents" ,
2025-07-27 10:05:37 -07:00
} ,
] ,
} ,
2025-04-07 23:47:06 -07:00
} ;
feat(i18n): Add next-intl framework with full bilingual support (EN/ZH)
- Implement next-intl framework for scalable i18n
- Add complete Chinese (Simplified) localization
- Support 400+ translated strings across all pages
- Add language switcher with persistent preference
- Zero breaking changes to existing functionality
Framework additions:
- i18n routing and middleware
- LocaleContext for client-side state
- LanguageSwitcher component
- Translation files (en.json, zh.json)
Translated components:
- Homepage: Hero, features, CTA, navbar
- Auth: Login, register
- Dashboard: Main page, layout
- Connectors: Management, add page (all categories)
- Documents: Upload, manage, filters
- Settings: LLM configs, role assignments
- Onboarding: Add provider, assign roles
- Logs: Task logs viewer
Adding a new language now requires only:
1. Create messages/<locale>.json
2. Add locale to i18n/routing.ts
2025-10-26 14:05:46 +08:00
export default function RootLayout ( {
2025-07-27 10:05:37 -07:00
children ,
2025-04-07 23:47:06 -07:00
} : Readonly < {
2025-07-27 10:05:37 -07:00
children : React.ReactNode ;
2025-04-07 23:47:06 -07:00
} > ) {
feat(i18n): Add next-intl framework with full bilingual support (EN/ZH)
- Implement next-intl framework for scalable i18n
- Add complete Chinese (Simplified) localization
- Support 400+ translated strings across all pages
- Add language switcher with persistent preference
- Zero breaking changes to existing functionality
Framework additions:
- i18n routing and middleware
- LocaleContext for client-side state
- LanguageSwitcher component
- Translation files (en.json, zh.json)
Translated components:
- Homepage: Hero, features, CTA, navbar
- Auth: Login, register
- Dashboard: Main page, layout
- Connectors: Management, add page (all categories)
- Documents: Upload, manage, filters
- Settings: LLM configs, role assignments
- Onboarding: Add provider, assign roles
- Logs: Task logs viewer
Adding a new language now requires only:
1. Create messages/<locale>.json
2. Add locale to i18n/routing.ts
2025-10-26 14:05:46 +08:00
// Using client-side i18n
// Language can be switched dynamically through LanguageSwitcher component
// Locale state is managed by LocaleContext and persisted in localStorage
2025-07-27 10:05:37 -07:00
return (
2026-06-19 03:56:26 +05:30
< html
lang = "en"
data - surfsense - auth - type = { resolveRuntimeAuthUiMode ( BUILD_TIME_AUTH_TYPE ) }
suppressHydrationWarning
>
2026-03-08 17:48:09 -07:00
< head >
2026-06-19 03:56:26 +05:30
< Script id = "surfsense-runtime-auth-init" strategy = "beforeInteractive" >
{ getRuntimeAuthInitScript ( BUILD_TIME_AUTH_TYPE ) }
< / Script >
2026-03-08 17:48:09 -07:00
< link rel = "preconnect" href = "https://api.github.com" / >
2026-04-11 23:38:12 -07:00
< OrganizationJsonLd / >
< WebSiteJsonLd / >
< SoftwareApplicationJsonLd / >
2026-03-08 17:48:09 -07:00
< / head >
2026-05-13 16:46:35 +05:30
< body className = { cn ( roboto . className , "bg-main-panel antialiased h-full w-full " ) } >
2025-12-25 13:53:41 -08:00
< PostHogProvider >
< LocaleProvider >
< I18nProvider >
< ThemeProvider
attribute = "class"
enableSystem
disableTransitionOnChange
2026-02-03 17:02:26 -05:00
defaultTheme = "system"
2025-12-25 13:53:41 -08:00
>
2026-04-07 00:43:40 -07:00
< PlatformProvider >
< RootProvider >
< ReactQueryClientProvider >
2026-06-24 03:55:40 +05:30
< AuthCutoverPurge / >
2026-04-07 00:43:40 -07:00
< ZeroProvider >
< GlobalLoadingProvider > { children } < / GlobalLoadingProvider >
< / ZeroProvider >
< / ReactQueryClientProvider >
2026-05-26 11:57:50 +05:30
< DesktopUpdateToast / >
2026-04-07 00:43:40 -07:00
< Toaster / >
< AnnouncementToastProvider / >
< / RootProvider >
< / PlatformProvider >
2025-12-25 13:53:41 -08:00
< / ThemeProvider >
< / I18nProvider >
< / LocaleProvider >
< / PostHogProvider >
2025-07-27 10:05:37 -07:00
< / body >
< / html >
) ;
2025-04-07 23:47:06 -07:00
}