Skip to content

Commit

Permalink
Update links
Browse files Browse the repository at this point in the history
  • Loading branch information
dannykng committed Jan 12, 2023
1 parent 9664242 commit b41031c
Show file tree
Hide file tree
Showing 44 changed files with 104 additions and 110 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
- [x] Hosted Postgres Database. [Docs](https://supabase.com/docs/guides/database)
- [x] Authentication and Authorization. [Docs](https://supabase.com/docs/guides/auth)
- [x] Auto-generated APIs.
- [x] REST. [Docs](https://supabase.com/docs/guides/api#rest-api)
- [x] Realtime subscriptions. [Docs](https://supabase.com/docs/guides/api#realtime-api)
- [x] GraphQL (Beta). [Docs](https://supabase.com/docs/guides/api#graphql-api)
- [x] REST. [Docs](https://supabase.com/docs/guides/database/api#rest-api)
- [x] Realtime subscriptions. [Docs](https://supabase.com/docs/guides/database/api#realtime-api)
- [x] GraphQL (Beta). [Docs](https://supabase.com/docs/guides/database/api#graphql-api)
- [x] Functions.
- [x] Database Functions. [Docs](https://supabase.com/docs/guides/database/functions)
- [x] Edge Functions [Docs](https://supabase.com/docs/guides/functions)
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/MDX/quickstart_intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ This example provides the steps to build a basic user management app. It include
- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).
- Supabase [Storage](/docs/guides/storage): users can upload a photo.
- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.
- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.
- Instant [APIs](/docs/guides/database/api): APIs will be automatically generated when you create your database tables.

By the end of this guide you'll have an app which allows users to login and update some basic profile details:
4 changes: 2 additions & 2 deletions apps/docs/components/Navigation/Navigation.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ export const menuItems: NavMenu = {
name: 'Serverless APIs',
url: undefined,
items: [
{ name: 'Overview', url: '/guides/api', items: [] },
{ name: 'Generating Types', url: '/guides/api/generating-types', items: [] },
{ name: 'Overview', url: '/guides/database/api', items: [] },
{ name: 'Generating Types', url: '/guides/database/api/generating-types', items: [] },
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ export const database = {
name: 'Serverless APIs',
url: undefined,
items: [
{ name: 'Overview', url: '/guides/api', items: [] },
{ name: 'Generating Types', url: '/guides/api/generating-types', items: [] },
{ name: 'Overview', url: '/guides/database/api', items: [] },
{ name: 'Generating Types', url: '/guides/database/api/generating-types', items: [] },
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript [through third-party tools](/docs/guides/api/generating-types).
Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript [through third-party tools](/docs/guides/database/api/generating-types).

## Usage with TypeScript

Expand Down
8 changes: 4 additions & 4 deletions apps/docs/pages/guides/database/connecting-to-postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ You can use these simple questions to determine which connection method to use:

## API

Supabase provides an auto-updating [API](/docs/guides/api). This is the easiest way to get started if you are managing data (fetching, inserting, updating).
Supabase provides an auto-updating [API](/docs/guides/database/api). This is the easiest way to get started if you are managing data (fetching, inserting, updating).

### Interfaces

We provides several types of API to suit your preferences and use-case:

- [REST](/docs/guides/api#rest-api): interact with your database through a REST interface.
- [GraphQL](/docs/guides/api#graphql-api): interact with your database through a GraphQL interface.
- [Realtime](/docs/guides/api#realtime-api): listen to database changes over websockets.
- [REST](/docs/guides/database/api#rest-api): interact with your database through a REST interface.
- [GraphQL](/docs/guides/database/api#graphql-api): interact with your database through a GraphQL interface.
- [Realtime](/docs/guides/database/api#realtime-api): listen to database changes over websockets.

You cannot manage the database schema via the API (for security reasons). To do that you can use the dashboard or connect directly to your database.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/pages/guides/database/tables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ create table movies (

## Loading data

There are several ways to load data in Supabase. You can load data directly into the database or using the [APIs](../../guides/api).
There are several ways to load data in Supabase. You can load data directly into the database or using the [APIs](../../guides/database/api).
Use the "Bulk Loading" instructions if you are loading large data sets.

### Basic data loading
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/pages/guides/functions/best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const meta = {
## Database Functions vs Edge Functions

For data-intensive operations we recommend using [Database Functions](/docs/guides/database/functions), which are executed within your database
and can be called remotely using the [REST and GraphQL API](/docs/guides/api).
and can be called remotely using the [REST and GraphQL API](/docs/guides/database/api).

For use-cases which require low-latency we recommend [Edge Functions](/docs/guides/functions), which are globally-distributed and can be written in TypeScript.

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/pages/guides/getting-started/features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Build login and registration pages with custom themes. [Docs](/docs/guides/auth/

### Auto-generated REST API

RESTful APIs are autogenerated from your database, without a single line of code. [Docs](/docs/guides/api#rest-api-overview).
RESTful APIs are autogenerated from your database, without a single line of code. [Docs](/docs/guides/database/api#rest-api-overview).

### Auto-generated GraphQL API

Fast GraphQL APIs using our custom Postgres GraphQL extension. [Docs](/docs/guides/api#graphql-api-overview).
Fast GraphQL APIs using our custom Postgres GraphQL extension. [Docs](/docs/guides/database/api#graphql-api-overview).

### Realtime Database changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This example provides the steps to build a simple user management app (from scra
- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data.
- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email).
- Supabase [Storage](/docs/guides/storage): users can upload a photo.
- Instant [APIs](/docs/guides/api): APIs will be automatically generated when you create your database tables.
- Instant [APIs](/docs/guides/database/api): APIs will be automatically generated when you create your database tables.
- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data.

By the end of this guide you'll have an app which allows users to login and update some basic profile details:
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/pages/guides/integrations/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ The Supabase Marketplace brings together all the tools you need to extend your S
Supabase provides several integration points:

- The [Postgres connection](/docs/guides/database/connecting-to-postgres). Anything that works with Postgres also works with Supabase projects.
- The [Project REST API](/docs/guides/api#rest-api) & client libraries.
- The [Project GraphQL API](/docs/guides/api#graphql-api).
- The [Project REST API](/docs/guides/database/api#rest-api) & client libraries.
- The [Project GraphQL API](/docs/guides/database/api#graphql-api).
- The [Platform API](/docs/reference/api).

## List your integration
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/pages/guides/platform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Visit [app.supabase.com](https://app.supabase.com) and sign in to start creating
Each project on Supabase comes with:

- A dedicated [Postgres database](/docs/guides/database)
- [Auto-generated APIs](/docs/guides/api)
- [Auto-generated APIs](/docs/guides/database/api)
- [Auth and user management](/docs/guides/auth)
- [Edge Functions](/docs/guides/functions)
- [Realtime API](/docs/guides/realtime)
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/pages/guides/platform/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Supabase provides a logging interface specific to each product. You can use simp
>
<TabPanel id="api" label="API">

[API logs](https://app.supabase.com/project/_/database/api-logs) show all network requests and response for the REST and GraphQL [APIs](../../guides/api).
[API logs](https://app.supabase.com/project/_/database/api-logs) show all network requests and response for the REST and GraphQL [APIs](../../guides/database/api).

![API Logs](/docs/img/guides/platform/logs/logs-api.png)

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</url>

<url>
<loc>https://supabase.com/docs/guides/api</loc>
<loc>https://supabase.com/docs/guides/database/api</loc>
<changefreq>weekly</changefreq>
<changefreq>0.5</changefreq>
</url>
Expand Down Expand Up @@ -127,7 +127,7 @@
</url>

<url>
<loc>https://supabase.com/docs/guides/api/generating-types</loc>
<loc>https://supabase.com/docs/guides/database/api/generating-types</loc>
<changefreq>weekly</changefreq>
<changefreq>0.5</changefreq>
</url>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/_alternatives/supabase-vs-firebase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Supabase is an open source firebase alternative, but instead of being built arou

At Supabase we’ve always been huge fans of Firebase - so we started adding a few things on top of PostgreSQL in an attempt to reach feature parity, including:

- Auto-generated API - [query your data straight from the client](https://supabase.com/docs/guides/api#rest-api-2).
- Auto-generated API - [query your data straight from the client](https://supabase.com/docs/guides/database/api#rest-api-2).
- Realtime - [changes in your data will be streamed directly to your application](https://supabase.com/docs/reference/dart/subscribe).
- Auth - [a simple to integrate auth system and SQL based rules engine](https://supabase.com/auth).
- Functions - [javascript and typescript functions that deploy out globally](https://supabase.com/edge-functions).
Expand Down
5 changes: 2 additions & 3 deletions apps/www/_alternatives/supabase-vs-heroku-postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ toc_depth: 3

Heroku is a cloud application platform that offers managed PostgreSQL as a service. They offer 5 levels of Postgres support from the Hobby Tier up to the Shield Tier, each with different levels of features and pricing. Heroku announced that starting November 28, 2022, they will [stop offering free product plans and will shut down free dynos and data services](https://blog.heroku.com/next-chapter). Since the announcement, developers started migrating their projects to Supabase.


## What is Supabase?

Supabase also offers managed Postgres, the main difference is that with each deployment you also get:

- Auto-generated API - [never write an API again](https://supabase.com/docs/guides/api#rest-api-2)
- Auto-generated API - [never write an API again](https://supabase.com/docs/guides/database/api#rest-api-2)
- Realtime - [subscribe to data changes via websockets](https://supabase.com/docs/reference/dart/subscribe)
- Auth - [users can log in and out of your application](https://supabase.com/auth)
- Functions - [deploy custom logic to the edge](https://supabase.com/edge-functions)
Expand All @@ -44,7 +43,7 @@ These are some of the key differences between Heroku Postgres and Supabase in te

- Supabase is more than just the raw database, it also comes with:
- [Connection pooling](https://supabase.com/docs/guides/database/connecting-to-postgres#connection-pool) so that you won’t run out of connections in a serverless environment.
- [Auto-generated APIs](https://supabase.com/docs/guides/api#rest-api-2) based on your schema, so you can communicate with your database directly from the client.
- [Auto-generated APIs](https://supabase.com/docs/guides/database/api#rest-api-2) based on your schema, so you can communicate with your database directly from the client.
- [Realtime API](https://supabase.com/docs/reference/dart/subscribe) is useful for when you want to subscribe to changes to your database over websockets.
- [Auth API](https://supabase.com/auth) can be used to leverage Postgres’s Row Level Security model, and control access to sensitive data on a per user, or per group level.
- [Functions](https://supabase.com/edge-functions) can be deployed out to the edge directly from the Supabase CLI, which means you can run sensitive business logic or transformations in a serverless fashion.
Expand Down
2 changes: 1 addition & 1 deletion apps/www/_blog/2021-10-28-supabase-series-a.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ User-facing applications usually require tools beyond just a database and fronte
- **File Storage:** for large images and media.

Supabase makes all of this easy. Beyond the database we offer [Auth](/docs/guides/auth),
RESTful and Realtime [APIs](/docs/guides/api), a [Storage](/docs/guides/storage)
RESTful and Realtime [APIs](/docs/guides/database/api), a [Storage](/docs/guides/storage)
system for large files, and a bunch of other tools - all wrapped up into a simple-to-use Dashboard.

![Supabase Dashboard](/images/blog/series-a/dashboard.png)
Expand Down
2 changes: 1 addition & 1 deletion apps/www/_blog/2021-11-05-supabase-beta-october-2021.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Learn about all the exciting features of Auth within Supabase. [Docs](https://su

### API Features

Learn more about the power of PostgREST for RESTful APIs. [Docs](https://supabase.com/docs/guides/api#restful-api).
Learn more about the power of PostgREST for RESTful APIs. [Docs](https://supabase.com/docs/guides/database/api#restful-api).

<iframe
className="video-with-border w-full"
Expand Down
47 changes: 20 additions & 27 deletions apps/www/_blog/2021-12-03-pg-graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,25 @@ Today we're open sourcing [`pg_graphql`](https://github.com/supabase/pg_graphql)

Interested? You're [3 commands away](https://supabase.github.io/pg_graphql/quickstart/) from a live [GraphiQL](https://graphql-dotnet.github.io/docs/getting-started/graphiql/) demo.


## Motivation

The Supabase stack is centered around PostgreSQL as the single source of truth. All data, configuration, and security are housed in the database so any GraphQL solution needed to be equivalently SQL-centric.

With that in mind, we took a look at the landscape and considered two excellent technologies, [Graphile](https://www.graphile.org/postgraphile/), and [Hasura](https://hasura.io/).

| Requirements | Graphile | Hasura |
|--------------------------|----------|--------|
| Open Source | | |
| Reflected GraphQL Schema | | |
| Reflected Resolvers | | |
| Always up-to-date | | |
| Performant | | |
| ------------------------ | -------- | ------ |
| Open Source |||
| Reflected GraphQL Schema |||
| Reflected Resolvers |||
| Always up-to-date |||
| Performant |||

We found both options to be largely viable for the core feature set.
We found both options to be largely viable for the core feature set.

Which left us with one final hang-up: we host free-tier projects on VMs with 1 GB of memory. After tallying the resources reserved for PostgreSQL, PostgREST, Kong, GoTrue, and a handful of smaller services, we were left with a total memory budget of ... 0 MB 😬. Unsurprisingly, our pathological memory target disqualified any option that required launching another process in those VMs.

For that reason, we decided to invest in a lightweight alternative that runs in the database, and can be exposed over HTTP using the existing [PostgREST](https://supabase.com/docs/guides/api) deployments' [RPC functionality.](https://postgrest.org/en/v8.0/api.html#stored-procedures)
For that reason, we decided to invest in a lightweight alternative that runs in the database, and can be exposed over HTTP using the existing [PostgREST](https://supabase.com/docs/guides/database/api) deployments' [RPC functionality.](https://postgrest.org/en/v8.0/api.html#stored-procedures)

By our most conservative estimate, that reduces the platform's memory requirements by 525 TB/hours every month, saving 💰 and 🌳.

Expand Down Expand Up @@ -103,12 +102,7 @@ type PageInfo {

type Query {
account(nodeId: ID!): Account
allAccounts(
after: Cursor,
before: Cursor,
first: Int,
last: Int
): AccountConnection
allAccounts(after: Cursor, before: Cursor, first: Int, last: Int): AccountConnection
}

type Account {
Expand Down Expand Up @@ -176,17 +170,17 @@ We're opting to expose the function over HTTP through PostgREST but you could al
When it comes to APIs, performance counts. Here are some figures from [Apache Bench](https://www.tutorialspoint.com/apache_bench/apache_bench_quick_guide.htm) showing 2,205 requests/second on a 4 core machine with 16 GB of memory.

```markdown hideCopy
Concurrency Level: 8
Time taken for tests: 3.628 seconds
Complete requests: 8000
Failed requests: 0
Total transferred: 1768000 bytes
Total body sent: 1928000
HTML transferred: 368000 bytes
Requests per second: 2205.21 [#/sec] (mean)
Time per request: 3.628 [ms] (mean)
Time per request: 0.453 [ms] (mean, across all concurrent requests)
Transfer rate: 475.93 [Kbytes/sec] received
Concurrency Level: 8
Time taken for tests: 3.628 seconds
Complete requests: 8000
Failed requests: 0
Total transferred: 1768000 bytes
Total body sent: 1928000
HTML transferred: 368000 bytes
Requests per second: 2205.21 [#/sec] (mean)
Time per request: 3.628 [ms] (mean)
Time per request: 0.453 [ms] (mean, across all concurrent requests)
Transfer rate: 475.93 [Kbytes/sec] received
```

Full steps to reproduce this output are available in [the docs](https://supabase.github.io/pg_graphql).
Expand All @@ -195,5 +189,4 @@ Full steps to reproduce this output are available in [the docs](https://supabase

`pg_graphql` is [open source software](https://github.com/supabase/pg_graphql/). As always, Issues and PRs are welcome.


[Try `pg_graphql`](https://supabase.github.io/pg_graphql/quickstart/) today to see a live [GraphiQL](https://graphql-dotnet.github.io/docs/getting-started/graphiql/) demo.
2 changes: 1 addition & 1 deletion apps/www/_blog/2022-03-30-supabase-enterprise.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Or how many gigabytes of video a user streamed from [Supabase Storage](/storage)

Querying huge datasets can be time-consuming, especially when you are aggregating billions of rows of historical logs. Supabase will make this simple with auto-updating views,
saved to disk for increased performance. These views update periodically at a cadence that you decide. You'll even be able to fetch these views with your
[Supabase API](/docs/guides/api)!
[Supabase API](/docs/guides/database/api)!

## Next steps

Expand Down
2 changes: 1 addition & 1 deletion apps/www/_blog/2022-03-31-supabase-edge-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The primary goal of this architecture is to reduce the amount of work done in th

Supabase Edge Functions are deployed to one region - Earth (and we're exploring Mars as an additional region 👽). Edge Functions are deployed to over 30 data centers in a matter of seconds, ensuring fast response times no matter where your users are located.

[Database Functions](https://supabase.com/docs/guides/database/functions) (also served via our [REST and GraphQL APIs](https://supabase.com/docs/guides/api)) are colocated with your Postgres database, making them ideal for DB-intensive operations. These APIs can also be called seamlessly from your Supabase Edge Functions, making for a powerful combination.
[Database Functions](https://supabase.com/docs/guides/database/functions) (also served via our [REST and GraphQL APIs](https://supabase.com/docs/guides/database/api)) are colocated with your Postgres database, making them ideal for DB-intensive operations. These APIs can also be called seamlessly from your Supabase Edge Functions, making for a powerful combination.

### Scale to zero

Expand Down
Loading

0 comments on commit b41031c

Please sign in to comment.