From 20a120cccbbcac8cb7666d35399062cf9ab30694 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 11:36:48 -0800 Subject: [PATCH 01/12] Update Self-Hosting Auth intro --- .../ref/self-hosting-auth/introduction.mdx | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/apps/docs/docs/ref/self-hosting-auth/introduction.mdx b/apps/docs/docs/ref/self-hosting-auth/introduction.mdx index 3e1af1ff9dd..81d29a8b95f 100644 --- a/apps/docs/docs/ref/self-hosting-auth/introduction.mdx +++ b/apps/docs/docs/ref/self-hosting-auth/introduction.mdx @@ -7,14 +7,31 @@ hideTitle: true
-

Javascript Client Library

-

@supabase/supabase-js

+

Self-Hosting Auth

-
- This reference documents every object and method available in Supabase's isomorphic JavaScript - library, supabase-js. You can use supabase-js to interact with your Postgres database, listen to - database changes, invoke Deno Edge Functions, build login and user management functionality, and - manage large files. -
+ + + + The Supabase Auth Server (GoTrue) is a JSON Web Token (JWT)-based API for managing users and issuing access tokens. + + GoTrue is an open-source API written in Golang, that acts as a self-standing API service for handling user registration and authentication for JAM projects. It's based on OAuth2 and JWT and handles user signup, authentication, and custom user data. + + + + + + ### Client libraries + - [JavaScript](https://github.com/supabase/gotrue-js) + - [Dart](https://github.com/supabase/gotrue-dart) + + ### Additional links + + - [Source code](https://github.com/supabase/gotrue) + - [Known bugs and issues](https://github.com/supabase/gotrue/issues) + - [Auth guides](/docs/guides/auth) + + + + From 83feb9826462882e52d507b0f1c461f7e394f34c Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 11:48:41 -0800 Subject: [PATCH 02/12] Update Self-Hosting Storage intro --- .../ref/self-hosting-storage/introduction.mdx | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/apps/docs/docs/ref/self-hosting-storage/introduction.mdx b/apps/docs/docs/ref/self-hosting-storage/introduction.mdx index 3e1af1ff9dd..e9b42b31357 100644 --- a/apps/docs/docs/ref/self-hosting-storage/introduction.mdx +++ b/apps/docs/docs/ref/self-hosting-storage/introduction.mdx @@ -5,16 +5,39 @@ hideTitle: true ---
- +
-

Javascript Client Library

-

@supabase/supabase-js

+

Self-Hosting Storage

-
- This reference documents every object and method available in Supabase's isomorphic JavaScript - library, supabase-js. You can use supabase-js to interact with your Postgres database, listen to - database changes, invoke Deno Edge Functions, build login and user management functionality, and - manage large files. -
+ + + + An S3 compatible object storage service that integrates with Postgres. + + - Uses Postgres as it's datastore for storing metadata + - Authorization rules are written as Postgres Row Level Security policies + - Integrates with S3 as the storage backend (with more in the pipeline!) + - Extremely lightweight and performant + + + + + + ### Client libraries + + - [JavaScript](https://github.com/supabase/storage-js) + - [Dart](https://github.com/supabase/storage-dart) + + ### Additional links + + - [Source code](https://github.com/supabase/storage-api) + - [Known bugs and issues](https://github.com/supabase/storage-js/issues) + - [Storage guides](/docs/guides/storage) + - [OpenAPI docs](https://supabase.github.io/storage-api/) + - [Why we built a new object storage service](https://supabase.com/blog/supabase-storage) + + + + From fe378e39b0321311c5020952f329de04fcaacf5b Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 11:48:50 -0800 Subject: [PATCH 03/12] Update auth icon --- apps/docs/docs/ref/self-hosting-auth/introduction.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/docs/docs/ref/self-hosting-auth/introduction.mdx b/apps/docs/docs/ref/self-hosting-auth/introduction.mdx index 81d29a8b95f..695d743a3d0 100644 --- a/apps/docs/docs/ref/self-hosting-auth/introduction.mdx +++ b/apps/docs/docs/ref/self-hosting-auth/introduction.mdx @@ -5,7 +5,7 @@ hideTitle: true ---
- +

Self-Hosting Auth

@@ -23,6 +23,7 @@ hideTitle: true ### Client libraries + - [JavaScript](https://github.com/supabase/gotrue-js) - [Dart](https://github.com/supabase/gotrue-dart) From abaaf737f9b14bd0007b00f97232eb786e4800b4 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:01:51 -0800 Subject: [PATCH 04/12] Update Self-Hosting Realtime intro --- .../self-hosting-realtime/introduction.mdx | 71 ++++++++++++++++--- 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx b/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx index 3e1af1ff9dd..12850e03d7a 100644 --- a/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx +++ b/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx @@ -5,16 +5,69 @@ hideTitle: true ---
- +
-

Javascript Client Library

-

@supabase/supabase-js

+

Self-Hosting Realtime

-
- This reference documents every object and method available in Supabase's isomorphic JavaScript - library, supabase-js. You can use supabase-js to interact with your Postgres database, listen to - database changes, invoke Deno Edge Functions, build login and user management functionality, and - manage large files. -
+ + + + Supabase Realtime is a server built with Elixir using the [Phoenix Framework](https://www.phoenixframework.org) that allows you to listen to changes in your PostgreSQL database via logical replication and then broadcast those changes via WebSockets. + + There are two versions of this server: `Realtime` and `Realtime RLS`. + + `Realtime` server works by: + + 1. listening to PostgreSQL's replication functionality (using PostgreSQL's logical decoding) + 2. converting the byte stream into JSON + 3. broadcasting to all connected clients over WebSockets + + `Realtime RLS` server works by: + + 1. polling PostgreSQL's replication functionality (using PostgreSQL's logical decoding and [wal2json](https://github.com/eulerto/wal2json) output plugin) + 2. passing database changes to a [Write Ahead Log Realtime Unified Security (WALRUS)](https://github.com/supabase/walrus) PostgresSQL function and receiving a list of authorized subscribers depending on Row Level Security (RLS) policies + 3. converting the changes into JSON + 4. broadcasting to authorized subscribers over WebSockets + + ## Why not just use PostgreSQL's `NOTIFY`? + + A few reasons: + + 1. You don't have to set up triggers on every table. + 2. `NOTIFY` has a payload limit of 8000 bytes and will fail for anything larger. The usual solution is to send an ID and then fetch the record, but that's heavy on the database. + 3. `Realtime` server consumes two connections to the database, then you can connect many clients to this server. Easier on your database, and to scale up you just add additional `Realtime` servers. + + ## Benefits + + 1. The beauty of listening to the replication functionality is that you can make changes to your database from anywhere - your API, directly in the DB, via a console, etc. - and you will still receive the changes via WebSockets. + 2. Decoupling. For example, if you want to send a new slack message every time someone makes a new purchase you might build that functionality directly into your API. This allows you to decouple your async functionality from your API. + 3. This is built with Phoenix, an [extremely scalable Elixir framework](https://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections). + + ## Does this server guarantee delivery of every data change? + + Not yet! Due to the following limitations: + + 1. Postgres database runs out of disk space due to Write-Ahead Logging (WAL) buildup, which can crash the database and prevent Realtime server from receiving and broadcasting changes. This can be mitigated in the Realtime RLS version of this server by setting the Postgres config `max_slot_wal_keep_size` to a reasonable size. + 2. Realtime server can crash due to a larger replication lag than available memory, forcing the creation of a new replication slot and resetting replication to read from the latest WAL data. + 3. When Realtime server falls too far behind for any reason, for example disconnecting from database as WAL continues to build up, then database can delete WAL segments the server still needs to read from, for example after reconnecting. + + + + + + ### Client libraries + + - [JavaScript](https://github.com/supabase/realtime-js) + - [Dart](https://github.com/supabase/realtime-dart) + + ### Additional links + + - [Source code](https://github.com/supabase/realtime) + - [Known bugs and issues](https://github.com/supabase/realtime/issues) + - [Realtime guides](/docs/guides/realtime) + + + + From 4e88b148974b023f920c6944484f823ab5b95814 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:11:53 -0800 Subject: [PATCH 05/12] Fix icons --- apps/docs/docs/ref/self-hosting-auth/introduction.mdx | 4 ++-- apps/docs/docs/ref/self-hosting-realtime/introduction.mdx | 2 +- apps/docs/docs/ref/self-hosting-storage/introduction.mdx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/docs/docs/ref/self-hosting-auth/introduction.mdx b/apps/docs/docs/ref/self-hosting-auth/introduction.mdx index 695d743a3d0..d33aee3de4f 100644 --- a/apps/docs/docs/ref/self-hosting-auth/introduction.mdx +++ b/apps/docs/docs/ref/self-hosting-auth/introduction.mdx @@ -5,7 +5,7 @@ hideTitle: true ---
- +

Self-Hosting Auth

@@ -23,7 +23,7 @@ hideTitle: true ### Client libraries - + - [JavaScript](https://github.com/supabase/gotrue-js) - [Dart](https://github.com/supabase/gotrue-dart) diff --git a/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx b/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx index 12850e03d7a..63b256044c2 100644 --- a/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx +++ b/apps/docs/docs/ref/self-hosting-realtime/introduction.mdx @@ -5,7 +5,7 @@ hideTitle: true ---
- +

Self-Hosting Realtime

diff --git a/apps/docs/docs/ref/self-hosting-storage/introduction.mdx b/apps/docs/docs/ref/self-hosting-storage/introduction.mdx index e9b42b31357..40fd27d4ce8 100644 --- a/apps/docs/docs/ref/self-hosting-storage/introduction.mdx +++ b/apps/docs/docs/ref/self-hosting-storage/introduction.mdx @@ -5,7 +5,7 @@ hideTitle: true ---
- +

Self-Hosting Storage

From 150b413e7f4413ae90d29423f7a369b45691b32d Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:25:01 -0800 Subject: [PATCH 06/12] Update links --- .../NavigationMenu/NavigationMenu.constants.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 5ea6c6b7aef..18826608e1e 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -750,22 +750,22 @@ export const reference_api = { export const reference_self_hosting_auth = { icon: 'reference-auth', - title: 'Self Hosting Auth', + title: 'Self-Hosting Auth', url: '/guides/reference/self-hosting/auth', parent: '/reference', } export const reference_self_hosting_storage = { icon: 'reference-storage', - title: 'Self Hosting Storage', - url: '/guides/reference/self-hosting/auth', + title: 'Self-Hosting Storage', + url: '/guides/reference/self-hosting/storage', parent: '/reference', } export const reference_self_hosting_realtime = { icon: 'reference-auth', - title: 'Self Hosting Realtime', - url: '/guides/reference/self-hosting/auth', + title: 'Self-Hosting Realtime', + url: '/guides/reference/self-hosting/realtime', parent: '/reference', } From ff53e3d83f95675e362ff4c0b4f7fee507db870b Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:25:14 -0800 Subject: [PATCH 07/12] Update Management API intro --- apps/docs/docs/ref/api/introduction.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/docs/docs/ref/api/introduction.mdx b/apps/docs/docs/ref/api/introduction.mdx index 47dbbcf3cd4..d4abb4ceae8 100644 --- a/apps/docs/docs/ref/api/introduction.mdx +++ b/apps/docs/docs/ref/api/introduction.mdx @@ -14,6 +14,8 @@ hideTitle: true + Manage your Supabase organizations and projects programmatically. + ## Status The Management API is in `beta`. It is usable in it's current state, but it's likely that there will be breaking changes. From 83ceb60d620ef8ebcb7514b352dac938e3a4fb50 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:30:22 -0800 Subject: [PATCH 08/12] Update CLI intro --- apps/docs/docs/ref/cli/introduction.mdx | 36 ++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/apps/docs/docs/ref/cli/introduction.mdx b/apps/docs/docs/ref/cli/introduction.mdx index bb12eea9481..e204038abae 100644 --- a/apps/docs/docs/ref/cli/introduction.mdx +++ b/apps/docs/docs/ref/cli/introduction.mdx @@ -11,9 +11,33 @@ hideTitle: true
-
- This reference documents every object and method available in Supabase's isomorphic JavaScript - library, supabase-js. You can use supabase-js to interact with your Postgres database, listen to - database changes, invoke Deno Edge Functions, build login and user management functionality, and - manage large files. -
+ + + + The Supabase CLI provides tools to develop your project locally and deploy to the Supabase Platform. + The CLI is still under development, but it contains all the functionality for working with your Supabase projects and the Supabase Platform. + + - Run Supabase locally: [`supabase start`](/docs/reference/cli/usage#supabase-start) + - Manage database migrations: [`supabase migration`](/docs/reference/cli/usage#supabase-migration) + - CI/CD for releasing to production: [`supabase db push`](/docs/reference/cli/usage#supabase-db-push) + - Manage your Supabase projects: [`supabase projects`](/docs/reference/cli/usage#supabase-projects) + - Generate types directly from your database schema: [`supabase gen types`](/docs/reference/cli/usage#supabase-gen) + - A [community-supported GitHub Action](https://github.com/lyqht/generate-supabase-db-types-github-action) to generate TypeScript types + - Shell autocomplete: [`supabase completion`](/docs/reference/cli/usage#supabase-completion) + - A [community-supported Fig autocomplete spec](https://fig.io/manual/supabase) for macOS terminal + + + + + + ### Additional links + + - [Install the Supabase CLI](/docs/guides/cli) + - [Source code](https://github.com/supabase/cli) + - [Known bugs and issues](https://github.com/supabase/cli/issues) + - [Supabase CLI v1 and Management API Beta](https://supabase.com/blog/supabase-cli-v1-and-admin-api-beta) + - [Video: Announcing CLI V1 and Management API Beta](https://www.youtube.com/watch?v=OpPOaJI_Z28) + + + + From 117d17f9061480449b03d74946a370f82b75a0a8 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:38:29 -0800 Subject: [PATCH 09/12] Update copy --- apps/docs/docs/ref/api/introduction.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/docs/ref/api/introduction.mdx b/apps/docs/docs/ref/api/introduction.mdx index d4abb4ceae8..68d27b6e1b8 100644 --- a/apps/docs/docs/ref/api/introduction.mdx +++ b/apps/docs/docs/ref/api/introduction.mdx @@ -46,7 +46,7 @@ hideTitle: true - [OpenAPI Docs](https://api.supabase.com/api/v1) - [OpenAPI Spec](https://api.supabase.com/api/v1-json) - - Reporting bugs and issues: [github.com/supabase/supabase](https://github.com/supabase/supabase) + - [Report bugs and issues](https://github.com/supabase/supabase)
From bd8fea2f2ce82a36b063a85efdebc98d681364e2 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:49:34 -0800 Subject: [PATCH 10/12] Update links in Resources nav --- .../NavigationMenu/NavigationMenu.constants.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 18826608e1e..ea44f952486 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -557,23 +557,23 @@ export const resources = { ], }, { - name: 'Self-Hosting reference docs', + name: 'Self-Hosting Feference', items: [ { - name: 'Auth server', - url: '/reference/self-hosting-auth', + name: 'Auth Server', + url: '/reference/self-hosting-auth/introduction', icon: '/docs/img/icons/menu/reference-auth', items: [], }, { - name: 'Storage server', - url: '/reference/self-hosting-storage', + name: 'Storage Server', + url: '/reference/self-hosting-storage/introduction', icon: '/docs/img/icons/menu/reference-storage', items: [], }, { - name: 'Realtime server', - url: '/reference/self-hosting-realtime', + name: 'Realtime Server', + url: '/reference/self-hosting-realtime/introduction', icon: '/docs/img/icons/menu/reference-realtime', items: [], }, From da589a0651badeb1527392ed0304b2917859f105 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 12:58:52 -0800 Subject: [PATCH 11/12] Fix typo --- .../Navigation/NavigationMenu/NavigationMenu.constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index ea44f952486..7f122ad48c9 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -557,7 +557,7 @@ export const resources = { ], }, { - name: 'Self-Hosting Feference', + name: 'Self-Hosting Reference', items: [ { name: 'Auth Server', From 6446ebd1609e8352ddb5919b9a78787e0ea5cf50 Mon Sep 17 00:00:00 2001 From: dannykng Date: Mon, 12 Dec 2022 13:00:31 -0800 Subject: [PATCH 12/12] Update Resources nav --- .../Navigation/NavigationMenu/NavigationMenu.constants.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 7f122ad48c9..76a6a0a33e3 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -501,7 +501,6 @@ export const resources = { url: '/guides/resources', items: [ { name: 'Examples', url: '/guides/resources/examples', items: [] }, - { name: 'Features', url: '/features', items: [] }, { name: 'Glossary', url: '/guides/resources/glossary', items: [] }, { name: 'Migrate to Supabase',