Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 63 additions & 67 deletions apps/docs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { isFeatureEnabled } from 'common'
import { type Metadata, type ResolvingMetadata } from 'next'
import Link from 'next/link'
import { cn } from 'ui'
import { IconPanel } from 'ui-patterns/IconPanel'
import { TextLink } from 'ui-patterns/TextLink'

import { FrameworkQuickstarts } from '@/components/HomePageCover'
import { FrameworkQuickstarts } from '@/components/FrameworkQuickstarts'
import { MIGRATION_PAGES } from '@/components/Navigation/NavigationMenu/NavigationMenu.constants'
import { GlassPanelWithIconPicker } from '@/features/ui/GlassPanelWithIconPicker'
import { IconPanelWithIconPicker } from '@/features/ui/IconPanelWithIconPicker'
import { IconLinkImage, IconLinkList, IconLinkMenuIcon } from '@/features/ui/IconLink'
import HomeLayout from '@/layouts/HomeLayout'
import { BASE_PATH } from '@/lib/constants'

Expand Down Expand Up @@ -88,31 +87,26 @@ const postgresIntegrations = [
title: 'AI & Vectors',
icon: 'ai',
href: '/guides/ai',
description: 'AI toolkit to manage embeddings',
},
{
title: 'Cron',
icon: 'cron',
href: '/guides/cron',
description: 'Schedule and monitor recurring Jobs',
},
{
title: 'Queues',
icon: 'queues',
href: '/guides/queues',
description: 'Durable Message Queues with guaranteed delivery',
},
{
title: 'Data REST API',
icon: 'rest',
href: '/guides/api',
description: 'Access your database through a RESTful API.',
},
{
title: 'GraphQL API',
icon: 'graphql',
href: '/guides/graphql',
description: 'Access your database through a GraphQL API.',
},
]

Expand Down Expand Up @@ -224,6 +218,20 @@ const additionalResources = [
},
]

const migrationGuides = [...MIGRATION_PAGES]
.sort((a, b) => (a.name || '').localeCompare(b.name || ''))
.flatMap((guide) => {
if (!guide.name || !guide.url || typeof guide.icon !== 'string') return []

return [
{
title: guide.name,
href: guide.url,
icon: <IconLinkImage path={guide.icon} hasLightIcon={guide.hasLightIcon} />,
},
]
})

const HomePage = () => (
<HomeLayout>
<div className="flex flex-col">
Expand All @@ -234,12 +242,12 @@ const HomePage = () => (
Connect a framework
</h2>
<p className="m-0 p-0 text-sm text-foreground-light">
Start with a framework quickstart and connect your project in minutes.
Start with a quickstart guide to connect your project in minutes.
</p>
</div>

<div className="col-span-8 not-prose">
<FrameworkQuickstarts />
<FrameworkQuickstarts labelledBy="connect-a-framework" />
</div>
</div>
)}
Expand All @@ -253,7 +261,10 @@ const HomePage = () => (
</p>
</div>

<ul className="col-span-8 grid grid-cols-12 gap-6 not-prose [&_svg]:text-brand-600">
<ul
aria-labelledby="products"
className="col-span-8 grid grid-cols-12 gap-6 not-prose [&_svg]:text-brand-600"
>
{products.map((product) => {
return (
<li key={product.title} className={cn(product.span ?? 'col-span-12 md:col-span-6')}>
Expand All @@ -277,18 +288,15 @@ const HomePage = () => (
Extend your database with built-in tools for AI, APIs, scheduled jobs, and queues.
</p>
</div>
<div className="grid col-span-8 grid-cols-12 gap-6 not-prose">
{postgresIntegrations.map((integration) => (
<Link
href={integration.href}
key={integration.title}
passHref
className="col-span-6 md:col-span-4"
>
<IconPanelWithIconPicker {...integration} />
</Link>
))}
</div>
<IconLinkList
labelledBy="postgres-integrations"
className="col-span-8 not-prose"
items={postgresIntegrations.map((integration) => ({
title: integration.title,
href: integration.href,
icon: <IconLinkMenuIcon icon={integration.icon} />,
}))}
/>
</div>

<div className="flex flex-col gap-6 border-b py-12 lg:grid lg:grid-cols-12 lg:gap-x-16">
Expand All @@ -301,23 +309,17 @@ const HomePage = () => (
</p>
</div>

<div className="grid col-span-8 grid-cols-12 gap-6 not-prose">
{clientLibraries
<IconLinkList
labelledBy="client-libraries"
className="col-span-8 not-prose"
items={clientLibraries
.filter((library) => library.enabled)

.map((library) => {
return (
<Link
href={library.href}
key={library.title}
passHref
className="col-span-6 md:col-span-4"
>
<IconPanelWithIconPicker {...library} />
</Link>
)
})}
</div>
.map((library) => ({
title: library.title,
href: library.href,
icon: <IconLinkMenuIcon icon={library.icon} />,
}))}
/>
</div>
{isFeatureEnabled('docs:full_getting_started') && (
<div className="flex flex-col gap-6 border-b py-12 lg:grid lg:grid-cols-12 lg:gap-x-16">
Expand All @@ -335,19 +337,11 @@ const HomePage = () => (
/>
</div>

<ul className="grid col-span-8 grid-cols-12 gap-6 not-prose">
{MIGRATION_PAGES.sort((a, b) => (a.name || '').localeCompare(b.name || '')).map(
(guide) => {
return (
<li key={guide.name} className="col-span-6 md:col-span-4">
<Link href={guide.url || '#'} passHref>
<IconPanel {...guide} title={guide.name} background={true} showLink={false} />
</Link>
</li>
)
}
)}
</ul>
<IconLinkList
labelledBy="migrate-to-supabase"
className="col-span-8 not-prose"
items={migrationGuides}
/>
</div>
)}

Expand All @@ -361,7 +355,10 @@ const HomePage = () => (
</p>
</div>

<ul className="col-span-8 grid grid-cols-12 gap-6 not-prose">
<ul
aria-labelledby="additional-resources"
className="col-span-8 grid grid-cols-12 gap-6 not-prose"
>
{additionalResources.map((resource) => {
return (
<li key={resource.title} className="col-span-12 md:col-span-6">
Expand All @@ -370,7 +367,7 @@ const HomePage = () => (
passHref
target={resource.external ? '_blank' : undefined}
>
<GlassPanelWithIconPicker {...resource} background={false}>
<GlassPanelWithIconPicker {...resource}>
{resource.description}
</GlassPanelWithIconPicker>
</Link>
Expand All @@ -392,25 +389,24 @@ const HomePage = () => (
Get started with self-hosting Supabase.
</p>
<TextLink
label="More on Self-Hosting"
label="More on self-hosting"
url="/guides/self-hosting"
className="no-underline text-brand-link text-sm"
/>
</div>
</div>

<div className="grid col-span-8 grid-cols-12 gap-6 not-prose">
<ul className="col-span-full lg:col-span-8 grid grid-cols-12 gap-6">
{selfHostingOptions.map((option) => {
return (
<li key={option.title} className="col-span-6">
<Link href={option.href} passHref>
<IconPanelWithIconPicker {...option} background={true} showLink={false} />
</Link>
</li>
)
})}
</ul>
<div className="col-span-8 grid grid-cols-12 not-prose">
<IconLinkList
labelledBy="self-hosting"
className="col-span-full lg:col-span-8"
itemClassName="col-span-6"
items={selfHostingOptions.map((option) => ({
title: option.title,
href: option.href,
icon: <IconLinkMenuIcon icon={option.icon} />,
}))}
/>
</div>
</div>
)}
Expand Down
72 changes: 33 additions & 39 deletions apps/docs/app/reference/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Link from 'next/link'

import { REFERENCES, clientSdkIds } from '~/content/navigation.references'
import { IconPanelWithIconPicker } from '~/features/ui/IconPanelWithIconPicker'
import { clientSdkIds, REFERENCES } from '~/content/navigation.references'
import { IconLinkList, IconLinkMenuIcon } from '~/features/ui/IconLink'
import { LayoutMainContent } from '~/layouts/DefaultLayout'
import { SidebarSkeleton } from '~/layouts/MainSkeleton'

Expand All @@ -20,41 +18,37 @@ export default function ReferenceIndexPage() {
Supabase also has a Management API to help with managing your Supabase Platform, and a
CLI for local development and CI workflows.
</p>
<h2 className="mb-8">Client Libraries</h2>
<div className="grid col-span-8 grid-cols-12 gap-6 not-prose">
{clientSdkIds.map((sdkId) => {
return (
<Link
key={REFERENCES[sdkId].name}
href={`/reference/${REFERENCES[sdkId].libPath}`}
passHref
className="col-span-6 md:col-span-4"
>
<IconPanelWithIconPicker
title={REFERENCES[sdkId].name}
icon={REFERENCES[sdkId].icon}
/>
</Link>
)
})}
</div>
<h2 className="mb-8">Management API and CLI</h2>
<div className="grid col-span-8 grid-cols-12 gap-6 not-prose">
<Link
href={`/reference/api/introduction`}
passHref
className="col-span-6 md:col-span-4"
>
<IconPanelWithIconPicker title="Management API" icon={REFERENCES['api'].icon} />
</Link>
<Link
href={`/reference/cli/introduction`}
passHref
className="col-span-6 md:col-span-4"
>
<IconPanelWithIconPicker title="CLI" icon={REFERENCES['cli'].icon} />
</Link>
</div>
<h2 id="client-libraries" className="mb-8">
Client Libraries
</h2>
<IconLinkList
labelledBy="client-libraries"
className="not-prose"
items={clientSdkIds.map((sdkId) => ({
title: REFERENCES[sdkId].name,
href: `/reference/${REFERENCES[sdkId].libPath}`,
icon: <IconLinkMenuIcon icon={REFERENCES[sdkId].icon} />,
}))}
/>
<h2 id="management-api-and-cli" className="mb-8">
Management API and CLI
</h2>
<IconLinkList
labelledBy="management-api-and-cli"
className="not-prose"
items={[
{
title: 'Management API',
href: '/reference/api/introduction',
icon: <IconLinkMenuIcon icon={REFERENCES['api'].icon} />,
},
{
title: 'CLI',
href: '/reference/cli/introduction',
icon: <IconLinkMenuIcon icon={REFERENCES['cli'].icon} />,
},
]}
/>
</article>
</LayoutMainContent>
</SidebarSkeleton>
Expand Down
Loading
Loading