Skip to content

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

Merge branch 'master' into docs/readme-for-turborepo

Jonathan Summers-Muirbaac6888a661
diff --cc DEVELOPERS.md
index 7e2b13c1374,5a1476143f1..13012acb097
--- a/DEVELOPERS.md
+++ b/DEVELOPERS.md
@@@ -1,14 -1,15 +1,14 @@@
# Developing Supabase
-1. [Development setup](#development-setup)
- - [Install dependencies](#install-dependencies)
- - [Fork the repository](#fork-the-repository)
-1. [Build Supabase](#build-supabase)
- - [Choose a directory](#choose-a-directory)
-1. [Start a development server](#start-a-development-server)
- - [Supabase Website](#supabase-website)
- - [Supabase Docs](#supabase-docs)
- - [Supabase Studio](#supabase-studio)
-1. [Create a pull request](#create-a-pull-request)
+1. [Getting started](#getting-started)
- - [Install dependencies](#install-dependencies)
++ - [Install dependencies](#install-dependencies)
+2. [Local development](#local-development)
+ - [Fork the repository](#fork-the-repository)
+ - [Clone the repo](#clone-the-repo)
+ - [Running turborepo](#running-turborepo)
- - [Shared components](#shared-components)
- - [Installing packages](#installing-packages)
++ - [Shared components](#shared-components)
++ - [Installing packages](#installing-packages)
+3. [Create a pull request](#create-a-pull-request)
- [Common tasks](#common-tasks)
- [Add a redirect](#add-a-redirect)
@@@ -54,62 -52,104 +54,63 @@@ To contribute code to [Supabase](https:
cd supabase
```
-### Choose a directory
-
-Choose if you want to work on the [Supabase Website](https://supabase.com), [Supabase Docs](https://supabase.com/docs), or [Supabase Studio](https://app.supabase.com).
-
-1. Go to the [Supabase Website](https://supabase.com) directory
-
- ```sh
- cd apps/www
- ```
-
- Go to the [Supabase Docs](https://supabase.com/docs) directory
-
- ```sh
- cd apps/reference
- ```
-
- Go to the [Supabase Studio](https://app.supabase.com) directory
-
- ```sh
- cd studio
- ```
-
-1. Install npm/yarn dependencies:
-
- npm
+### Running turborepo
- ```sh
- npm install
- ```
+[Supabase](https://supabase.com) uses [Turborepo](https://turborepo.org/docs) to manage and run this monorepo.
- or with yarn
+1. Install the dependences in the root of the repo.
+
```sh
- yarn install
+ npm install # install dependencies
```
-## Start a development server
-
-To debug code and to see your changes in real time, it is often useful to have a local HTTP server. Click one of the three links below to choose which development server you want to start.
-
-- [Supabase Website](#supabase-website)
-- [Supabase Docs](#supabase-docs)
-- [Supabase Studio](#supabase-studio)
-
-### Supabase Website
-
-The website is moving to a new monorepo setup. See the [Monorepo](#monorepo) section below.
-
-### Supabase Docs
-
-1. Build development server
-
- npm
-
+2. You can then run the apps simultaneously with the following.
```sh
- npm run build
+ npm run dev # start all the applications
```
- or with yarn
+Then visit, and edit, any of the following sites:
- Site | Directory | Scope name | Description | Local development server
- ---- | --------- | ---------- | ----------- | ------------------------
- [supabase.com](https://supabase.com) | `/apps/www` | www | The main website | http://localhost:3000
- [app.supabase.com](https://app.supabase.com) | `/studio` | studio | Studio dashboard | http://localhost:8082
- [POC] Next.js based Docs site | `/apps/temp-docs` | temp-docs | Guides and Reference (Next.js based) | http://localhost:3001
- [POC] Community forum | `/apps/temp-community-forum` | forum | GitHub Discussions | http://localhost:3002
- [POC] DEV articles site | `/apps/temp-community-tutorials` | tutorials | DEV articles (which community members can write) | http://localhost:3003
- ```sh
- yarn build
- ```
++| Site | Directory | Scope name | Description | Local development server |
++| -------------------------------------------- | -------------------------------- | ---------- | ------------------------------------------------ | ------------------------ |
++| [supabase.com](https://supabase.com) | `/apps/www` | www | The main website | http://localhost:3000 |
++| [app.supabase.com](https://app.supabase.com) | `/studio` | studio | Studio dashboard | http://localhost:8082 |
++| [POC] Next.js based Docs site | `/apps/temp-docs` | temp-docs | Guides and Reference (Next.js based) | http://localhost:3001 |
++| [POC] Community forum | `/apps/temp-community-forum` | forum | GitHub Discussions | http://localhost:3002 |
++| [POC] DEV articles site | `/apps/temp-community-tutorials` | tutorials | DEV articles (which community members can write) | http://localhost:3003 |
-1. Start development server
+The following sites are temporarily not run using turborepo, and must be run independently.
- Site | Directory | Scope name | Description | Local development server
- ---- | --------- | ---------- | ----------- | ------------------------
- [supabase.com/docs](https://supabase.com/docs) | `/apps/reference` | N/A | Guides and Reference (Currently not in Turborepo) | http://localhost:3010/docs
- npm
++| Site | Directory | Scope name | Description | Local development server |
++| ---------------------------------------------- | ----------------- | ---------- | ------------------------------------------------- | -------------------------- |
++| [supabase.com/docs](https://supabase.com/docs) | `/apps/reference` | N/A | Guides and Reference (Currently not in Turborepo) | http://localhost:3010/docs |
- ```sh
- npm run start
- ```
+For the docs website, please refer to this [developers guide](https://github.com/supabase/supabase/tree/master/apps/reference/DEVELOPERS.md).
- or with yarn
+#### Shared components
- ```sh
- yarn start
- ```
+The monorepo has a set of shared components under `/packages`:
-1. Access the local server in your web browser at http://localhost:3010/docs.
+- `/packages/common`: Common React code, shared between all sites.
+- `/packages/config`: All shared config
+- `/packages/spec`: Generates documentation using spec files.
+- `/packages/tsconfig`: Shared Typescript settings
-### Supabase Studio
+#### Installing packages
-1. Start development server
+Installing a package with NPM workspaces requires you to add the `-w` flag to tell NPM which workspace you want to install into. Do not install dependencies in their local folder, install them from the route using the `-w` flag.
- npm
+The format is: `npm install <package name> -w=<workspace to install in>`.
- ```sh
- npm run dev
- ```
+For example:
- or with yarn
+- `npm install react -w common`: installs into `./packages/common`
+- `npm install react -w www`: installs into `./apps/www`
+- `npm install react -w studio`: installs into `./studio`
- ```sh
- yarn dev
- ```
+You do not need to install `devDependencies` in each workspace. These can all be installed in the root package.
-1. Access the local server in your web browser at http://localhost:8082/.
-See the [Supabase Studio readme](./studio/README.md) for more information.
+---
## Create a pull request
@@@ -124,8 -163,65 +124,8 @@@ Did you have an issue, like a merge con
### Add a redirect
- Create a new entry in the [`next.config.js`](https://github.com/supabase/supabase/blob/master/apps/www/next.config.js) file in our main site.
+ Create a new entry in the [`redirects.js`](https://github.com/supabase/supabase/blob/master/apps/www/lib/redirects.js) file in our main site.
-## Monorepo
-
-We are in the process of migrating this repository to monorepo, using Turborepo.
-Eventually, the docs and the Studio will be run using Turborepo, which will significantly improve the developer workflow.
-You must be using NPM 7 or higher.
-
-### Getting started
-
-```sh
-npm install # install dependencies
-npm run dev # start all the applications
-```
-
-Then edit and visit any of the following sites:
-
-Site | Directory | Description | Local development server
----- | --------- | ----------- | ------------------------
-[supabase.com](https://supabase.com) | `/apps/www` | The main website | http://localhost:3000
-[supabase.com/docs](https://supabase.com/docs) | `apps/reference` | Guides and Reference documentation | http://localhost:3010/docs
-[POC] Community forum | `/apps/temp-community-forum` | GitHub Discussions in a Next.js site | http://localhost:3002
-[POC] DEV articles site | `/apps/temp-community-tutorials` | A Next.js site for our DEV articles (which community members can write) | http://localhost:3003
-
-### Shared components
-
-The monorepo has a set of shared components under `/packages`:
-
-- `/packages/common`: Common React code, shared between all sites.
-- `/packages/config`: All shared config
-- `/packages/spec`: Generates documentation using spec files.
-- `/packages/tsconfig`: Shared Typescript settings
-- `/packages/ui`: Shared UI components (formerly @supabase/ui)
-
-To use these 'packages', or any of their components from a Next.JS app, you must use `next-transpile-modules` in the `next.config.js` file. This looks like:
-
-```tsx
-// next.config.js
-const withTM = require('next-transpile-modules')(['ui', 'common'])
-module.exports = withTM({})
-```
-
-### Installing packages
-
-Installing a package with NPM workspaces requires you to add the `-w` flag to tell NPM which workspace you want to install into.
-
-The format is: `npm install <package name> -w=<workspace to install in>`.
-
-For example:
-
-- `npm install @supabase/ui -w common`: installs into `./packages/common`
-- `npm install @supabase/ui -w www`: installs into `./apps/www`
-
-You do not need to install `devDependencies` in each workspace. These can all be installed in the root package.
-
-### Development
-
-`npm run dev`
-
---
## Community channels