From 42723d82321a8767c8cedbf304e6c97f7852bee2 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Wed, 14 Feb 2024 12:39:05 -0500 Subject: [PATCH] refactor: move ai, realtime, functions, remaining auth docs to content directory (#21259) --- .github/workflows/prettier.yml | 3 +- .../NavigationMenu.constants.ts | 10 +- .../RealtimeLimitsEstimator.tsx} | 0 .../RealtimeLimitsEstimator/index.tsx | 11 ++ apps/docs/components/index.tsx | 4 + apps/docs/{pages => content}/guides/ai.mdx | 62 +++--- .../guides/ai/choosing-compute-addon.mdx | 22 +-- .../{pages => content}/guides/ai/concepts.mdx | 18 +- .../guides/ai/engineering-for-scale.mdx | 20 +- .../ai/examples/building-chatgpt-plugins.mdx | 16 +- .../ai/examples/headless-vector-search.mdx | 17 +- .../examples/huggingface-image-captioning.mdx | 22 +-- .../ai/examples/image-search-openai-clip.mdx | 18 +- .../ai/examples/nextjs-vector-search.mdx | 21 +-- .../guides/ai/examples/openai.mdx | 22 +-- .../guides/ai/going-to-prod.mdx | 20 +- .../guides/ai/google-colab.mdx | 20 +- .../guides/ai/hugging-face.mdx | 18 +- .../guides/ai/integrations/llamaindex.mdx | 21 +-- .../guides/ai/integrations/roboflow.mdx | 19 +- .../guides/ai/langchain.mdx | 21 +-- .../guides/ai/python-clients.mdx | 18 +- .../guides/ai/quickstarts/face-similarity.mdx | 17 +- .../quickstarts/generate-text-embeddings.mdx | 18 +- .../guides/ai/quickstarts/hello-world.mdx | 19 +- .../ai/quickstarts/text-deduplication.mdx | 20 +- .../guides/ai/rag-with-permissions.mdx | 20 +- .../guides/ai/structured-unstructured.mdx | 22 +-- .../guides/ai/vecs-python-client.mdx | 19 +- .../guides/ai/vector-columns.mdx | 18 +- .../guides/ai/vector-indexes.mdx | 18 +- .../guides/ai/vector-indexes/hnsw-indexes.mdx | 18 +- .../guides/ai/vector-indexes/ivf-indexes.mdx | 18 +- .../auth-deep-dive/auth-deep-dive-jwts.mdx | 18 +- .../auth-deep-dive/auth-google-oauth.mdx | 18 +- .../auth}/auth-deep-dive/auth-gotrue.mdx | 16 +- .../auth}/auth-deep-dive/auth-policies.mdx | 18 +- .../auth-row-level-security.mdx | 18 +- apps/docs/content/guides/functions.mdx | 170 +++++++++++++++++ .../guides/functions/auth.mdx | 18 +- .../guides/functions/cicd-workflow.mdx | 20 +- .../guides/functions/connect-to-postgres.mdx | 20 +- .../guides/functions/cors.mdx | 16 +- .../guides/functions/dart-edge.mdx | 16 +- .../guides/functions/debugging.mdx | 18 +- .../guides/functions/deploy.mdx | 20 +- .../examples/cloudflare-turnstile.mdx | 18 +- .../guides/functions/examples/discord-bot.mdx | 18 +- .../functions/examples/github-actions.mdx | 18 +- .../guides/functions/examples/og-image.mdx | 18 +- .../functions/examples/push-notifications.mdx | 16 +- .../functions/examples/rate-limiting.mdx | 14 +- .../guides/functions/examples/screenshots.mdx | 14 +- .../guides/functions/examples/send-emails.mdx | 16 +- .../functions/examples/slack-bot-mention.mdx | 16 +- .../functions/examples/stripe-webhooks.mdx | 14 +- .../functions/examples/telegram-bot.mdx | 18 +- .../functions/examples/upstash-redis.mdx | 14 +- .../guides/functions/import-maps.mdx | 20 +- .../guides/functions/kysely-postgres.mdx | 17 +- .../guides/functions/local-development.mdx | 18 +- .../guides/functions/quickstart.mdx | 20 +- .../guides/functions/regional-invocation.mdx | 18 +- .../guides/functions/routing.mdx | 18 +- .../guides/functions/schedule-functions.mdx | 16 +- .../guides/functions/secrets.mdx | 18 +- .../guides/functions/storage-caching.mdx | 18 +- .../guides/functions/unit-test.mdx | 18 +- .../{pages => content}/guides/realtime.mdx | 48 ++--- .../guides/realtime/architecture.mdx | 18 +- .../realtime/bring-your-own-database.mdx | 18 +- .../guides/realtime/broadcast.mdx | 17 +- .../guides/realtime/concepts.mdx | 20 +- .../guides/client-side-throttling.mdx | 18 +- .../guides/realtime/postgres-changes.mdx | 21 +-- .../guides/realtime/presence.mdx | 18 +- .../guides/realtime/protocol.mdx | 15 +- .../guides/realtime/quotas.mdx | 18 +- .../guides/realtime/realtime-with-nextjs.mdx | 18 +- .../subscribing-to-database-changes.mdx | 18 +- apps/docs/pages/guides/ai/[[...slug]].tsx | 28 +++ apps/docs/pages/guides/functions.mdx | 178 ------------------ .../pages/guides/functions/[[...slug]].tsx | 28 +++ .../pages/guides/realtime/[[...slug]].tsx | 28 +++ apps/docs/scripts/codemod/mdx-meta.mjs | 2 +- apps/www/lib/redirects.js | 37 +++- 86 files changed, 780 insertions(+), 1139 deletions(-) rename apps/docs/components/{RealtimeLimitsEstimater.tsx => RealtimeLimitsEstimator/RealtimeLimitsEstimator.tsx} (100%) create mode 100644 apps/docs/components/RealtimeLimitsEstimator/index.tsx rename apps/docs/{pages => content}/guides/ai.mdx (73%) rename apps/docs/{pages => content}/guides/ai/choosing-compute-addon.mdx (97%) rename apps/docs/{pages => content}/guides/ai/concepts.mdx (91%) rename apps/docs/{pages => content}/guides/ai/engineering-for-scale.mdx (91%) rename apps/docs/{pages => content}/guides/ai/examples/building-chatgpt-plugins.mdx (95%) rename apps/docs/{pages => content}/guides/ai/examples/headless-vector-search.mdx (91%) rename apps/docs/{pages => content}/guides/ai/examples/huggingface-image-captioning.mdx (86%) rename apps/docs/{pages => content}/guides/ai/examples/image-search-openai-clip.mdx (93%) rename apps/docs/{pages => content}/guides/ai/examples/nextjs-vector-search.mdx (97%) rename apps/docs/{pages => content}/guides/ai/examples/openai.mdx (86%) rename apps/docs/{pages => content}/guides/ai/going-to-prod.mdx (95%) rename apps/docs/{pages => content}/guides/ai/google-colab.mdx (90%) rename apps/docs/{pages => content}/guides/ai/hugging-face.mdx (95%) rename apps/docs/{pages => content}/guides/ai/integrations/llamaindex.mdx (83%) rename apps/docs/{pages => content}/guides/ai/integrations/roboflow.mdx (95%) rename apps/docs/{pages => content}/guides/ai/langchain.mdx (94%) rename apps/docs/{pages => content}/guides/ai/python-clients.mdx (77%) rename apps/docs/{pages => content}/guides/ai/quickstarts/face-similarity.mdx (87%) rename apps/docs/{pages => content}/guides/ai/quickstarts/generate-text-embeddings.mdx (95%) rename apps/docs/{pages => content}/guides/ai/quickstarts/hello-world.mdx (87%) rename apps/docs/{pages => content}/guides/ai/quickstarts/text-deduplication.mdx (85%) rename apps/docs/{pages => content}/guides/ai/rag-with-permissions.mdx (96%) rename apps/docs/{pages => content}/guides/ai/structured-unstructured.mdx (86%) rename apps/docs/{pages => content}/guides/ai/vecs-python-client.mdx (84%) rename apps/docs/{pages => content}/guides/ai/vector-columns.mdx (95%) rename apps/docs/{pages => content}/guides/ai/vector-indexes.mdx (84%) rename apps/docs/{pages => content}/guides/ai/vector-indexes/hnsw-indexes.mdx (94%) rename apps/docs/{pages => content}/guides/ai/vector-indexes/ivf-indexes.mdx (92%) rename apps/docs/{pages/learn => content/guides/auth}/auth-deep-dive/auth-deep-dive-jwts.mdx (96%) rename apps/docs/{pages/learn => content/guides/auth}/auth-deep-dive/auth-google-oauth.mdx (93%) rename apps/docs/{pages/learn => content/guides/auth}/auth-deep-dive/auth-gotrue.mdx (92%) rename apps/docs/{pages/learn => content/guides/auth}/auth-deep-dive/auth-policies.mdx (95%) rename apps/docs/{pages/learn => content/guides/auth}/auth-deep-dive/auth-row-level-security.mdx (93%) create mode 100644 apps/docs/content/guides/functions.mdx rename apps/docs/{pages => content}/guides/functions/auth.mdx (88%) rename apps/docs/{pages => content}/guides/functions/cicd-workflow.mdx (84%) rename apps/docs/{pages => content}/guides/functions/connect-to-postgres.mdx (89%) rename apps/docs/{pages => content}/guides/functions/cors.mdx (80%) rename apps/docs/{pages => content}/guides/functions/dart-edge.mdx (94%) rename apps/docs/{pages => content}/guides/functions/debugging.mdx (96%) rename apps/docs/{pages => content}/guides/functions/deploy.mdx (86%) rename apps/docs/{pages => content}/guides/functions/examples/cloudflare-turnstile.mdx (86%) rename apps/docs/{pages => content}/guides/functions/examples/discord-bot.mdx (94%) rename apps/docs/{pages => content}/guides/functions/examples/github-actions.mdx (79%) rename apps/docs/{pages => content}/guides/functions/examples/og-image.mdx (77%) rename apps/docs/{pages => content}/guides/functions/examples/push-notifications.mdx (97%) rename apps/docs/{pages => content}/guides/functions/examples/rate-limiting.mdx (76%) rename apps/docs/{pages => content}/guides/functions/examples/screenshots.mdx (69%) rename apps/docs/{pages => content}/guides/functions/examples/send-emails.mdx (85%) rename apps/docs/{pages => content}/guides/functions/examples/slack-bot-mention.mdx (86%) rename apps/docs/{pages => content}/guides/functions/examples/stripe-webhooks.mdx (61%) rename apps/docs/{pages => content}/guides/functions/examples/telegram-bot.mdx (61%) rename apps/docs/{pages => content}/guides/functions/examples/upstash-redis.mdx (91%) rename apps/docs/{pages => content}/guides/functions/import-maps.mdx (89%) rename apps/docs/{pages => content}/guides/functions/kysely-postgres.mdx (95%) rename apps/docs/{pages => content}/guides/functions/local-development.mdx (87%) rename apps/docs/{pages => content}/guides/functions/quickstart.mdx (94%) rename apps/docs/{pages => content}/guides/functions/regional-invocation.mdx (85%) rename apps/docs/{pages => content}/guides/functions/routing.mdx (91%) rename apps/docs/{pages => content}/guides/functions/schedule-functions.mdx (81%) rename apps/docs/{pages => content}/guides/functions/secrets.mdx (88%) rename apps/docs/{pages => content}/guides/functions/storage-caching.mdx (54%) rename apps/docs/{pages => content}/guides/functions/unit-test.mdx (94%) rename apps/docs/{pages => content}/guides/realtime.mdx (83%) rename apps/docs/{pages => content}/guides/realtime/architecture.mdx (91%) rename apps/docs/{pages => content}/guides/realtime/bring-your-own-database.mdx (90%) rename apps/docs/{pages => content}/guides/realtime/broadcast.mdx (96%) rename apps/docs/{pages => content}/guides/realtime/concepts.mdx (91%) rename apps/docs/{pages => content}/guides/realtime/guides/client-side-throttling.mdx (83%) rename apps/docs/{pages => content}/guides/realtime/postgres-changes.mdx (98%) rename apps/docs/{pages => content}/guides/realtime/presence.mdx (93%) rename apps/docs/{pages => content}/guides/realtime/protocol.mdx (94%) rename apps/docs/{pages => content}/guides/realtime/quotas.mdx (92%) rename apps/docs/{pages => content}/guides/realtime/realtime-with-nextjs.mdx (56%) rename apps/docs/{pages => content}/guides/realtime/subscribing-to-database-changes.mdx (85%) create mode 100644 apps/docs/pages/guides/ai/[[...slug]].tsx delete mode 100644 apps/docs/pages/guides/functions.mdx create mode 100644 apps/docs/pages/guides/functions/[[...slug]].tsx create mode 100644 apps/docs/pages/guides/realtime/[[...slug]].tsx diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index cc2d29c565..886a2d41b4 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -63,6 +63,7 @@ jobs: with: sparse-checkout: | apps/docs/pages + apps/docs/content # Installing all dependencies takes up to three minutes, hacking around to only installing prettier+deps - name: Download dependencies run: | @@ -72,4 +73,4 @@ jobs: - name: Run prettier run: |- # Check mdx files which contain sql code blocks - grep -lr '```sql' apps/docs/pages/**/*.mdx | xargs npx prettier -c + grep -lr '```sql' apps/docs/{pages,content}/**/*.mdx | xargs npx prettier -c diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 0032272473..7ca574c6ea 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -657,20 +657,20 @@ export const auth = { items: [ { name: 'Part One: JWTs', - url: '/learn/auth-deep-dive/auth-deep-dive-jwts', + url: '/guides/auth/auth-deep-dive/auth-deep-dive-jwts', }, { name: 'Part Two: Row Level Security', - url: '/learn/auth-deep-dive/auth-row-level-security', + url: '/guides/auth/auth-deep-dive/auth-row-level-security', }, { name: 'Part Three: Policies', - url: '/learn/auth-deep-dive/auth-policies', + url: '/guides/auth/auth-deep-dive/auth-policies', }, - { name: 'Part Four: GoTrue', url: '/learn/auth-deep-dive/auth-gotrue' }, + { name: 'Part Four: GoTrue', url: '/guides/auth/auth-deep-dive/auth-gotrue' }, { name: 'Part Five: Google OAuth', - url: '/learn/auth-deep-dive/auth-google-oauth', + url: '/guides/auth/auth-deep-dive/auth-google-oauth', }, ], }, diff --git a/apps/docs/components/RealtimeLimitsEstimater.tsx b/apps/docs/components/RealtimeLimitsEstimator/RealtimeLimitsEstimator.tsx similarity index 100% rename from apps/docs/components/RealtimeLimitsEstimater.tsx rename to apps/docs/components/RealtimeLimitsEstimator/RealtimeLimitsEstimator.tsx diff --git a/apps/docs/components/RealtimeLimitsEstimator/index.tsx b/apps/docs/components/RealtimeLimitsEstimator/index.tsx new file mode 100644 index 0000000000..34fe3d20a4 --- /dev/null +++ b/apps/docs/components/RealtimeLimitsEstimator/index.tsx @@ -0,0 +1,11 @@ +import { lazy, Suspense } from 'react' + +const Estimator = lazy(() => import('./RealtimeLimitsEstimator')) + +export function RealtimeLimitsEstimator() { + return ( + + + + ) +} diff --git a/apps/docs/components/index.tsx b/apps/docs/components/index.tsx index a3491d7adb..a36aea4560 100644 --- a/apps/docs/components/index.tsx +++ b/apps/docs/components/index.tsx @@ -33,6 +33,7 @@ import { NavData } from './NavData' // Partials import DatabaseSetup from './MDX/database_setup.mdx' import GetSessionWarning from './MDX/get_session_warning.mdx' +import HuggingFaceDeployment from './MDX/ai/quickstart_hf_deployment.mdx' import MigrationWarnings from './MDX/migration_warnings.mdx' import ProjectSetup from './MDX/project_setup.mdx' import QuickstartIntro from './MDX/quickstart_intro.mdx' @@ -67,6 +68,7 @@ import { // Heavy/rare (lazy-loaded) import { AppleSecretGenerator } from './AppleSecretGenerator' import { Mermaid } from './Mermaid' +import { RealtimeLimitsEstimator } from './RealtimeLimitsEstimator' const components = { ...markdownComponents, @@ -102,6 +104,7 @@ const components = { {props.children} ), + HuggingFaceDeployment, IconMenuApi, IconMenuAuth, IconMenuCli, @@ -133,6 +136,7 @@ const components = { ProjectConfigVariables, ProjectSetup, QuickstartIntro, + RealtimeLimitsEstimator, RefHeaderSection: (props: any) => , RefSubLayout, SocialProviderSettingsSupabase, diff --git a/apps/docs/pages/guides/ai.mdx b/apps/docs/content/guides/ai.mdx similarity index 73% rename from apps/docs/pages/guides/ai.mdx rename to apps/docs/content/guides/ai.mdx index a1abf0d2ba..66c7ffbeda 100644 --- a/apps/docs/pages/guides/ai.mdx +++ b/apps/docs/content/guides/ai.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai', - title: 'AI & Vectors', - description: 'The best vector database is the database you already have.', - subtitle: 'The best vector database is the database you already have.', - sidebar_label: 'Overview', -} +--- +id: 'ai' +title: 'AI & Vectors' +description: 'The best vector database is the database you already have.' +subtitle: 'The best vector database is the database you already have.' +hideToc: true +--- Supabase provides an open source toolkit for developing AI applications using Postgres and pgvector. Use the Supabase client libraries to store, index, and query your vector embeddings at scale. @@ -109,7 +107,26 @@ export const integrations = [ ## Case studies
- {customers.map((x) => ( + {[ + { + name: 'Berri AI Boosts Productivity by Migrating from AWS RDS to Supabase with pgvector', + description: + 'Learn how Berri AI overcame challenges with self-hosting their vector database on AWS RDS and successfully migrated to Supabase.', + href: 'https://supabase.com/customers/berriai', + }, + { + name: 'Mendable switches from Pinecone to Supabase for PostgreSQL vector embeddings', + description: + 'How Mendable boosts efficiency and accuracy of chat powered search for documentation using Supabase with pgvector', + href: 'https://supabase.com/customers/mendableai', + }, + { + name: 'Markprompt: GDPR-Compliant AI Chatbots for Docs and Websites', + description: + "AI-powered chatbot platform, Markprompt, empowers developers to deliver efficient and GDPR-compliant prompt experiences on top of their content, by leveraging Supabase's secure and privacy-focused database and authentication solutions", + href: 'https://supabase.com/customers/markprompt', + }, + ].map((x) => (
{x.description} @@ -117,28 +134,3 @@ export const integrations = [
))}
- -export const customers = [ - { - name: 'Berri AI Boosts Productivity by Migrating from AWS RDS to Supabase with pgvector', - description: - 'Learn how Berri AI overcame challenges with self-hosting their vector database on AWS RDS and successfully migrated to Supabase.', - href: 'https://supabase.com/customers/berriai', - }, - { - name: 'Mendable switches from Pinecone to Supabase for PostgreSQL vector embeddings', - description: - 'How Mendable boosts efficiency and accuracy of chat powered search for documentation using Supabase with pgvector', - href: 'https://supabase.com/customers/mendableai', - }, - { - name: 'Markprompt: GDPR-Compliant AI Chatbots for Docs and Websites', - description: - "AI-powered chatbot platform, Markprompt, empowers developers to deliver efficient and GDPR-compliant prompt experiences on top of their content, by leveraging Supabase's secure and privacy-focused database and authentication solutions", - href: 'https://supabase.com/customers/markprompt', - }, -] - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/choosing-compute-addon.mdx b/apps/docs/content/guides/ai/choosing-compute-addon.mdx similarity index 97% rename from apps/docs/pages/guides/ai/choosing-compute-addon.mdx rename to apps/docs/content/guides/ai/choosing-compute-addon.mdx index b76b416a5d..fec64e9167 100644 --- a/apps/docs/pages/guides/ai/choosing-compute-addon.mdx +++ b/apps/docs/content/guides/ai/choosing-compute-addon.mdx @@ -1,14 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' -import { Tabs } from 'ui' -export const TabPanel = Tabs.Panel - -export const meta = { - id: 'ai-choosing-compute-addon', - title: 'Choosing your Compute Add-on', - description: 'Choosing the right Compute Add-on for your vector workload.', - subtitle: 'Choosing the right Compute Add-on for your vector workload.', - sidebar_label: 'Choosing Compute Add-on', -} +--- +id: 'ai-choosing-compute-addon' +title: 'Choosing your Compute Add-on' +description: 'Choosing the right Compute Add-on for your vector workload.' +subtitle: 'Choosing the right Compute Add-on for your vector workload.' +sidebar_label: 'Choosing Compute Add-on' +--- You have two options for scaling your vector workload: @@ -339,7 +335,3 @@ We follow techniques outlined in the [ANN Benchmarks](https://github.com/erikber Each test is run for a minimum of 30-40 minutes. They include a series of experiments executed at different concurrency levels to measure the engine's performance under different load types. The results are then averaged. As a general recommendation, we suggest using a concurrency level of 5 or more for most workloads and 30 or more for high-load workloads. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/concepts.mdx b/apps/docs/content/guides/ai/concepts.mdx similarity index 91% rename from apps/docs/pages/guides/ai/concepts.mdx rename to apps/docs/content/guides/ai/concepts.mdx index 27d71515f3..b1265c9788 100644 --- a/apps/docs/pages/guides/ai/concepts.mdx +++ b/apps/docs/content/guides/ai/concepts.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-concepts', - title: 'Concepts', - description: 'Learn about embeddings within AI and vector applications.', - sidebar_label: 'Concepts', -} +--- +id: 'ai-concepts' +title: 'Concepts' +description: 'Learn about embeddings within AI and vector applications.' +sidebar_label: 'Concepts' +--- Embeddings are core to many AI and vector applications. This guide covers these concepts. If you prefer to get started right away, see our guide on [Generating Embeddings](/docs/guides/ai/quickstarts/generate-text-embeddings). @@ -61,7 +59,3 @@ Why is this useful? Once we have generated embeddings on multiple texts, it is t ## See also - [Structured and Unstructured embeddings](/docs/guides/ai/structured-unstructured) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/engineering-for-scale.mdx b/apps/docs/content/guides/ai/engineering-for-scale.mdx similarity index 91% rename from apps/docs/pages/guides/ai/engineering-for-scale.mdx rename to apps/docs/content/guides/ai/engineering-for-scale.mdx index c0e02ebe32..17a4a27f9c 100644 --- a/apps/docs/pages/guides/ai/engineering-for-scale.mdx +++ b/apps/docs/content/guides/ai/engineering-for-scale.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-engineering-for-scale', - title: 'Engineering for Scale', - description: 'Building an enterprise-grade vector architecture', - subtitle: 'Building an enterprise-grade vector architecture.', - sidebar_label: 'Engineering for Scale', -} +--- +id: 'ai-engineering-for-scale' +title: 'Engineering for Scale' +description: 'Building an enterprise-grade vector architecture' +subtitle: 'Building an enterprise-grade vector architecture.' +sidebar_label: 'Engineering for Scale' +--- Content sources for vectors can be extremely large. As you grow you should run your Vector workloads across several secondary databases (sometimes called "pods"), which allows each collection to scale independently. @@ -145,7 +143,3 @@ This diagram provides an example architecture that allows you to access the coll }} /> - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/examples/building-chatgpt-plugins.mdx b/apps/docs/content/guides/ai/examples/building-chatgpt-plugins.mdx similarity index 95% rename from apps/docs/pages/guides/ai/examples/building-chatgpt-plugins.mdx rename to apps/docs/content/guides/ai/examples/building-chatgpt-plugins.mdx index 39a81955b6..a37988c88c 100644 --- a/apps/docs/pages/guides/ai/examples/building-chatgpt-plugins.mdx +++ b/apps/docs/content/guides/ai/examples/building-chatgpt-plugins.mdx @@ -1,11 +1,8 @@ -import Layout from '~/layouts/DefaultGuideLayout' -import StepHikeCompact from '~/components/StepHikeCompact' - -export const meta = { - title: 'Building ChatGPT plugins', - subtitle: 'Use Supabase as a Retrieval Store for your ChatGPT plugin.', - breadcrumb: 'AI Examples', -} +--- +title: 'Building ChatGPT plugins' +subtitle: 'Use Supabase as a Retrieval Store for your ChatGPT plugin.' +breadcrumb: 'AI Examples' +--- ChatGPT recently released [Plugins](https://openai.com/blog/chatgpt-plugins) which help ChatGPT access up-to-date information, run computations, or use third-party services. If you're building a plugin for ChatGPT, you'll probably want to answer questions from a specific source. We can solve this with “retrieval plugins”, which allow ChatGPT to access information from a database. @@ -151,6 +148,3 @@ And after ChatGPT receives a response from the plugin it will answer your questi - ChatGPT Retrieval Plugin: [github.com/openai/chatgpt-retrieval-plugin](https://github.com/openai/chatgpt-retrieval-plugin) - ChatGPT Plugins: [official documentation](https://platform.openai.com/docs/plugins/introduction) - -export const Page = ({ children }) => -export default Page diff --git a/apps/docs/pages/guides/ai/examples/headless-vector-search.mdx b/apps/docs/content/guides/ai/examples/headless-vector-search.mdx similarity index 91% rename from apps/docs/pages/guides/ai/examples/headless-vector-search.mdx rename to apps/docs/content/guides/ai/examples/headless-vector-search.mdx index 78c59abc87..f24c71283f 100644 --- a/apps/docs/pages/guides/ai/examples/headless-vector-search.mdx +++ b/apps/docs/content/guides/ai/examples/headless-vector-search.mdx @@ -1,12 +1,8 @@ -import Layout from '~/layouts/DefaultGuideLayout' -import StepHikeCompact from '~/components/StepHikeCompact' - -export const meta = { - title: 'Adding generative Q&A for your documentation', - subtitle: - 'Learn how to build a ChatGPT-style doc search powered using our headless search toolkit.', - breadcrumb: 'AI Examples', -} +--- +title: 'Adding generative Q&A for your documentation' +subtitle: 'Learn how to build a ChatGPT-style doc search powered using our headless search toolkit.' +breadcrumb: 'AI Examples' +--- Supabase provides a [Headless Search Toolkit](https://github.com/supabase/headless-vector-search) for adding "Generative Q&A" to your documentation. The toolkit is "headless", so that you can integrate it into your existing website and style it to match your website theme. @@ -119,6 +115,3 @@ const onSubmit = (e: Event) => { - Read about how we built [ChatGPT for the Supabase Docs](https://supabase.com/blog/chatgpt-supabase-docs). - Read the pgvector Docs for [Embeddings and vector similarity](/docs/guides/database/extensions/pgvector) - See how to build something like this from scratch [using Next.js](/docs/guides/ai/examples/nextjs-vector-search). - -export const Page = ({ children }) => -export default Page diff --git a/apps/docs/pages/guides/ai/examples/huggingface-image-captioning.mdx b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx similarity index 86% rename from apps/docs/pages/guides/ai/examples/huggingface-image-captioning.mdx rename to apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx index 29dfde30de..64012a95fe 100644 --- a/apps/docs/pages/guides/ai/examples/huggingface-image-captioning.mdx +++ b/apps/docs/content/guides/ai/examples/huggingface-image-captioning.mdx @@ -1,14 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - title: 'Generate image captions using Hugging Face', - description: - 'Use the Hugging Face Inference API to make calls to 100,000+ Machine Learning models from Supabase Edge Functions.', - subtitle: - 'Use the Hugging Face Inference API to make calls to 100,000+ Machine Learning models from Supabase Edge Functions.', - video: 'https://www.youtube.com/v/OgnYxRkxEUw', - tocVideo: 'OgnYxRkxEUw', -} +--- +title: 'Generate image captions using Hugging Face' +description: 'Use the Hugging Face Inference API to make calls to 100,000+ Machine Learning models from Supabase Edge Functions.' +subtitle: 'Use the Hugging Face Inference API to make calls to 100,000+ Machine Learning models from Supabase Edge Functions.' +video: 'https://www.youtube.com/v/OgnYxRkxEUw' +tocVideo: 'OgnYxRkxEUw' +--- We can combine Hugging Face with [Supabase Storage](https://supabase.com/storage) and [Database Webhooks](https://supabase.com/docs/guides/database/webhooks) to automatically caption for any image we upload to a storage bucket. @@ -93,7 +89,3 @@ serve(async (req) => { return new Response('ok') }) ``` - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/examples/image-search-openai-clip.mdx b/apps/docs/content/guides/ai/examples/image-search-openai-clip.mdx similarity index 93% rename from apps/docs/pages/guides/ai/examples/image-search-openai-clip.mdx rename to apps/docs/content/guides/ai/examples/image-search-openai-clip.mdx index 40f9859aa2..27e446a32d 100644 --- a/apps/docs/pages/guides/ai/examples/image-search-openai-clip.mdx +++ b/apps/docs/content/guides/ai/examples/image-search-openai-clip.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'examples-image-search-python', - title: 'Image Search with OpenAI CLIP', - description: 'Implement image search with the OpenAI CLIP Model and Supabase Vector.', - subtitle: 'Implement image search with the OpenAI CLIP Model and Supabase Vector.', -} +--- +id: 'examples-image-search-python' +title: 'Image Search with OpenAI CLIP' +description: 'Implement image search with the OpenAI CLIP Model and Supabase Vector.' +subtitle: 'Implement image search with the OpenAI CLIP Model and Supabase Vector.' +--- The [OpenAI CLIP Model](https://github.com/openai/CLIP) was trained on a variety of (image, text)-pairs. You can use the CLIP model for: @@ -171,7 +169,3 @@ That's it, go ahead and test it out by running `poetry run search` and you will ## Conclusion With just a couple of lines of Python you are able to implement image search as well as reverse image search using OpenAI's CLIP model and Supabase Vector. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/examples/nextjs-vector-search.mdx b/apps/docs/content/guides/ai/examples/nextjs-vector-search.mdx similarity index 97% rename from apps/docs/pages/guides/ai/examples/nextjs-vector-search.mdx rename to apps/docs/content/guides/ai/examples/nextjs-vector-search.mdx index 2d6986fb92..2cd43c7944 100644 --- a/apps/docs/pages/guides/ai/examples/nextjs-vector-search.mdx +++ b/apps/docs/content/guides/ai/examples/nextjs-vector-search.mdx @@ -1,14 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' -import StepHikeCompact from '~/components/StepHikeCompact' - -export const meta = { - title: 'Vector search with Next.js and OpenAI', - subtitle: - 'Learn how to build a ChatGPT-style doc search powered by Next.js, OpenAI, and Supabase.', - breadcrumb: 'AI Examples', - video: 'https://www.youtube.com/v/xmfNUCjszh4', - tocVideo: 'xmfNUCjszh4', -} +--- +title: 'Vector search with Next.js and OpenAI' +subtitle: 'Learn how to build a ChatGPT-style doc search powered by Next.js, OpenAI, and Supabase.' +breadcrumb: 'AI Examples' +video: 'https://www.youtube.com/v/xmfNUCjszh4' +tocVideo: 'xmfNUCjszh4' +--- While our [Headless Vector search](/docs/guides/ai/examples/headless-vector-search) provides a toolkit for generative Q&A, in this tutorial we'll go more in-depth, build a custom ChatGPT-like search experience from the ground-up using Next.js. You will: @@ -543,6 +539,3 @@ Want to learn more about the awesome tech that is powering this? allowFullScreen > - -export const Page = ({ children }) => -export default Page diff --git a/apps/docs/pages/guides/ai/examples/openai.mdx b/apps/docs/content/guides/ai/examples/openai.mdx similarity index 86% rename from apps/docs/pages/guides/ai/examples/openai.mdx rename to apps/docs/content/guides/ai/examples/openai.mdx index 7f83f0bed5..b437530179 100644 --- a/apps/docs/pages/guides/ai/examples/openai.mdx +++ b/apps/docs/content/guides/ai/examples/openai.mdx @@ -1,13 +1,11 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'examples-openai', - title: 'Generating OpenAI GPT3 completions', - description: 'Generate GPT text completions using OpenAI and Supabase Edge Functions.', - subtitle: 'Generate GPT text completions using OpenAI and Supabase Edge Functions.', - video: 'https://www.youtube-nocookie.com/v/29p8kIqyU_Y', - tocVideo: '29p8kIqyU_Y', -} +--- +id: 'examples-openai' +title: 'Generating OpenAI GPT3 completions' +description: 'Generate GPT text completions using OpenAI and Supabase Edge Functions.' +subtitle: 'Generate GPT text completions using OpenAI and Supabase Edge Functions.' +video: 'https://www.youtube-nocookie.com/v/29p8kIqyU_Y' +tocVideo: '29p8kIqyU_Y' +--- OpenAI provides a [completions API](https://platform.openai.com/docs/api-reference/completions) that allows you to use their generative GPT models in your own applications. @@ -112,7 +110,3 @@ If you're interesting in learning how to use this to build your own ChatGPT, rea allowFullScreen > - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/going-to-prod.mdx b/apps/docs/content/guides/ai/going-to-prod.mdx similarity index 95% rename from apps/docs/pages/guides/ai/going-to-prod.mdx rename to apps/docs/content/guides/ai/going-to-prod.mdx index bf133b70b1..010748a695 100644 --- a/apps/docs/pages/guides/ai/going-to-prod.mdx +++ b/apps/docs/content/guides/ai/going-to-prod.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-going-to-prod', - title: 'Going to Production', - description: 'Checklist for going to production with your AI application.', - subtitle: 'Going to production checklist for AI applications.', - sidebar_label: 'Going to Production', -} +--- +id: 'ai-going-to-prod' +title: 'Going to Production' +description: 'Checklist for going to production with your AI application.' +subtitle: 'Going to production checklist for AI applications.' +sidebar_label: 'Going to Production' +--- This guide will help you to prepare your application for production. We'll provide actionable steps to help you scale your application, ensure that it is reliable, can handle the load, and provide optimal accuracy for your use case. @@ -125,7 +123,3 @@ Or take a look at our [pgvector 0.5.0 performance](https://supabase.com/blog/inc }} /> - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/google-colab.mdx b/apps/docs/content/guides/ai/google-colab.mdx similarity index 90% rename from apps/docs/pages/guides/ai/google-colab.mdx rename to apps/docs/content/guides/ai/google-colab.mdx index 2f6cca0ea6..ddd4c76177 100644 --- a/apps/docs/pages/guides/ai/google-colab.mdx +++ b/apps/docs/content/guides/ai/google-colab.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-google-colab', - title: 'Google Colab', - description: 'Use Google Colab to manage your Supabase Vector store.', - subtitle: 'Use Google Colab to manage your Supabase Vector store.', - sidebar_label: 'Google Colab', -} +--- +id: 'ai-google-colab' +title: 'Google Colab' +description: 'Use Google Colab to manage your Supabase Vector store.' +subtitle: 'Use Google Colab to manage your Supabase Vector store.' +sidebar_label: 'Google Colab' +--- - -export default Page diff --git a/apps/docs/pages/guides/ai/hugging-face.mdx b/apps/docs/content/guides/ai/hugging-face.mdx similarity index 95% rename from apps/docs/pages/guides/ai/hugging-face.mdx rename to apps/docs/content/guides/ai/hugging-face.mdx index 0b36104c8e..ee902d128e 100644 --- a/apps/docs/pages/guides/ai/hugging-face.mdx +++ b/apps/docs/content/guides/ai/hugging-face.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-hugging-face', - title: 'Hugging Face Inference API', - description: 'Learn how to integrate hugging face models with Supabase', - sidebar_label: 'Hugging Face', -} +--- +id: 'ai-hugging-face' +title: 'Hugging Face Inference API' +description: 'Learn how to integrate hugging face models with Supabase' +sidebar_label: 'Hugging Face' +--- [Hugging Face](https://huggingface.co) is an open source hub for AI/ML models and tools. With over 100,000 machine learning models available, Hugging Face provides a great way to integrate specialized AI & ML tasks into your application. @@ -170,7 +168,3 @@ Try running some other [AI tasks](#ai-tasks). - Official [Hugging Face site](https://huggingface.co/). - Official [Hugging Face JS docs](https://huggingface.co/docs/huggingface.js). - [Generate image captions](/docs/guides/ai/examples/huggingface-image-captioning) using Hugging Face. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/integrations/llamaindex.mdx b/apps/docs/content/guides/ai/integrations/llamaindex.mdx similarity index 83% rename from apps/docs/pages/guides/ai/integrations/llamaindex.mdx rename to apps/docs/content/guides/ai/integrations/llamaindex.mdx index 23bfd749a9..af85a7b8cd 100644 --- a/apps/docs/pages/guides/ai/integrations/llamaindex.mdx +++ b/apps/docs/content/guides/ai/integrations/llamaindex.mdx @@ -1,14 +1,9 @@ -import { Admonition } from 'ui' -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-integration-llamaindex', - title: - 'Learn how to integrate Supabase with LlamaIndex, a data framework for your LLM applications.', - subtitle: - 'Learn how to integrate Supabase with LlamaIndex, a data framework for your LLM applications.', - breadcrumb: 'AI Integrations', -} +--- +id: 'ai-integration-llamaindex' +title: 'Learn how to integrate Supabase with LlamaIndex, a data framework for your LLM applications.' +subtitle: 'Learn how to integrate Supabase with LlamaIndex, a data framework for your LLM applications.' +breadcrumb: 'AI Integrations' +--- This guide will walk you through a basic example using the LlamaIndex [SupabaseVectorStore](https://github.com/supabase/supabase/blob/master/examples/ai/llamaindex/llamaindex.ipynb). @@ -73,7 +68,3 @@ You can view the inserted items in the [Table Editor](https://supabase.com/dashb - Visit the LlamaIndex + SupabaseVectorStore [docs](https://gpt-index.readthedocs.io/en/latest/examples/vector_stores/SupabaseVectorIndexDemo.html) - Visit the official LlamaIndex [repo](https://github.com/jerryjliu/llama_index/) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/integrations/roboflow.mdx b/apps/docs/content/guides/ai/integrations/roboflow.mdx similarity index 95% rename from apps/docs/pages/guides/ai/integrations/roboflow.mdx rename to apps/docs/content/guides/ai/integrations/roboflow.mdx index 568fd73460..a388b4fbe6 100644 --- a/apps/docs/pages/guides/ai/integrations/roboflow.mdx +++ b/apps/docs/content/guides/ai/integrations/roboflow.mdx @@ -1,12 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-integration-roboflow', - title: 'Roboflow', - subtitle: - 'Learn how to integrate Supabase with Roboflow, a tool for running fine-tuned and foundation vision models.', - breadcrumb: 'AI Integrations', -} +--- +id: 'ai-integration-roboflow' +title: 'Roboflow' +subtitle: 'Learn how to integrate Supabase with Roboflow, a tool for running fine-tuned and foundation vision models.' +breadcrumb: 'AI Integrations' +--- In this guide, we will walk through two examples of using [Roboflow Inference](https://inference.roboflow.com) to run fine-tuned and foundation models. We will run inference and save predictions using an object detection model and [CLIP](https://github.com/openai/CLIP). @@ -238,7 +235,3 @@ print(result[0]) - [Roboflow Inference documentation](https://inference.roboflow.com) - [Roboflow Getting Started guide](https://blog.roboflow.com/getting-started-with-roboflow/) - [How to Build a Semantic Image Search Engine with Supabase and OpenAI CLIP](https://blog.roboflow.com/how-to-use-semantic-search-supabase-openai-clip/) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/langchain.mdx b/apps/docs/content/guides/ai/langchain.mdx similarity index 94% rename from apps/docs/pages/guides/ai/langchain.mdx rename to apps/docs/content/guides/ai/langchain.mdx index 967bf23e14..df6a2b80dd 100644 --- a/apps/docs/pages/guides/ai/langchain.mdx +++ b/apps/docs/content/guides/ai/langchain.mdx @@ -1,14 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' -import { Tabs } from 'ui' -export const TabPanel = Tabs.Panel - -export const meta = { - id: 'ai-lang-chain', - title: 'LangChain', - description: - 'Learn how to integrate Supabase with LangChain, a popular framework for composing AI, Vectors, and embeddings', - sidebar_label: 'LangChain', -} +--- +id: 'ai-lang-chain' +title: 'LangChain' +description: 'Learn how to integrate Supabase with LangChain, a popular framework for composing AI, Vectors, and embeddings' +sidebar_label: 'LangChain' +--- [LangChain](https://langchain.com/) is a popular framework for working with AI, Vectors, and embeddings. LangChain supports using Supabase as a [vector store](https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/supabase), using the `pgvector` extension. @@ -230,7 +225,3 @@ You can install the LangChain Hybrid Search function though our [database.dev pa - Official [LangChain site](https://langchain.com/). - Official [LangChain docs](https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/supabase). - Supabase [Hybrid Search](https://js.langchain.com/docs/modules/indexes/retrievers/supabase-hybrid). - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/python-clients.mdx b/apps/docs/content/guides/ai/python-clients.mdx similarity index 77% rename from apps/docs/pages/guides/ai/python-clients.mdx rename to apps/docs/content/guides/ai/python-clients.mdx index 563a5e1d7e..189ad97ec2 100644 --- a/apps/docs/pages/guides/ai/python-clients.mdx +++ b/apps/docs/content/guides/ai/python-clients.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-python-clients', - title: 'Choosing a Client', - description: 'Learn how to manage vectors using Python', - sidebar_label: 'Choosing a Client', -} +--- +id: 'ai-python-clients' +title: 'Choosing a Client' +description: 'Learn how to manage vectors using Python' +sidebar_label: 'Choosing a Client' +--- As described in [Structured & Unstructured Embeddings](/docs/guides/ai/structured-unstructured), AI workloads come in many forms. @@ -18,7 +16,3 @@ You can get your connection string from the [**Database Settings**](https://supa For production python applications with version controlled migrations, we recommend adding first class vector support to your toolchain by [registering the vector type with your ORM](https://github.com/pgvector/pgvector-python). pgvector provides bindings for the most commonly used SQL drivers/libraries including Django, SQLAlchemy, SQLModel, psycopg, asyncpg and Peewee. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/quickstarts/face-similarity.mdx b/apps/docs/content/guides/ai/quickstarts/face-similarity.mdx similarity index 87% rename from apps/docs/pages/guides/ai/quickstarts/face-similarity.mdx rename to apps/docs/content/guides/ai/quickstarts/face-similarity.mdx index 36694ba932..496e068c3e 100644 --- a/apps/docs/pages/guides/ai/quickstarts/face-similarity.mdx +++ b/apps/docs/content/guides/ai/quickstarts/face-similarity.mdx @@ -1,11 +1,8 @@ -import { Admonition } from 'ui' -import Layout from '~/layouts/DefaultGuideLayout' -export const meta = { - id: 'ai-vecs-python-client', - title: 'Face similarity search', - subtitle: 'Identify the celebrities who look most similar to you using Supabase Vecs.', - breadcrumb: 'AI Quickstarts', -} +--- +id: 'ai-vecs-python-client' +title: 'Face similarity search' +subtitle: 'Identify the celebrities who look most similar to you using Supabase Vecs.' +--- This guide will walk you through a ["Face Similarity Search"](https://github.com/supabase/supabase/blob/master/examples/ai/face_similarity.ipynb) example using Colab and Supabase Vecs. You will be able to identify the celebrities who look most similar to you (or any other person). You will: @@ -68,7 +65,3 @@ You can view the inserted items in the [Table Editor](https://supabase.com/dashb ## Next steps You can now start building your own applications with Vecs. Check our [examples](/docs/guides/ai#examples) for ideas. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/quickstarts/generate-text-embeddings.mdx b/apps/docs/content/guides/ai/quickstarts/generate-text-embeddings.mdx similarity index 95% rename from apps/docs/pages/guides/ai/quickstarts/generate-text-embeddings.mdx rename to apps/docs/content/guides/ai/quickstarts/generate-text-embeddings.mdx index ae9e4b2b3e..840fd11412 100644 --- a/apps/docs/pages/guides/ai/quickstarts/generate-text-embeddings.mdx +++ b/apps/docs/content/guides/ai/quickstarts/generate-text-embeddings.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-generating-embeddings', - title: 'Generate Embeddings', - subtitle: 'Generate text embeddings using Edge Functions + Transformer.js.', - breadcrumb: 'AI Quickstarts', -} +--- +id: 'ai-generating-embeddings' +title: 'Generate Embeddings' +subtitle: 'Generate text embeddings using Edge Functions + Transformer.js.' +breadcrumb: 'AI Quickstarts' +--- This guide will walk you through how to generate high quality text embeddings in [Edge Functions](/docs/guides/functions) using Transformers.js. Inference is performed directly in Edge Functions using open source Hugging Face models, so no external API is required. @@ -205,7 +203,3 @@ Let's build an Edge Function that will accept an input string and generate an em - Learn more about [embedding concepts](/docs/guides/ai/concepts) - [Store your embeddings](/docs/guides/ai/vector-columns) in a database - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/quickstarts/hello-world.mdx b/apps/docs/content/guides/ai/quickstarts/hello-world.mdx similarity index 87% rename from apps/docs/pages/guides/ai/quickstarts/hello-world.mdx rename to apps/docs/content/guides/ai/quickstarts/hello-world.mdx index 88d4b42ef5..d9944a06b0 100644 --- a/apps/docs/pages/guides/ai/quickstarts/hello-world.mdx +++ b/apps/docs/content/guides/ai/quickstarts/hello-world.mdx @@ -1,12 +1,9 @@ -import { Admonition } from 'ui' -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-vecs-python-client', - title: 'Creating and managing collections', - subtitle: 'Connecting to your database with Colab.', - breadcrumb: 'AI Quickstarts', -} +--- +id: 'ai-vecs-python-client' +title: 'Creating and managing collections' +subtitle: 'Connecting to your database with Colab.' +breadcrumb: 'AI Quickstarts' +--- This guide will walk you through a basic ["Hello World"](https://github.com/supabase/supabase/blob/master/examples/ai/vector_hello_world.ipynb) example using Colab and Supabase Vecs. You'll learn how to: @@ -69,7 +66,3 @@ You can view the inserted items in the [Table Editor](https://supabase.com/dashb ## Next steps You can now start building your own applications with Vecs. Check our [examples](/docs/guides/ai#examples) for ideas. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/quickstarts/text-deduplication.mdx b/apps/docs/content/guides/ai/quickstarts/text-deduplication.mdx similarity index 85% rename from apps/docs/pages/guides/ai/quickstarts/text-deduplication.mdx rename to apps/docs/content/guides/ai/quickstarts/text-deduplication.mdx index afa8cf81b4..e603bafea0 100644 --- a/apps/docs/pages/guides/ai/quickstarts/text-deduplication.mdx +++ b/apps/docs/content/guides/ai/quickstarts/text-deduplication.mdx @@ -1,13 +1,9 @@ -import { Admonition } from 'ui' -import HuggingFaceDeployment from '~/components/MDX/ai/quickstart_hf_deployment.mdx' -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-vecs-python-client', - title: 'Semantic Text Deduplication', - subtitle: 'Finding duplicate movie reviews with Supabase Vecs.', - breadcrumb: 'AI Quickstarts', -} +--- +id: 'ai-vecs-python-client' +title: 'Semantic Text Deduplication' +subtitle: 'Finding duplicate movie reviews with Supabase Vecs.' +breadcrumb: 'AI Quickstarts' +--- This guide will walk you through a ["Semantic Text Deduplication"](https://github.com/supabase/supabase/blob/master/examples/ai/semantic_text_deduplication.ipynb) example using Colab and Supabase Vecs. You'll learn how to find similar movie reviews using embeddings, and remove any that seem like duplicates. You will: @@ -72,7 +68,3 @@ You can view the inserted items in the [Table Editor](https://supabase.com/dashb ## Next steps You can now start building your own applications with Vecs. Check our [examples](/docs/guides/ai#examples) for ideas. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/rag-with-permissions.mdx b/apps/docs/content/guides/ai/rag-with-permissions.mdx similarity index 96% rename from apps/docs/pages/guides/ai/rag-with-permissions.mdx rename to apps/docs/content/guides/ai/rag-with-permissions.mdx index c5b27f20d4..6b10cf85a4 100644 --- a/apps/docs/pages/guides/ai/rag-with-permissions.mdx +++ b/apps/docs/content/guides/ai/rag-with-permissions.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-rag-with-permissions', - title: 'RAG with Permissions', - subtitle: 'Fine-grain access control with Retrieval Augmented Generation.', - description: 'Implement fine-grain access control with retrieval augmented generation', - sidebar_label: 'RAG with Permissions', -} +--- +id: 'ai-rag-with-permissions' +title: 'RAG with Permissions' +subtitle: 'Fine-grain access control with Retrieval Augmented Generation.' +description: 'Implement fine-grain access control with retrieval augmented generation' +sidebar_label: 'RAG with Permissions' +--- Since pgvector is built on top of Postgres, you can implement fine-grain access control on your vector database using [Row Level Security (RLS)](/docs/guides/database/postgres/row-level-security). This means you can restrict which documents are returned during a vector similarity search to users that have access to them. Supabase also supports [Foreign Data Wrappers (FDW)](/docs/guides/database/extensions/wrappers/overview) which means you can use an external database or data source to determine these permissions if your user data doesn't exist in Supabase. @@ -272,7 +270,3 @@ order by document_sections.embedding <#> embedding; There are endless approaches to this problem based on the complexities of each system. Luckily Postgres comes with all the primitives needed to provide access control in the way that works best for your project. If the examples above didn't fit your use case or you need to adjust them slightly to better fit your existing system, feel free to reach out to [support](https://supabase.com/dashboard/support/new) and we'll be happy to assist you. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/structured-unstructured.mdx b/apps/docs/content/guides/ai/structured-unstructured.mdx similarity index 86% rename from apps/docs/pages/guides/ai/structured-unstructured.mdx rename to apps/docs/content/guides/ai/structured-unstructured.mdx index 6bd3795d35..3b722be960 100644 --- a/apps/docs/pages/guides/ai/structured-unstructured.mdx +++ b/apps/docs/content/guides/ai/structured-unstructured.mdx @@ -1,14 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'structured-unstructured-embeddings', - title: 'Structured and Unstructured', - description: - 'Supabase is flexible enough to associate structured and unstructured metadata with embeddings.', - subtitle: - 'Supabase is flexible enough to associate structured and unstructured metadata with embeddings.', - sidebar_label: 'Structured and unstructured embeddings', -} +--- +id: 'structured-unstructured-embeddings' +title: 'Structured and Unstructured' +description: 'Supabase is flexible enough to associate structured and unstructured metadata with embeddings.' +subtitle: 'Supabase is flexible enough to associate structured and unstructured metadata with embeddings.' +sidebar_label: 'Structured and unstructured embeddings' +--- Most vector stores treat metadata associated with embeddings like NoSQL, unstructured data. Supabase is flexible enough to store unstructured and structured metadata. @@ -108,7 +104,3 @@ Both approaches create a table where you can store your embeddings and some meta - Unstructured metadata is best when fields are unknown/user-defined or when working with data interactively e.g. exploratory research Both approaches are valid, and the one you should choose depends on your use-case. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/vecs-python-client.mdx b/apps/docs/content/guides/ai/vecs-python-client.mdx similarity index 84% rename from apps/docs/pages/guides/ai/vecs-python-client.mdx rename to apps/docs/content/guides/ai/vecs-python-client.mdx index 071da52f43..616dfa5b11 100644 --- a/apps/docs/pages/guides/ai/vecs-python-client.mdx +++ b/apps/docs/content/guides/ai/vecs-python-client.mdx @@ -1,12 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' -import StepHikeCompact from '~/components/StepHikeCompact' - -export const meta = { - id: 'ai-vecs-python-client', - title: 'Python client', - subtitle: 'Manage unstructured vector stores in PostgreSQL.', - breadcrumb: 'AI Quickstarts', -} +--- +id: 'ai-vecs-python-client' +title: 'Python client' +subtitle: 'Manage unstructured vector stores in PostgreSQL.' +breadcrumb: 'AI Quickstarts' +--- Supabase provides a Python client called [`vecs`](https://github.com/supabase/vecs) for managing unstructured vector stores. This client provides a set of useful tools for creating and querying collections in PostgreSQL using the [pgvector](/docs/guides/database/extensions/pgvector) extension. @@ -85,7 +82,3 @@ For a more in-depth guide on `vecs` collections, see [API](/docs/guides/ai/pytho - Official Vecs Documentation: https://supabase.github.io/vecs/api - Source Code: https://github.com/supabase/vecs - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/vector-columns.mdx b/apps/docs/content/guides/ai/vector-columns.mdx similarity index 95% rename from apps/docs/pages/guides/ai/vector-columns.mdx rename to apps/docs/content/guides/ai/vector-columns.mdx index c5d9cb18e9..870f303fc4 100644 --- a/apps/docs/pages/guides/ai/vector-columns.mdx +++ b/apps/docs/content/guides/ai/vector-columns.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-vector-columns', - title: 'Vector columns', - description: 'Learn how to use vectors within your own Postgres tables', - sidebar_label: 'Vector columns', -} +--- +id: 'ai-vector-columns' +title: 'Vector columns' +description: 'Learn how to use vectors within your own Postgres tables' +sidebar_label: 'Vector columns' +--- Supabase offers a number of different ways to store and query vectors within Postgres. The SQL included in this guide is applicable for clients in all programming languages. If you are a Python user see your [Python client options](/docs/guides/ai/python-clients) after reading the `Learn` section. @@ -166,7 +164,3 @@ Vectors and embeddings can be used for much more than search. Learn more about e ### Indexes Once your vector table starts to grow, you will likely want to add an index to speed up queries. See [Vector indexes](/docs/guides/ai/vector-indexes) to learn how vector indexes work and how to create them. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/vector-indexes.mdx b/apps/docs/content/guides/ai/vector-indexes.mdx similarity index 84% rename from apps/docs/pages/guides/ai/vector-indexes.mdx rename to apps/docs/content/guides/ai/vector-indexes.mdx index 2bb3a4e310..03883a0b5c 100644 --- a/apps/docs/pages/guides/ai/vector-indexes.mdx +++ b/apps/docs/content/guides/ai/vector-indexes.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-vector-indexes', - title: 'Vector indexes', - description: 'Understanding vector indexes', - sidebar_label: 'Vector indexes', -} +--- +id: 'ai-vector-indexes' +title: 'Vector indexes' +description: 'Understanding vector indexes' +sidebar_label: 'Vector indexes' +--- Once your vector table starts to grow, you will likely want to add an index to speed up queries. Without indexes, you'll be performing a sequential scan which can be a resource-intensive operation when you have many records. @@ -33,7 +31,3 @@ Currently vectors with up to 2,000 dimensions can be indexed. ## Resources Read more about indexing on `pgvector`'s [GitHub page](https://github.com/pgvector/pgvector#indexing). - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/vector-indexes/hnsw-indexes.mdx b/apps/docs/content/guides/ai/vector-indexes/hnsw-indexes.mdx similarity index 94% rename from apps/docs/pages/guides/ai/vector-indexes/hnsw-indexes.mdx rename to apps/docs/content/guides/ai/vector-indexes/hnsw-indexes.mdx index 38ffab8acf..2a1823ad17 100644 --- a/apps/docs/pages/guides/ai/vector-indexes/hnsw-indexes.mdx +++ b/apps/docs/content/guides/ai/vector-indexes/hnsw-indexes.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-hnsw-indexes', - title: 'HNSW indexes', - description: 'Understanding HNSW indexes in pgvector', - sidebar_label: 'HNSW indexes', -} +--- +id: 'ai-hnsw-indexes' +title: 'HNSW indexes' +description: 'Understanding HNSW indexes in pgvector' +sidebar_label: 'HNSW indexes' +--- HNSW is an algorithm for approximate nearest neighbor search. It is a frequently used index type that can improve performance when querying highly-dimensional vectors, like those representing embeddings. @@ -92,7 +90,3 @@ Unlike IVFFlat indexes, you are safe to build an HNSW index immediately after th ## Resources Read more about indexing on `pgvector`'s [GitHub page](https://github.com/pgvector/pgvector#indexing). - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/vector-indexes/ivf-indexes.mdx b/apps/docs/content/guides/ai/vector-indexes/ivf-indexes.mdx similarity index 92% rename from apps/docs/pages/guides/ai/vector-indexes/ivf-indexes.mdx rename to apps/docs/content/guides/ai/vector-indexes/ivf-indexes.mdx index 46795777c6..3262a6c584 100644 --- a/apps/docs/pages/guides/ai/vector-indexes/ivf-indexes.mdx +++ b/apps/docs/content/guides/ai/vector-indexes/ivf-indexes.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'ai-ivf-indexes', - title: 'IVFFlat indexes', - description: 'Understanding IVFFlat indexes in pgvector', - sidebar_label: 'IVFFlat indexes', -} +--- +id: 'ai-ivf-indexes' +title: 'IVFFlat indexes' +description: 'Understanding IVFFlat indexes in pgvector' +sidebar_label: 'IVFFlat indexes' +--- IVFFlat is a type of vector index for approximate nearest neighbor search. It is a frequently used index type that can improve performance when querying highly-dimensional vectors, like those representing embeddings. @@ -96,7 +94,3 @@ One important note with IVF indexes is that nearest neighbor search is approxima ## Resources Read more about indexing on `pgvector`'s [GitHub page](https://github.com/pgvector/pgvector#indexing). - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/learn/auth-deep-dive/auth-deep-dive-jwts.mdx b/apps/docs/content/guides/auth/auth-deep-dive/auth-deep-dive-jwts.mdx similarity index 96% rename from apps/docs/pages/learn/auth-deep-dive/auth-deep-dive-jwts.mdx rename to apps/docs/content/guides/auth/auth-deep-dive/auth-deep-dive-jwts.mdx index da53b86c49..c1f4c2816a 100644 --- a/apps/docs/pages/learn/auth-deep-dive/auth-deep-dive-jwts.mdx +++ b/apps/docs/content/guides/auth/auth-deep-dive/auth-deep-dive-jwts.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'auth-deep-dive-jwts', - title: 'Part One: JWTs', - description: 'Supabase Auth Deep Dive Part 1 - JWTs', - video: 'https://www.youtube.com/v/v3Exg5YpJvE', -} +--- +id: 'auth-deep-dive-jwts' +title: 'Part One: JWTs' +description: 'Supabase Auth Deep Dive Part 1 - JWTs' +video: 'https://www.youtube.com/v/v3Exg5YpJvE' +--- ### About @@ -192,7 +190,3 @@ Now that you understand what JWTs are and where they're used in Supabase, you ca - [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) - [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [supabase.com/dashboard](https://supabase.com/dashboard) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/learn/auth-deep-dive/auth-google-oauth.mdx b/apps/docs/content/guides/auth/auth-deep-dive/auth-google-oauth.mdx similarity index 93% rename from apps/docs/pages/learn/auth-deep-dive/auth-google-oauth.mdx rename to apps/docs/content/guides/auth/auth-deep-dive/auth-google-oauth.mdx index ec4143db84..7a51bb6eb3 100644 --- a/apps/docs/pages/learn/auth-deep-dive/auth-google-oauth.mdx +++ b/apps/docs/content/guides/auth/auth-deep-dive/auth-google-oauth.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'auth-google-oauth', - title: 'Part Five: Google OAuth', - description: 'Supabase Deep Dive Part 5: Google OAuth Provider', - video: 'https://www.youtube.com/v/_XM9ziOzWk4', -} +--- +id: 'auth-google-oauth' +title: 'Part Five: Google OAuth' +description: 'Supabase Deep Dive Part 5: Google OAuth Provider' +video: 'https://www.youtube.com/v/_XM9ziOzWk4' +--- ### About @@ -105,7 +103,3 @@ For any support please get in touch at beta at [supabase.com](https://supabase.c - Watch [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) {/* */} - Sign up for Supabase: [supabase.com/dashboard](https://supabase.com/dashboard) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/learn/auth-deep-dive/auth-gotrue.mdx b/apps/docs/content/guides/auth/auth-deep-dive/auth-gotrue.mdx similarity index 92% rename from apps/docs/pages/learn/auth-deep-dive/auth-gotrue.mdx rename to apps/docs/content/guides/auth/auth-deep-dive/auth-gotrue.mdx index d8b970c8d4..6df29f37dc 100644 --- a/apps/docs/pages/learn/auth-deep-dive/auth-gotrue.mdx +++ b/apps/docs/content/guides/auth/auth-deep-dive/auth-gotrue.mdx @@ -1,10 +1,8 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'auth-gotrue', - title: 'Part Four: GoTrue', - description: 'Supabase Deep Dive Part 4: GoTrue Overview', -} +--- +id: 'auth-gotrue' +title: 'Part Four: GoTrue' +description: 'Supabase Deep Dive Part 4: GoTrue Overview' +--- ### About @@ -79,7 +77,3 @@ In the next guide we'll be looking at how to setup external OAuth providers: Wat {/* */} - Watch [Part Five: Google OAuth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [supabase.com/dashboard](https://supabase.com/dashboard) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/learn/auth-deep-dive/auth-policies.mdx b/apps/docs/content/guides/auth/auth-deep-dive/auth-policies.mdx similarity index 95% rename from apps/docs/pages/learn/auth-deep-dive/auth-policies.mdx rename to apps/docs/content/guides/auth/auth-deep-dive/auth-policies.mdx index 01c1ea5fba..651a534736 100644 --- a/apps/docs/pages/learn/auth-deep-dive/auth-policies.mdx +++ b/apps/docs/content/guides/auth/auth-deep-dive/auth-policies.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'auth-policies', - title: 'Part Three: Policies', - description: 'Supabase Auth Deep Dive Part 3: User Based Access Policies', - video: 'https://www.youtube.com/v/0LvCOlELs5U', -} +--- +id: 'auth-policies' +title: 'Part Three: Policies' +description: 'Supabase Auth Deep Dive Part 3: User Based Access Policies' +video: 'https://www.youtube.com/v/0LvCOlELs5U' +--- ### About @@ -186,7 +184,3 @@ You can get as creative as you like with these policies. - Watch [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) - Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [supabase.com/dashboard](https://supabase.com/dashboard) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/learn/auth-deep-dive/auth-row-level-security.mdx b/apps/docs/content/guides/auth/auth-deep-dive/auth-row-level-security.mdx similarity index 93% rename from apps/docs/pages/learn/auth-deep-dive/auth-row-level-security.mdx rename to apps/docs/content/guides/auth/auth-deep-dive/auth-row-level-security.mdx index a53badb6fc..39a98539b4 100644 --- a/apps/docs/pages/learn/auth-deep-dive/auth-row-level-security.mdx +++ b/apps/docs/content/guides/auth/auth-deep-dive/auth-row-level-security.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'auth-row-level-security', - title: 'Part Two: Row Level Security', - description: 'Supabase Auth Deep Dive Part Two - Row Level Security', - video: 'https://www.youtube.com/v/qY_iQ10IUhs', -} +--- +id: 'auth-row-level-security' +title: 'Part Two: Row Level Security' +description: 'Supabase Auth Deep Dive Part Two - Row Level Security' +video: 'https://www.youtube.com/v/qY_iQ10IUhs' +--- ### About @@ -135,7 +133,3 @@ In the next guide we will look at using Policies in combination with User Accoun - Watch [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) - Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [supabase.com/dashboard](https://supabase.com/dashboard) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/content/guides/functions.mdx b/apps/docs/content/guides/functions.mdx new file mode 100644 index 0000000000..4889ef00ef --- /dev/null +++ b/apps/docs/content/guides/functions.mdx @@ -0,0 +1,170 @@ +--- +id: 'functions' +title: 'Edge Functions' +description: 'Globally distributed TypeScript functions.' +subtitle: 'Globally distributed TypeScript functions.' +sidebar_label: 'Overview' +hideToc: true +--- + +Edge Functions are server-side TypeScript functions, distributed globally at the edge—close to your users. They can be used for listening to webhooks or integrating your Supabase project with third-parties [like Stripe](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/stripe-webhooks). Edge Functions are developed using [Deno](https://deno.com), which offers a few benefits to you as a developer: + +- It is open source. +- It is portable. Supabase Edge Functions run locally, and on any other Deno-compatible platform (including self-hosted infrastructure). +- It is TypeScript first and supports WASM. +- Edge Functions are globally distributed for low-latency. + + + +## Examples + +Check out the [Edge Function Examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions) in our GitHub repository. + +
+ {[ + { + name: 'With supabase-js', + description: 'Use the Supabase client inside your Edge Function.', + href: '/guides/functions/auth', + }, + { + name: 'Type-Safe SQL with Kysely', + description: + 'Combining Kysely with Deno Postgres gives you a convenient developer experience for interacting directly with your Postgres database.', + href: '/guides/functions/kysely-postgres', + }, + { + name: 'With CORS headers', + description: 'Send CORS headers for invoking from the browser.', + href: '/guides/functions/cors', + }, + { + name: 'React Native with Stripe', + description: 'Full example for using Supabase and Stripe, with Expo.', + href: 'https://github.com/supabase-community/expo-stripe-payments-with-supabase-functions', + }, + { + name: 'Flutter with Stripe', + description: 'Full example for using Supabase and Stripe, with Flutter.', + href: 'https://github.com/supabase-community/flutter-stripe-payments-with-supabase-functions', + }, + { + name: 'Building a RESTful Service API', + description: + 'Learn how to use HTTP methods and paths to build a RESTful service for managing tasks.', + href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/restful-tasks/index.ts', + }, + { + name: 'Working with Supabase Storage', + description: 'An example on reading a file from Supabase Storage.', + href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/read-storage/index.ts', + }, + { + name: 'Open Graph Image Generation', + description: 'Generate Open Graph images with Deno and Supabase Edge Functions.', + href: '/guides/functions/examples/og-image', + }, + { + name: 'OG Image Generation & Storage CDN Caching', + description: 'Cache generated images with Supabase Storage CDN.', + href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/og-image-with-storage-cdn', + }, + { + name: 'Get User Location', + description: `Get user location data from user's IP address.`, + href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/location', + }, + { + name: 'Cloudflare Turnstile', + description: `Protecting Forms with Cloudflare Turnstile.`, + href: '/guides/functions/examples/cloudflare-turnstile', + }, + { + name: 'Connect to Postgres', + description: `Connecting to Postgres from Edge Functions.`, + href: '/guides/functions/connect-to-postgres', + }, + { + name: 'Github Actions', + description: `Deploying Edge Functions with GitHub Actions.`, + href: '/guides/functions/examples/github-actions', + }, + { + name: 'Oak Server Middleware', + description: `Request Routing with Oak server middleware.`, + href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/oak-server', + }, + { + name: 'Hugging Face', + description: `Access 100,000+ Machine Learning models.`, + href: '/guides/ai/examples/huggingface-image-captioning', + }, + { + name: 'OpenAI', + description: `Using OpenAI in Edge Functions.`, + href: '/guides/ai/examples/openai', + }, + { + name: 'Stripe Webhooks', + description: `Handling signed Stripe Webhooks with Edge Functions.`, + href: '/guides/functions/examples/stripe-webhooks', + }, + { + name: 'Send emails', + description: `Send emails in Edge Functions with Resend.`, + href: '/guides/functions/examples/send-emails', + }, + { + name: 'Web Stream', + description: `Server-Sent Events in Edge Functions.`, + href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/streams', + }, + { + name: 'Puppeteer', + description: `Generate screenshots with Puppeteer.`, + href: '/guides/functions/examples/screenshots', + }, + { + name: 'Discord Bot', + description: `Building a Slash Command Discord Bot with Edge Functions.`, + href: '/guides/functions/examples/discord-bot', + }, + { + name: 'Telegram Bot', + description: `Building a Telegram Bot with Edge Functions.`, + href: '/guides/functions/examples/telegram-bot', + }, + { + name: 'Upload File', + description: `Process multipart/form-data.`, + href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/file-upload-storage', + }, + { + name: 'Upstash Redis', + description: `Build an Edge Functions Counter with Upstash Redis.`, + href: '/guides/functions/examples/upstash-redis', + }, + { + name: 'Rate Limiting', + description: `Rate Limiting Edge Functions with Upstash Redis.`, + href: '/guides/functions/examples/rate-limiting', + }, + { + name: 'Slack Bot Mention Edge Function', + description: `Slack Bot handling Slack mentions in Edge Function`, + href: '/guides/functions/examples/slack-bot-mention', + }, + ].map((x) => ( +
+ + + {x.description} + + +
+ ))} +
diff --git a/apps/docs/pages/guides/functions/auth.mdx b/apps/docs/content/guides/functions/auth.mdx similarity index 88% rename from apps/docs/pages/guides/functions/auth.mdx rename to apps/docs/content/guides/functions/auth.mdx index 963c7af0be..609f18a46d 100644 --- a/apps/docs/pages/guides/functions/auth.mdx +++ b/apps/docs/content/guides/functions/auth.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'auth', - title: 'Integrating With Supabase Auth', - description: 'Supabase Edge Functions and Auth.', - subtitle: 'Supabase Edge Functions and Auth.', -} +--- +id: 'auth' +title: 'Integrating With Supabase Auth' +description: 'Supabase Edge Functions and Auth.' +subtitle: 'Supabase Edge Functions and Auth.' +--- Edge Functions work seamlessly with [Supabase Auth](/docs/guides/auth). @@ -86,7 +84,3 @@ Deno.serve(async (req: Request) => { ## Example code See a full [example on GitHub](https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts). - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/cicd-workflow.mdx b/apps/docs/content/guides/functions/cicd-workflow.mdx similarity index 84% rename from apps/docs/pages/guides/functions/cicd-workflow.mdx rename to apps/docs/content/guides/functions/cicd-workflow.mdx index 0534773453..76cc5d3caf 100644 --- a/apps/docs/pages/guides/functions/cicd-workflow.mdx +++ b/apps/docs/content/guides/functions/cicd-workflow.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'cicd-workflow', - title: 'Deploying with CI / CD pipelines', - description: 'Use GitHub Actions, Bitbucket, and GitLab CI to deploy your Edge Functions.', - subtitle: 'Use GitHub Actions, Bitbucket, and GitLab CI to deploy your Edge Functions.', - tocVideo: '6OMVWiiycLs', -} +--- +id: 'cicd-workflow' +title: 'Deploying with CI / CD pipelines' +description: 'Use GitHub Actions, Bitbucket, and GitLab CI to deploy your Edge Functions.' +subtitle: 'Use GitHub Actions, Bitbucket, and GitLab CI to deploy your Edge Functions.' +tocVideo: '6OMVWiiycLs' +--- You can use popular CI / CD tools like GitHub Actions, Bitbucket, and GitLab CI to automate Edge Function deployments. @@ -116,7 +114,3 @@ verify_jwt = false ## Resources - See the [example on GitHub](https://github.com/supabase/supabase/blob/master/examples/edge-functions/.github/workflows/deploy.yaml). - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/connect-to-postgres.mdx b/apps/docs/content/guides/functions/connect-to-postgres.mdx similarity index 89% rename from apps/docs/pages/guides/functions/connect-to-postgres.mdx rename to apps/docs/content/guides/functions/connect-to-postgres.mdx index b10c1f7c3e..ac1da710b4 100644 --- a/apps/docs/pages/guides/functions/connect-to-postgres.mdx +++ b/apps/docs/content/guides/functions/connect-to-postgres.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'examples-postgres-on-the-edge', - title: 'Connecting directly to Postgres', - description: 'Connecting to Postgres from Edge Functions.', - subtitle: 'Connecting to Postgres from Edge Functions.', - tocVideo: 'cl7EuF1-RsY', -} +--- +id: 'examples-postgres-on-the-edge' +title: 'Connecting directly to Postgres' +description: 'Connecting to Postgres from Edge Functions.' +subtitle: 'Connecting to Postgres from Edge Functions.' +tocVideo: 'cl7EuF1-RsY' +--- Connect to your Postgres database from an Edge Function by using the `supabase-js` client. You can also use other Postgres clients like [Deno Postgres](https://deno.land/x/postgres) @@ -115,7 +113,3 @@ DENO_TLS_CA_STORE=mozilla,system allowFullScreen > - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/cors.mdx b/apps/docs/content/guides/functions/cors.mdx similarity index 80% rename from apps/docs/pages/guides/functions/cors.mdx rename to apps/docs/content/guides/functions/cors.mdx index 758b90cce3..dc357aae63 100644 --- a/apps/docs/pages/guides/functions/cors.mdx +++ b/apps/docs/content/guides/functions/cors.mdx @@ -1,10 +1,8 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'functions-cors', - title: 'CORS (Cross-Origin Resource Sharing) support for Invoking from the browser', - description: 'Add CORS headers to invoke Edge Functions from the browser.', -} +--- +id: 'functions-cors' +title: 'CORS (Cross-Origin Resource Sharing) support for Invoking from the browser' +description: 'Add CORS headers to invoke Edge Functions from the browser.' +--- To invoke edge functions from the browser, you need to handle [CORS Preflight](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) requests. @@ -52,7 +50,3 @@ Deno.serve(async (req) => { } }) ``` - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/dart-edge.mdx b/apps/docs/content/guides/functions/dart-edge.mdx similarity index 94% rename from apps/docs/pages/guides/functions/dart-edge.mdx rename to apps/docs/content/guides/functions/dart-edge.mdx index 66b8c7513a..32f89e469a 100644 --- a/apps/docs/pages/guides/functions/dart-edge.mdx +++ b/apps/docs/content/guides/functions/dart-edge.mdx @@ -1,10 +1,8 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'functions-dart-edge', - title: 'Dart Edge', - description: 'Write your functions using Dart.', -} +--- +id: 'functions-dart-edge' +title: 'Dart Edge' +description: 'Write your functions using Dart.' +--- [Dart Edge](https://docs.dartedge.dev/), a project built and maintained by [Invertase](https://invertase.io/), enables Dart code to be run on different edge environments. This guide will walk you through how you can start using Dart Edge to write your backend code using Dart and run it on Supabase. @@ -156,7 +154,3 @@ supabase functions deploy dart_edge ``` You will be asked to provide the project reference of your Supabase instance to which you want to deploy the function. You can [link your local project to your Supabase instance](https://supabase.com/docs/guides/getting-started/local-development#link-your-project) to avoid having to provide the Supabase reference every time you deploy. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/debugging.mdx b/apps/docs/content/guides/functions/debugging.mdx similarity index 96% rename from apps/docs/pages/guides/functions/debugging.mdx rename to apps/docs/content/guides/functions/debugging.mdx index afcd52d6e3..c9bccc5c50 100644 --- a/apps/docs/pages/guides/functions/debugging.mdx +++ b/apps/docs/content/guides/functions/debugging.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'functions-debugging', - title: 'Debugging Edge Functions', - description: 'Debugging tips and Edge Function limitations.', - subtitle: 'Debugging tips and Edge Function limitations.', -} +--- +id: 'functions-debugging' +title: 'Debugging Edge Functions' +description: 'Debugging tips and Edge Function limitations.' +subtitle: 'Debugging tips and Edge Function limitations.' +--- ## Logs & debugging @@ -166,7 +164,3 @@ deno info --import-map=/path/to/import_map.json /path/to/function/index.ts - Memory limit for the function: 150 MB (heap) + 150 MB (external - array buffers/ WASM) - Wall clock limit: 400 s - CPU Time: 2 s - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/deploy.mdx b/apps/docs/content/guides/functions/deploy.mdx similarity index 86% rename from apps/docs/pages/guides/functions/deploy.mdx rename to apps/docs/content/guides/functions/deploy.mdx index 838d3b0ed5..9e4c6eebef 100644 --- a/apps/docs/pages/guides/functions/deploy.mdx +++ b/apps/docs/content/guides/functions/deploy.mdx @@ -1,12 +1,10 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'functions-deploy', - title: 'Deploy to Production', - description: 'Deploy your Edge Functions to your remote Supabase Project.', - subtitle: 'Deploy your Edge Functions to your remote Supabase Project.', - tocVideo: '5OWH9c4u68M', -} +--- +id: 'functions-deploy' +title: 'Deploy to Production' +description: 'Deploy your Edge Functions to your remote Supabase Project.' +subtitle: 'Deploy your Edge Functions to your remote Supabase Project.' +tocVideo: '5OWH9c4u68M' +--- Once you have developed your Edge Functions locally, you can deploy them to your Supabase project. @@ -101,7 +99,3 @@ const { data, error } = await supabase.functions.invoke('hello-world', { You should receive the response `{ "message":"Hello Functions!" }`. - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/examples/cloudflare-turnstile.mdx b/apps/docs/content/guides/functions/examples/cloudflare-turnstile.mdx similarity index 86% rename from apps/docs/pages/guides/functions/examples/cloudflare-turnstile.mdx rename to apps/docs/content/guides/functions/examples/cloudflare-turnstile.mdx index c1c0b694e1..2e6b1bd135 100644 --- a/apps/docs/pages/guides/functions/examples/cloudflare-turnstile.mdx +++ b/apps/docs/content/guides/functions/examples/cloudflare-turnstile.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'examples-cloudflare-turnstile', - title: 'CAPTCHA support with Cloudflare Turnstile', - description: 'Protecting Forms with Cloudflare Turnstile.', - video: 'https://www.youtube.com/v/OwW0znboh60', -} +--- +id: 'examples-cloudflare-turnstile' +title: 'CAPTCHA support with Cloudflare Turnstile' +description: 'Protecting Forms with Cloudflare Turnstile.' +video: 'https://www.youtube.com/v/OwW0znboh60' +---
- -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/realtime/subscribing-to-database-changes.mdx b/apps/docs/content/guides/realtime/subscribing-to-database-changes.mdx similarity index 85% rename from apps/docs/pages/guides/realtime/subscribing-to-database-changes.mdx rename to apps/docs/content/guides/realtime/subscribing-to-database-changes.mdx index 95af82a7e6..05878e66d6 100644 --- a/apps/docs/pages/guides/realtime/subscribing-to-database-changes.mdx +++ b/apps/docs/content/guides/realtime/subscribing-to-database-changes.mdx @@ -1,11 +1,9 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'subscribing-to-database-changes', - title: 'Subscribing to Database Changes', - description: 'Listen to database changes in real-time from your website or application.', - sidebar_label: 'Videos', -} +--- +id: 'subscribing-to-database-changes' +title: 'Subscribing to Database Changes' +description: 'Listen to database changes in real-time from your website or application.' +sidebar_label: 'Videos' +--- Supabase allows you to subscribe to real-time changes on your database from your client application. @@ -97,7 +95,3 @@ const channel = supabase - [Flutter](/docs/reference/dart/stream) - [Python](/docs/reference/python/subscribe) - [C#](/docs/reference/csharp/subscribe) - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/ai/[[...slug]].tsx b/apps/docs/pages/guides/ai/[[...slug]].tsx new file mode 100644 index 0000000000..af8cc71390 --- /dev/null +++ b/apps/docs/pages/guides/ai/[[...slug]].tsx @@ -0,0 +1,28 @@ +import { type GetStaticPaths, type GetStaticProps, type InferGetStaticPropsType } from 'next' +import { MDXRemote } from 'next-mdx-remote' + +import components from '~/components' +import Layout from '~/layouts/DefaultGuideLayout' +import { getGuidesStaticPaths, getGuidesStaticProps } from '~/lib/docs' + +export const getStaticPaths = (async () => { + return getGuidesStaticPaths('ai') +}) satisfies GetStaticPaths + +export const getStaticProps = (async (args) => { + return getGuidesStaticProps('ai', args) +}) satisfies GetStaticProps + +export default function AiGuide({ + frontmatter, + mdxSource, + editLink, +}: InferGetStaticPropsType) { + const { hideToc, ...meta } = frontmatter + + return ( + + + + ) +} diff --git a/apps/docs/pages/guides/functions.mdx b/apps/docs/pages/guides/functions.mdx deleted file mode 100644 index 65233fe00e..0000000000 --- a/apps/docs/pages/guides/functions.mdx +++ /dev/null @@ -1,178 +0,0 @@ -import Layout from '~/layouts/DefaultGuideLayout' - -export const meta = { - id: 'functions', - title: 'Edge Functions', - description: 'Globally distributed TypeScript functions.', - subtitle: 'Globally distributed TypeScript functions.', - sidebar_label: 'Overview', - hide_table_of_contents: true, -} - -Edge Functions are server-side TypeScript functions, distributed globally at the edge—close to your users. They can be used for listening to webhooks or integrating your Supabase project with third-parties [like Stripe](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/stripe-webhooks). Edge Functions are developed using [Deno](https://deno.com), which offers a few benefits to you as a developer: - -- It is open source. -- It is portable. Supabase Edge Functions run locally, and on any other Deno-compatible platform (including self-hosted infrastructure). -- It is TypeScript first and supports WASM. -- Edge Functions are globally distributed for low-latency. - -
- -
- -## Examples - -Check out the [Edge Function Examples](https://github.com/supabase/supabase/tree/master/examples/edge-functions) in our GitHub repository. - -
- {examples.map((x) => ( -
- - - {x.description} - - -
- ))} -
- -export const examples = [ - { - name: 'With supabase-js', - description: 'Use the Supabase client inside your Edge Function.', - href: '/guides/functions/auth', - }, - { - name: 'Type-Safe SQL with Kysely', - description: - 'Combining Kysely with Deno Postgres gives you a convenient developer experience for interacting directly with your Postgres database.', - href: '/guides/functions/kysely-postgres', - }, - { - name: 'With CORS headers', - description: 'Send CORS headers for invoking from the browser.', - href: '/guides/functions/cors', - }, - { - name: 'React Native with Stripe', - description: 'Full example for using Supabase and Stripe, with Expo.', - href: 'https://github.com/supabase-community/expo-stripe-payments-with-supabase-functions', - }, - { - name: 'Flutter with Stripe', - description: 'Full example for using Supabase and Stripe, with Flutter.', - href: 'https://github.com/supabase-community/flutter-stripe-payments-with-supabase-functions', - }, - { - name: 'Building a RESTful Service API', - description: - 'Learn how to use HTTP methods and paths to build a RESTful service for managing tasks.', - href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/restful-tasks/index.ts', - }, - { - name: 'Working with Supabase Storage', - description: 'An example on reading a file from Supabase Storage.', - href: 'https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/read-storage/index.ts', - }, - { - name: 'Open Graph Image Generation', - description: 'Generate Open Graph images with Deno and Supabase Edge Functions.', - href: '/guides/functions/examples/og-image', - }, - { - name: 'OG Image Generation & Storage CDN Caching', - description: 'Cache generated images with Supabase Storage CDN.', - href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/og-image-with-storage-cdn', - }, - { - name: 'Get User Location', - description: `Get user location data from user's IP address.`, - href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/location', - }, - { - name: 'Cloudflare Turnstile', - description: `Protecting Forms with Cloudflare Turnstile.`, - href: '/guides/functions/examples/cloudflare-turnstile', - }, - { - name: 'Connect to Postgres', - description: `Connecting to Postgres from Edge Functions.`, - href: '/guides/functions/connect-to-postgres', - }, - { - name: 'Github Actions', - description: `Deploying Edge Functions with GitHub Actions.`, - href: '/guides/functions/examples/github-actions', - }, - { - name: 'Oak Server Middleware', - description: `Request Routing with Oak server middleware.`, - href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/oak-server', - }, - { - name: 'Hugging Face', - description: `Access 100,000+ Machine Learning models.`, - href: '/guides/ai/examples/huggingface-image-captioning', - }, - { - name: 'OpenAI', - description: `Using OpenAI in Edge Functions.`, - href: '/guides/ai/examples/openai', - }, - { - name: 'Stripe Webhooks', - description: `Handling signed Stripe Webhooks with Edge Functions.`, - href: '/guides/functions/examples/stripe-webhooks', - }, - { - name: 'Send emails', - description: `Send emails in Edge Functions with Resend.`, - href: '/guides/functions/examples/send-emails', - }, - { - name: 'Web Stream', - description: `Server-Sent Events in Edge Functions.`, - href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/streams', - }, - { - name: 'Puppeteer', - description: `Generate screenshots with Puppeteer.`, - href: '/guides/functions/examples/screenshots', - }, - { - name: 'Discord Bot', - description: `Building a Slash Command Discord Bot with Edge Functions.`, - href: '/guides/functions/examples/discord-bot', - }, - { - name: 'Telegram Bot', - description: `Building a Telegram Bot with Edge Functions.`, - href: '/guides/functions/examples/telegram-bot', - }, - { - name: 'Upload File', - description: `Process multipart/form-data.`, - href: 'https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/file-upload-storage', - }, - { - name: 'Upstash Redis', - description: `Build an Edge Functions Counter with Upstash Redis.`, - href: '/guides/functions/examples/upstash-redis', - }, - { - name: 'Rate Limiting', - description: `Rate Limiting Edge Functions with Upstash Redis.`, - href: '/guides/functions/examples/rate-limiting', - }, - { - name: 'Slack Bot Mention Edge Function', - description: `Slack Bot handling Slack mentions in Edge Function`, - href: '/guides/functions/examples/slack-bot-mention', - }, -] - -export const Page = ({ children }) => - -export default Page diff --git a/apps/docs/pages/guides/functions/[[...slug]].tsx b/apps/docs/pages/guides/functions/[[...slug]].tsx new file mode 100644 index 0000000000..8e41b131d3 --- /dev/null +++ b/apps/docs/pages/guides/functions/[[...slug]].tsx @@ -0,0 +1,28 @@ +import { type GetStaticPaths, type GetStaticProps, type InferGetStaticPropsType } from 'next' +import { MDXRemote } from 'next-mdx-remote' + +import components from '~/components' +import Layout from '~/layouts/DefaultGuideLayout' +import { getGuidesStaticPaths, getGuidesStaticProps } from '~/lib/docs' + +export const getStaticPaths = (async () => { + return getGuidesStaticPaths('functions') +}) satisfies GetStaticPaths + +export const getStaticProps = (async (args) => { + return getGuidesStaticProps('functions', args) +}) satisfies GetStaticProps + +export default function FunctionsGuide({ + frontmatter, + mdxSource, + editLink, +}: InferGetStaticPropsType) { + const { hideToc, ...meta } = frontmatter + + return ( + + + + ) +} diff --git a/apps/docs/pages/guides/realtime/[[...slug]].tsx b/apps/docs/pages/guides/realtime/[[...slug]].tsx new file mode 100644 index 0000000000..dddabae2a8 --- /dev/null +++ b/apps/docs/pages/guides/realtime/[[...slug]].tsx @@ -0,0 +1,28 @@ +import { type GetStaticPaths, type GetStaticProps, type InferGetStaticPropsType } from 'next' +import { MDXRemote } from 'next-mdx-remote' + +import components from '~/components' +import Layout from '~/layouts/DefaultGuideLayout' +import { getGuidesStaticPaths, getGuidesStaticProps } from '~/lib/docs' + +export const getStaticPaths = (async () => { + return getGuidesStaticPaths('realtime') +}) satisfies GetStaticPaths + +export const getStaticProps = (async (args) => { + return getGuidesStaticProps('realtime', args) +}) satisfies GetStaticProps + +export default function RealtimeGuide({ + frontmatter, + mdxSource, + editLink, +}: InferGetStaticPropsType) { + const { hideToc, ...meta } = frontmatter + + return ( + + + + ) +} diff --git a/apps/docs/scripts/codemod/mdx-meta.mjs b/apps/docs/scripts/codemod/mdx-meta.mjs index 03b0719e6b..99c9b212fc 100644 --- a/apps/docs/scripts/codemod/mdx-meta.mjs +++ b/apps/docs/scripts/codemod/mdx-meta.mjs @@ -7,7 +7,7 @@ * Also deletes import and export statements. */ -let SUB_DIR = 'storage' +let SUB_DIR = 'ai' import { parse } from 'acorn' import { fromMarkdown } from 'mdast-util-from-markdown' diff --git a/apps/www/lib/redirects.js b/apps/www/lib/redirects.js index 9c3b2981cf..6f9e4b41c8 100644 --- a/apps/www/lib/redirects.js +++ b/apps/www/lib/redirects.js @@ -2355,17 +2355,42 @@ module.exports = [ }, { permanent: true, - source: '/guides/database/large-datasets', - destination: '/guides/database/import-data', + source: '/docs/guides/database/large-datasets', + destination: '/docs/guides/database/import-data', }, { permanent: true, - source: '/guides/api/rest/debugging-performance', - destination: '/guides/database/debugging-performance', + source: '/docs/guides/api/rest/debugging-performance', + destination: '/docs/guides/database/debugging-performance', }, { permanent: true, - source: '/guides/api/rest/joins-and-nesting', - destination: '/guides/database/joins-and-nesting', + source: '/docs/guides/api/rest/joins-and-nesting', + destination: '/docs/guides/database/joins-and-nesting', + }, + { + permanent: true, + source: '/docs/learn/auth-deep-dive/auth-deep-dive-jwts', + destination: '/docs/guides/auth/auth-deep-dive/auth-deep-dive-jwts', + }, + { + permanent: true, + source: '/docs/learn/auth-deep-dive/auth-row-level-security', + destination: '/docs/guides/auth/auth-deep-dive/auth-row-level-security', + }, + { + permanent: true, + source: '/docs/learn/auth-deep-dive/auth-policies', + destination: '/docs/guides/auth/auth-deep-dive/auth-policies', + }, + { + permanent: true, + source: '/docs/learn/auth-deep-dive/auth-gotrue', + destination: '/docs/guides/auth/auth-deep-dive/auth-gotrue', + }, + { + permanent: true, + source: '/docs/learn/auth-deep-dive/auth-google-oauth', + destination: '/docs/guides/auth/auth-deep-dive/auth-google-oauth', }, ]