Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

move more pages over

Jonathan Summers-Muir2cec0307b321
diff --git a/apps/temp-docs/components/nav/SideBar.tsx b/apps/temp-docs/components/nav/SideBar.tsx
index de6fd0b5226..8ee0c025c79 100644
--- a/apps/temp-docs/components/nav/SideBar.tsx
+++ b/apps/temp-docs/components/nav/SideBar.tsx
@@ -5,51 +5,56 @@ import { useRouter } from 'next/router'
const SideBar = ({ menuItems }: { menuItems: any }) => {
const { asPath } = useRouter()
return (
- <div className="dark:bg-scale-200 dark:border-scale-400 thin-scrollbar sidebar-width sticky top-0 flex h-screen overflow-y-scroll border-r py-4">
- <Menu className="w-full">
- <div>
- {Object.keys(menuItems).map((key) => {
- return (
- <div key={key} className="mb-4">
- <Menu.Group title={key} />
- {menuItems[key].map(
- (item: { link: string; text: string; sections: Array<any> }) => (
- <span key={item.link}>
- {Array.isArray(item.sections) ? (
- <>
- <Menu.Group title={item.text} />
- {item.sections.map((section) => (
- <Link href={section.link} key={`${item.text}-${section.text}`}>
- <a>
- <Menu.Item active={asPath == section.link}>
- {section.text}
- </Menu.Item>
- </a>
- </Link>
- ))}
- </>
- ) : (
- <Link href={item.link}>
+ <div
+ className="
+ dark:bg-scale-200
+ dark:border-scale-400
+ sidebar-width
+ sticky
+ top-0
+ flex
+ h-screen
+ overflow-y-scroll
+ border-r
+ py-10
+ px-6"
+ >
+ <Menu className="w-full flex-col gap-12" type="pills">
+ {Object.keys(menuItems).map((key) => {
+ return (
+ <div className="mb-8">
+ <Menu.Group title={key} />
+ {menuItems[key].map((item: { link: string; text: string; sections: Array<any> }) => (
+ <span key={item.link}>
+ {Array.isArray(item.sections) ? (
+ <>
+ <Menu.Group title={item.text} />
+ {item.sections.map((section) => (
+ <Link href={section.link} key={`${item.text}-${section.text}`}>
<a>
- <Menu.Item active={asPath === item.link}>
- <div
- className={
- asPath === item.link ? 'text-brand-900' : 'text-scale-1000'
- }
- >
- {item.text}
- </div>
- </Menu.Item>
+ <Menu.Item active={asPath == section.link}>{section.text}</Menu.Item>
</a>
</Link>
- )}
- </span>
- )
- )}
- </div>
- )
- })}
- </div>
+ ))}
+ </>
+ ) : (
+ <Link href={item.link}>
+ <a>
+ <Menu.Item active={asPath === item.link}>
+ {/* <div
+ // className={asPath === item.link ? 'text-brand-900' : 'text-scale-1000'}
+ > */}
+ {item.text}
+ {/* </div> */}
+ </Menu.Item>
+ </a>
+ </Link>
+ )}
+ </span>
+ ))}
+ </div>
+ )
+ })}
</Menu>
</div>
)
diff --git a/apps/temp-docs/docs/going-into-prod.mdx b/apps/temp-docs/docs/going-into-prod.mdx
deleted file mode 100644
index 9f93fe8a95d..00000000000
--- a/apps/temp-docs/docs/going-into-prod.mdx
+++ /dev/null
@@ -1,53 +0,0 @@
----
-id: going-into-prod
-title: Going into Prod Checklist
-description: 'Things to do before making your app publicly available'
----
-
-# Going into Prod Checklist
-
-After developing your project, and deciding it's time to Go Live With Real Users, you should run through this checklist to ensure that your project is:
-
-- secure
-- won't falter under the expected load
-- remains available whilst in production
-
-## Security
-
-- Ensure RLS is enabled
- - Tables that do not have RLS enabled with reasonable policies allow any client to access and modify their data. This is unlikely to be what you want in the majority of cases.
- - [Learn more about RLS](/docs/guides/auth/row-level-security)
-- Ensure replication is disabled for tables containing sensitive data:
- - Today, Realtime does not respect RLS policies and any client with your anon key can listen to changes on tables where replication is enabled.
- - Go to the Database > Replication page in the Supabase Dashboard to manage these settings
- - We are launching [RLS for realtime](https://github.com/supabase/walrus) soon, but in the meantime you should only use it for tables containing public data (scoreboards, blog posts, etc.)
-- Enable 2FA on Github
- - Since your Github account gives you administrative rights to your Supabase project, you should protect it with a strong password and 2FA using a U2F key or a TOTP app.
-- Ensure email confirmations are enabled in the Auth > Settings page
-- Use a custom SMTP server for auth emails so that your users can see that the mails are coming from a trusted domain (preferably the same domain that your app is hosted on). (grab SMTP credentials from any major email provider such as SendGrid, AWS SES, etc.)
-- Think hard about how *you* would abuse your service as an attacker, and mitigate
-- Review these [common cybersecurity threats](https://auth0.com/docs/security/prevent-threats)
-
-## Performance
-
-- Ensure that you have suitable indices to cater to your common query patterns
- - [learn more about indexes in postgres](https://www.enterprisedb.com/postgres-tutorials/overview-postgresql-indexes)
- - pg_stat_statements can help you [identify hot or slow queries](https://www.virtual-dba.com/blog/postgresql-performance-identifying-hot-and-slow-queries/)
-- Perform load testing (preferably on a staging env)
- - tools like [k6](https://k6.io/) can simulate traffic from many different users
-- If you find you require more resources, contact [email protected] to upgrade to PAYG for bigger servers
-
-## Availability
-
-- Use your own SMTP credentials so that you have full control over the deliverability of your transactional auth emails (see Auth > Settings)
- - you can grab SMTP credentials from any major email provider such as SendGrid, AWS SES, etc.
- - the default rate limit for auth emails provided by Supabase is 30 new users per hour, if doing a major public announcement you will likely require more than this
-- If your application is on the free tier and is **not** expected to be queried at least once every 7 days, then it may be paused by Supabase to save on server resources
- - you can restore paused projects from the Supabase dashboard
- - upgrade to Pro to guarantee that your project will not be paused for inactivity
-- Database backups are not available for download on the free tier
- - You can set up your own backup systems using tools like [pg_dump](https://www.postgresqltutorial.com/postgresql-backup-database/) or [wal-g](https://github.com/wal-g/wal-g)
- - Nightly backups for Pro tier projects are available on the Supabase dashboard for up to 7 days
-- upgrading to the Supabase Pro Tier will give you access to email support on [email protected]
-
-This checklist is always growing so be sure to check back frequently, and also feel free to suggest additions and amendments by making a PR on [Github](https://github.com/supabase/supabase).
diff --git a/apps/temp-docs/layouts/Guide.tsx b/apps/temp-docs/layouts/Guide.tsx
index 3601a32d97f..29bd45e8ad3 100644
--- a/apps/temp-docs/layouts/Guide.tsx
+++ b/apps/temp-docs/layouts/Guide.tsx
@@ -1,40 +1,10 @@
import { MDXProvider } from '@mdx-js/react'
import { NextSeo } from 'next-seo'
-import Image from 'next/image'
import { useRouter } from 'next/router'
import menuItems from '~/components/nav/menu-items.json'
import Layout from '~/layouts/DocsLayout'
import { getPageType } from '~/lib/helpers'
-
-const ignoreClass = 'ignore-on-export'
-
-function getComponents(type: any) {
- const components = {
- img: (props: any) => {
- if (props.className !== ignoreClass) {
- return (
- <div
- className={[
- 'next-image--dynamic-fill',
- type === 'blog' && 'to-scale-400 from-scale-500 rounded-lg border bg-gradient-to-r',
- ].join(' ')}
- >
- <Image
- {...props}
- className={['next-image--dynamic-fill', type === 'blog' && 'rounded-md border'].join(
- ' '
- )}
- layout="fill"
- />
- </div>
- )
- }
- return <img {...props} />
- },
- }
-
- return components
-}
+import getComponents from '~/lib/mdx/getComponents'
export default function ContentsLayout({ context }: any) {
const { asPath } = useRouter()
diff --git a/apps/temp-docs/lib/mdx/getComponents.tsx b/apps/temp-docs/lib/mdx/getComponents.tsx
new file mode 100644
index 00000000000..004fcd2fc90
--- /dev/null
+++ b/apps/temp-docs/lib/mdx/getComponents.tsx
@@ -0,0 +1,37 @@
+import Image from 'next/image'
+import LinkCard from '~/components/LinkCard'
+import LinkCardsWrapper from '~/components/LinkCardsWrapper'
+
+const ignoreClass = 'ignore-on-export'
+
+function getComponents(type: any) {
+ const components = {
+ LinkCardsWrapper: (props: any) => <LinkCardsWrapper {...props} />,
+ LinkCard: (props: any) => <LinkCard {...props} />,
+ img: (props: any) => {
+ if (props.className !== ignoreClass) {
+ return (
+ <div
+ className={[
+ 'next-image--dynamic-fill',
+ type === 'blog' && 'to-scale-400 from-scale-500 rounded-lg border bg-gradient-to-r',
+ ].join(' ')}
+ >
+ <Image
+ {...props}
+ className={['next-image--dynamic-fill', type === 'blog' && 'rounded-md border'].join(
+ ' '
+ )}
+ layout="fill"
+ />
+ </div>
+ )
+ }
+ return <img {...props} />
+ },
+ }
+
+ return components
+}
+
+export default getComponents
diff --git a/apps/temp-docs/next.config.mjs b/apps/temp-docs/next.config.mjs
index b020d9563eb..ac4cf4ffe3b 100644
--- a/apps/temp-docs/next.config.mjs
+++ b/apps/temp-docs/next.config.mjs
@@ -17,7 +17,7 @@ const nextConfig = {
trailingSlash: false,
reactStrictMode: true,
images: {
- domains: ['avatars.githubusercontent.com'],
+ domains: ['avatars.githubusercontent.com', 'supabase.com'],
},
}
diff --git a/apps/temp-docs/docs/404.mdx b/apps/temp-docs/pages/404.mdx
similarity index 100%
rename from apps/temp-docs/docs/404.mdx
rename to apps/temp-docs/pages/404.mdx
diff --git a/apps/temp-docs/docs/architecture.mdx b/apps/temp-docs/pages/architecture.mdx
similarity index 83%
rename from apps/temp-docs/docs/architecture.mdx
rename to apps/temp-docs/pages/architecture.mdx
index 706b3319a55..1fd097d8d61 100644
--- a/apps/temp-docs/docs/architecture.mdx
+++ b/apps/temp-docs/pages/architecture.mdx
@@ -1,7 +1,9 @@
----
-title: 'Architecture'
-description: 'Supabase Architecture'
----
+import Layout from '~/layouts/Guide'
+
+export const meta = {
+ title: 'Architecture',
+ description: 'Supabase Architecture',
+}
# Architecture
@@ -14,3 +16,5 @@ Supabase is not a 1-to-1 mapping of Firebase. While we are building many of the
Our technological choices are quite different to Firebase. Everything we use is open source. Wherever possible, we use and support existing tools in the ecosystem, rather than developing from scratch.
Most notably, we use Postgres rather than a NoSQL store. This was a deliberate choice. We believe that no other database on the market offers the scalability and functionality required to legitimately compete with Firebase.
+
+export default (context) => <Layout context={context} />
diff --git a/apps/temp-docs/docs/faqs.mdx b/apps/temp-docs/pages/faqs.mdx
similarity index 92%
rename from apps/temp-docs/docs/faqs.mdx
rename to apps/temp-docs/pages/faqs.mdx
index 3131951766b..fdbee082d5b 100644
--- a/apps/temp-docs/docs/faqs.mdx
+++ b/apps/temp-docs/pages/faqs.mdx
@@ -1,11 +1,14 @@
----
-title: 'FAQs'
-description: 'Supabase frequently asked questions'
----
+import Layout from '~/layouts/Guide'
+
+export const meta = {
+ title: 'FAQs',
+ description: 'Supabase frequently asked questions',
+}
# FAQs
### Have you built `[Firebase feature]` yet?
+
We're building as fast as we can! And we are even adding a few things that Firebase doesn't have, as we go. Here are the features we have built:
- A dashboard/UI for spinning up and managing your database in less than one minute.
@@ -19,10 +22,15 @@ We're building as fast as we can! And we are even adding a few things that Fireb
We started Supabase because we love the functionality of Firebase, but we personally experienced the scaling issues that many others experienced. We chose Postgres because it's well-trusted and it has phenomenal scalability. Our goal is to make Postgres as easy to use as Firebase, so that you no longer have to choose between usability and scalability. Also, we're sure that once you start using Postgres, you'll love it more than any other database.
### How do I host Supabase?
+
Supabase is an amalgamation of five open source tools (and growing). Some of these tools are made by Supabase (like our [Realtime Server](https://github.com/supabase/realtime)), some we support indirectly (like [PostgREST](http://postgrest.org/en/v7.0.0/)), and some are third-party tools (like [Kong](https://github.com/Kong/kong)). All of the tools we use in Supabase are MIT, Apache 2.0, or PostgreSQL licensed. You can use the docker-compose script [here](https://github.com/supabase/supabase/tree/master/docker) to build Supabase on your own environment, and find detailed instructions [here](https://supabase.com/docs/guides/hosting/overview).
### Do you support `[some other database]`?
+
At the moment, we only support PostgreSQL. It's unlikely we'll ever move away from Postgres; however, you can [vote on a new database](https://github.com/supabase/supabase/issues/6) if you want us to start development.
### Do you have a library for `[some other language]`?
+
We currently have a JavaScript library. You can [vote on a new client library](https://github.com/supabase/supabase/issues/5) for your favorite language.
+
+export default (context) => <Layout context={context} />
diff --git a/apps/temp-docs/pages/going-into-prod.mdx b/apps/temp-docs/pages/going-into-prod.mdx
new file mode 100644
index 00000000000..410767ff74e
--- /dev/null
+++ b/apps/temp-docs/pages/going-into-prod.mdx
@@ -0,0 +1,57 @@
+import Layout from '~/layouts/Guide'
+
+export const meta = {
+ id: 'going-into-prod',
+ title: 'Going into Prod Checklist',
+ description: 'Things to do before making your app publicly available',
+}
+
+# Going into Prod Checklist
+
+After developing your project, and deciding it's time to Go Live With Real Users, you should run through this checklist to ensure that your project is:
+
+- secure
+- won't falter under the expected load
+- remains available whilst in production
+
+## Security
+
+- Ensure RLS is enabled
+ - Tables that do not have RLS enabled with reasonable policies allow any client to access and modify their data. This is unlikely to be what you want in the majority of cases.
+ - [Learn more about RLS](/docs/guides/auth/row-level-security)
+- Ensure replication is disabled for tables containing sensitive data:
+ - Today, Realtime does not respect RLS policies and any client with your anon key can listen to changes on tables where replication is enabled.
+ - Go to the Database > Replication page in the Supabase Dashboard to manage these settings
+ - We are launching [RLS for realtime](https://github.com/supabase/walrus) soon, but in the meantime you should only use it for tables containing public data (scoreboards, blog posts, etc.)
+- Enable 2FA on Github
+ - Since your Github account gives you administrative rights to your Supabase project, you should protect it with a strong password and 2FA using a U2F key or a TOTP app.
+- Ensure email confirmations are enabled in the Auth > Settings page
+- Use a custom SMTP server for auth emails so that your users can see that the mails are coming from a trusted domain (preferably the same domain that your app is hosted on). (grab SMTP credentials from any major email provider such as SendGrid, AWS SES, etc.)
+- Think hard about how _you_ would abuse your service as an attacker, and mitigate
+- Review these [common cybersecurity threats](https://auth0.com/docs/security/prevent-threats)
+
+## Performance
+
+- Ensure that you have suitable indices to cater to your common query patterns
+ - [learn more about indexes in postgres](https://www.enterprisedb.com/postgres-tutorials/overview-postgresql-indexes)
+ - pg_stat_statements can help you [identify hot or slow queries](https://www.virtual-dba.com/blog/postgresql-performance-identifying-hot-and-slow-queries/)
+- Perform load testing (preferably on a staging env)
+ - tools like [k6](https://k6.io/) can simulate traffic from many different users
+- If you find you require more resources, contact [email protected] to upgrade to PAYG for bigger servers
+
+## Availability
+
+- Use your own SMTP credentials so that you have full control over the deliverability of your transactional auth emails (see Auth > Settings)
+ - you can grab SMTP credentials from any major email provider such as SendGrid, AWS SES, etc.
+ - the default rate limit for auth emails provided by Supabase is 30 new users per hour, if doing a major public announcement you will likely require more than this
+- If your application is on the free tier and is **not** expected to be queried at least once every 7 days, then it may be paused by Supabase to save on server resources
+ - you can restore paused projects from the Supabase dashboard
+ - upgrade to Pro to guarantee that your project will not be paused for inactivity
+- Database backups are not available for download on the free tier
+ - You can set up your own backup systems using tools like [pg_dump](https://www.postgresqltutorial.com/postgresql-backup-database/) or [wal-g](https://github.com/wal-g/wal-g)
+ - Nightly backups for Pro tier projects are available on the Supabase dashboard for up to 7 days
+- upgrading to the Supabase Pro Tier will give you access to email support on [email protected]
+
+This checklist is always growing so be sure to check back frequently, and also feel free to suggest additions and amendments by making a PR on [Github](https://github.com/supabase/supabase).
+
+export default (context) => <Layout context={context} />
diff --git a/apps/temp-docs/docs/guides.mdx b/apps/temp-docs/pages/guides.mdx
similarity index 100%
rename from apps/temp-docs/docs/guides.mdx
rename to apps/temp-docs/pages/guides.mdx
diff --git a/apps/temp-docs/docs/introduction.mdx b/apps/temp-docs/pages/index.mdx
similarity index 88%
rename from apps/temp-docs/docs/introduction.mdx
rename to apps/temp-docs/pages/index.mdx
index 06c54452886..e1fe284ddac 100644
--- a/apps/temp-docs/docs/introduction.mdx
+++ b/apps/temp-docs/pages/index.mdx
@@ -1,7 +1,9 @@
----
-title: Introduction
-description: Introduction to Supabase
----
+import Layout from '~/layouts/Guide'
+
+export const meta = {
+ title: 'Introduction',
+ description: 'Introduction to Supabase',
+}
# Introduction
@@ -43,3 +45,5 @@ The documentation is divided into 3 sections.
<LinkCard title="Overview" description="A summary of the tools and how to get started" />
<LinkCard title="Overview" description="A summary of the tools and how to get started" />
</LinkCardsWrapper>
+
+export default (context) => <Layout meta={meta} children={context.children} context={context} />
diff --git a/apps/temp-docs/pages/index.tsx b/apps/temp-docs/pages/index.tsx
deleted file mode 100644
index eda7a78654a..00000000000
--- a/apps/temp-docs/pages/index.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { MDXProvider } from '@mdx-js/react'
-import { MDXRemote } from 'next-mdx-remote'
-import { serialize } from 'next-mdx-remote/serialize'
-import components from '~/components'
-import menuItems from '~/components/nav/menu-items.json'
-import Layout from '~/layouts/DocsLayout'
-import { getDocsBySlug } from '../lib/docs'
-
-export default function Home({
- meta,
- content,
-}: {
- meta: { title: string; description: string }
- content: any
-}) {
- return (
- <Layout meta={meta} menuItems={menuItems['Docs']} currentPage="Docs">
- <MDXProvider components={components}>
- <MDXRemote {...content} />
- </MDXProvider>
- </Layout>
- )
-}
-
-export async function getStaticProps() {
- const doc = getDocsBySlug('docs/introduction')
-
- const content = await serialize(doc.content || '')
-
- return {
- props: {
- ...doc,
- content,
- },
- }
-}