Skip to content

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

Adds June Updates

Paul Copplestone107e9901a0b6
diff --git a/web/blog/2020-06-15-supabase-steve-chavez.md b/web/blog/2020-06-15-supabase-steve-chavez.md
new file mode 100644
index 00000000000..df616aad07f
--- /dev/null
+++ b/web/blog/2020-06-15-supabase-steve-chavez.md
@@ -0,0 +1,18 @@
+---
+title: Steve Chavez has joined Supabase
+description: Steve joins Supabase to help build Auth.
+author: Paul Copplestone
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+---
+
+This month we welcome [Steve Chavez](https://github.com/steve-chavez) to the team. Steve is a maintainer of PostgREST, one of the core tools which makes Supabase possible.
+
+<!--truncate-->
+
+Steve and I have been in contact since he [added one of my old blog posts](https://github.com/PostgREST/postgrest-docs/commit/3dde972d31519d3afc319015bce1dc0f73adeb8e#commitcomment-35312841) to the PostgREST docs. He has a rich history in open source and we're excited to have him in our team.
+
+Steve is helping us build one of our most demanded features - our Auth system. We will support him to build some exciting features which he has planned for PostgREST, including enhanced PostGIS support.
+
diff --git a/web/blog/2020-07-01-supabase-alpha-june-2020.md b/web/blog/2020-07-01-supabase-alpha-june-2020.md
new file mode 100644
index 00000000000..bdff1b381f8
--- /dev/null
+++ b/web/blog/2020-07-01-supabase-alpha-june-2020.md
@@ -0,0 +1,67 @@
+---
+title: Supabase Alpha June 2020
+description: Four months of building
+author: Paul Copplestone
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+---
+
+We're now 4 months into building [Supabase](https://supabase.io), which means another major update. Here's a few things we think you'll love in this release.
+
+<!--truncate-->
+
+### 4 minute demo
+
+Watch a full demo:
+
+<iframe width="640" height="385" src="https://www.loom.com/embed/b3ba79c1633d464ea758e0796bbb39da" frameborder="0" allowFullScreen></iframe>
+
+### View relational data
+
+We're sometimes asked how we will make Postgres as simple as Firebase, since Postgres is a relational database. This month we're making our first steps to prove that relational databases can be even easier to use than document stores. We're releasing an excel-like editing interface which can drill down into your relational data.
+
+<iframe width="640" height="385" src="https://www.loom.com/embed/c6d504bb0a1c43e9bf65cb2aef2949d5" frameBorder="0" allowFullScreen></iframe>
+
+### Manage JSON data
+
+Postgres is an amazing database, giving the flexibility of a document store with the power of a RDBMS. If you use `JSON` data in Postgres, then we want to make that easy too. Supabase detects when your column is `JSON` or `JSONB`, and provides an easy way to edit and view your data. More improvements coming soon for this feature!
+
+<iframe width="640" height="385" src="https://www.loom.com/embed/0b03ac2858324cfabdc6a202c93673f3" frameBorder="0" allowFullScreen></iframe>
+
+### Choose your region
+
+If you noticed a bit of latency on Supabase, it's because your projects were previously set up in Singapore. It was always our intention that you'd be able to choose your database region, and this month we've delivered it. In the next releases we'll even allow you to go multi-region, instantly replicating your database close to your customers.
+
+<iframe width="640" height="385" src="https://www.loom.com/embed/1dcc1bca2ebc45e296e732a66a462c61" frameBorder="0" allowFullScreen></iframe>
+
+### Backups
+
+A guiding principle at Supabase is zero lock-in. So this month we are exposing your daily database backups on the dashboard, giving you a simple way to migrate off Supabase. We have a lot more to build in this space (`WAL-G!`), so watch this space.
+
+<iframe width="640" height="385" src="https://www.loom.com/embed/fc1cb9b395eb4c408c7137bf8e6e1963" frameBorder="0" allowFullScreen></iframe>
+
+### Kaizen
+
+We have a number of small improvements:
+
+- Improved SQL editor - with better syntax highlighting
+- Improved API docs - with more code snippets
+- UX improvements - with a simplified and consistent UX
+
+### Hiring
+
+- This month we [welcome Steve Chavez to the team](/blog/2020/06/15/supabase-steve-chavez). Steve is a maintainer of PostgREST, one of the core tools which makes Supabase possible.
+- We're hiring a part-time designer or UX expert. See more [here](https://news.ycombinator.com/item?id=23708351).
+
+### Get started
+
+- Start using Supabase today: [app.supabase.io](https://app.supabase.io)
+- Make sure to [star us on GitHub](https://github.com/supabase/supabase)
+- Follow us [on Twitter](https://twitter.com/supabase_io)
+- Become a [sponsor]()
+
+
+
+
\ No newline at end of file
diff --git a/web/blog/DRAFT-2020-02-26-basic-slack-clone-react-hooks.mdx b/web/blog/DRAFT-2020-02-26-basic-slack-clone-react-hooks.mdx
deleted file mode 100644
index 8d51f416cca..00000000000
--- a/web/blog/DRAFT-2020-02-26-basic-slack-clone-react-hooks.mdx
+++ /dev/null
@@ -1,453 +0,0 @@
----
-title: DRAFT - Slack clone
-description: Building a basic Slack clone with Postgres and React Hooks
-author: Paul Copplestone
-author_title: Supabase
-author_url: https://github.com/kiwicopple
-author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
-authorURL: https://github.com/kiwicopple
-tags: [postgres, react]
-draft: true
----
-
-import Figure from '../src/components/Figure'
-import Mermaid from '../src/components/Mermaid'
-import CustomCodeBlock from '../src/components/CustomCodeBlock'
-import * as Snippets from '../support/blogBasicSlackClone'
-
-<div className="alert alert--warning" role="alert">
-This guide uses Docker Compose to simplify Postgres setup and data loading.
-We won't go over how to use Docker, but as long as you have it installed and running it will be simple to follow along.
-</div>
-
-[Full code](https://github.com/supabase/supabase/blob/master/examples/slack-clone-basic/README.md) |
-[HN Discussion](https://new.ycombinator.com) |
-[Dev Article](https://dev.to)
-
-<Figure
- src="https://media.giphy.com/media/J07U8iblJhlKDqZOxV/source.gif"
- alt="Slack Clone"
- caption="A simple Next.js app that reacts to changes in your Postgres database."
-/>
-
-
-## Introduction
-
-This is a thorough guide that will step you through four useful technologies which can scale up to production-ready realtime applications:
-
-- [PostgreSQL](https://www.postgresql.org) - an extremely scalable relational database
-- [Supabase](https://supabase.io) - a JS wrapper for Postgres for instant realtime and RESTful APIs
-- [Next.js](https://nextjs.org/) - a JS framework for building server-rendered React apps
-- [Tailwind](https://tailwindcss.com/) - a CSS framework for quickly styling our frontend app
-
-<Mermaid
-caption="Supabase listens to Postgres and sends all changes to Next.js."
-graph={`graph LR
-Supabase(Supabase)
-Postgres(PostgreSQL)
-NextJs(Next.js)
-Tailwind(Tailwind)
-Supabase-->NextJs-->Supabase
-Postgres-->Supabase-->Postgres
-NextJs-.-Tailwind
-subgraph Frontend
-NextJs
-Tailwind
-end
-subgraph Backend
-Postgres
-Supabase
-end
-`}
-/>
-
-
-## Stage 1: Setup the project
-
-<div className="alert alert--warning" role="alert">
-All the code for this section can be found in our main repo:<br />
-<a href="">slack-clone-basic-tutorial/stage-1-setup</a>
-</div>
-
-
-### Create the application
-
-We will create a new Next.js app called `slack-clone-basic`, using the [Next.js SASS example](https://github.com/zeit/next.js/tree/master/examples/with-next-sass) to get us started:
-
-
-<CustomCodeBlock
-header="Initialise the app using Next.js"
-code={`
-npm init next-app --example with-next-sass slack-clone-basic --useNpm
-`}
-language="bash"
-/>
-
-
-This comes with [SASS](https://duckduckgo.com/?q=sass+css&t=ffab&ia=web) built in. You don't need to know anything about SASS, except that it will be useful for Tailwind later on.
-
-
-### Install dependencies
-
-Now let's install our dependencies inside the `./slack-clone-basic` folder:
-
-<CustomCodeBlock
-header="./slack-clone-basic"
-code={`
-npm install --save @supabase/supabase-js tailwindcss
-`}
-language="bash"
-/>
-
-- `@supabase/supabase-js` - for interacting with the database. This will handle all the APIs and realtime functionality
-- `tailwindcss` - for making our frontend look great
-
-
-### Setup all the files
-
-```bash
-mkdir components && touch components/MessageInput.js && \
-mkdir db && touch db/schema.sql && \
-touch pages/{[channelId].js} && \
-touch Store.js && \
-touch docker-compose.yml
-```
-
-You will now have the following boilerplate, ready to fill in with code.
-
-```bash
-├── components
-│   └── MessageInput.js # The text input for writing new messages
-├── db
-│   └── schema.sql # Basic schema and dummy data
-├── pages
-│   ├── [channelId].js # Page for showing all the messages in a channel
-│   └── index.js # Home page
-├── styles
-│   └── style.scss # SASS file for styling our app
-├── next.config.js # For passing ENV variables to our app
-├── Store.js # A basic data store using React Hooks
-└── docker-compose.yml # Docker compose for Postgres and Supabase
-```
-
-By now you can get a simle app running
-
-```
-npm run dev
-```
-
-Visit <a href="http://localhost:3000">http://localhost:3000</a> and you should see a page with a nice green "Hello World!"
-
-## Stage 2: Setup the backend
-
-
-<div className="alert alert--warning" role="alert">
-All the code for this section can be found in stage-2-backend
-</div>
-
-### Setting up Postgres
-
-Let's sketch out the simplest possible database schema we can use.
-
-<Mermaid
-caption="Users can create a message, which belongs to a single channel"
-graph={`classDiagram
-class users{
- id int
- username text
-}
-class channels{
- id int
- slug text
-}
-class messages{
- id int
- message text
- user_id int
- channel_id int
-}
-users .. messages
-channels .. messages
-`}
-/>
-
-Save the corresponding schema in `./db/schema.sql`:
-
-<CustomCodeBlock
-header="~/db/schema.sql"
-code={Snippets.schema}
-language="sql"
-/>
-
-This schema will be automatically created when we start our Docker Compose.
-
-### Setting up the APIs
-
-This is the easiest step of all - you don't have to do anything!
-
-Supabase will introspect your database and provide you with APIs and websockets once we start Docker Compose.
-
-
-### Fire up the Backend
-
-Now lets start Docker Compose. Fill in the docker compose file with the following code:
-
-<CustomCodeBlock
-header="~/docker-compose.yml"
-code={Snippets.dockerfile}
-language="yml"
-/>
-
-Now run `docker-compose up`. If you set everything up correctly, you should be able to visit
-[http://localhost:8000/rest/v1/messages?apikey=examplekey](http://localhost:8000/rest/v1/messages?apikey=examplekey)
-where you will see some of the messages that were created in the database.
-
-From now on you can forget about this route! Supabase will take care of everything when working with the database.
-
-Let's leave this running for the remainder of the tutorial.
-
-### Add ENV variables to Next JS
-
-Let Next.js know how to access Supabase.
-
-<CustomCodeBlock
-header="~/next.config.js"
-code={Snippets.nextJsConfig1}
-language="js"
-/>
-
-
-## Stage 3: Setup the Frontend
-
-
-<div className="alert alert--warning" role="alert">
-All the code for this section can be found in our main repo:<br />
-<a href="">slack-clone-basic-tutorial/stage-3-frontend</a>
-</div>
-
-
-### Building a basic store with React hooks
-
-<CustomCodeBlock
-header="~/lib/Store.js"
-code={Snippets.store1}
-language="js"
-/>
-
-
-### Displaying our messages
-
-
-<CustomCodeBlock
-header="~/pages/[channelId].js"
-code={Snippets.channelPage1}
-language="js"
-/>
-
-Visit <a href="http://localhost:3000/2">http://localhost:3000/2</a> and you will see a page with 2 buttons, and the channel ID displayed.
-
-## Stage 4: Making it look like Slack
-
-<div className="alert alert--warning" role="alert">
-All the code for this section can be found ..
-</div>
-
-
-Now we get to see the power of Tailwind to quickly prototype a frontend.
-
-### Import Tailwind
-
-Add the following code:
-
-<CustomCodeBlock
-header="./styles/style.scss"
-code={`
-@import '~tailwindcss/dist/base.css';
-@import '~tailwindcss/dist/components.css';
-@import '~tailwindcss/dist/utilities.css';
-`}
-language="css"
-/>
-
-### Updating the channels page
-
-Add the following changes to `./pages/[channelId].js`.
-Ignore anything annotated with comments, which is just done to abbreviate the code snippets.
-You won't delete any code in this section, you just need to add classNames to all JSX!
-
-#### Import the stylesheet
-
-```js
-import '../styles/style.scss'
-```
-
-#### Layout the sidebar and main content
-
-```js {1,2,5}
-<div className="main flex h-screen w-screen absolute">
- <nav className="w-1/4 bg-gray-900 text-gray-100 h-screen p-2">
- {/* Sidebar content */}
- </nav>
- <main className="w-3/4 bg-gray-800 h-screen p-2">
- {/* Message content */}
- </main>
-</div>
-```
-
-#### Style the messages
-
-```js {3,6}
-{messages.map(message => (
- <div>
- <p className="text-blue-700 font-bold">
- {message.author.username}
- </p>
- <p className="text-white">
- {message.message}
- </p>
- </div>
-))}
-```
-
-#### "New Channel" button
-
-```js {1}
-<button className="bg-blue-900 hover:bg-blue-700 text-white font-bold p-2 rounded w-full">
- New Channel
-</button>
-```
-
-#### Channel list
-
-```js {1,7}
-<h3 className="py-4">Channels</h3>
-<ul>
- {channels.map(channel => (
- <li key={channel.id}>
- <Link href="/[channelId]" as={`/${channel.id}`}>
- <a
- className="hover:text-blue-400"
- style={{ fontWeight: channel.id == channelId ? 'bold' : 'normal' }}
- >
- {channel.slug}
- </a>
- </Link>
- </li>
- ))}
-</ul>
-```
-
-
-
-## Stage 5: Adding realtime functionality
-
-Make the following changes to the store.
-
-
-
-### Handle new messages
-
-```js
-const [newMessage, handleNewMessage] = useState(null)
-
-// New message recieved from Postgres
-useEffect(() => {
- if (newMessage) {
- let author = users.get(newMessage.user_id)
- setMessages(messages.concat({...newMessage, author }))
- }
-}, [newMessage])
-
-```
-
-### Lisen to the database
-
-```js {5-16}
-useEffect(() => {
- fetchChannels(setChannels)
- fetchMessages(setMessages)
-
- // Listen for new messages
- const messageListener = supabase
- .from('messages')
- .eq('channel_id', channelId)
- .on('*', payload => handleNewMessage(payload.new))
- .subscribe()
-
-
- return () => {
- // Cleanup on unmount
- messageListener.unsubscribe()
- }
-})
-```
-
-## Stage 6: Sending new messages
-
-For now we will assume that we are user 2 (tonystark).
-
-### Add to store
-
-
-```js
-export const addMessage = async (message, channel_id, user_id) => {
- try {
- let { body } = await supabase.from('messages').insert([{ message, channel_id, user_id }])
- return body
- } catch (error) {
- console.log('error', error)
- }
-}
-```
-
-### Add message component
-
-
-Create component
-
-```js
-import { useState } from 'react'
-import { addMessage } from '~/lib/Store'
-
-const MessageInput = ({ channelId }) => {
- const [messageText, setMessageText] = useState('')
-
- const submitOnEnter = event => {
- // Watch for enter key
- if (event.keyCode === 13) {
- addMessage(messageText, channelId, 2)
- setMessageText('')
- }
- }
-
- return (
- <>
- <input
- className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
- type="text"
- placeholder="Send a message"
- value={messageText}
- onChange={e => setMessageText(e.target.value)}
- onKeyDown={e => submitOnEnter(e)}
- />
- </>
- )}
-
-export default MessageInput
-```
-
-Add to Channel Page
-
-```js
-// @todo
- <MessageInput channelId={channelId} />
-```
-
-## Wrapping up
-
-- You now have a realtime application. Open on multiple browsers to see realtime.
-- The combination of Docker + Postgres + Supabase made it quick and easy to get going on our local machines so that we could spend most of the time building the product.
-- Link to the example with user auth, adding channels
-
-
-If you liked this tutorial, make sure to sign up for [Supabase](http://supabase.io) as we continue to bring all the functionality of Firebase to Postgres.
diff --git a/web/blog/DRAFT-2020-04-03-basic-slack-clone-react-hooks.mdx b/web/blog/DRAFT-2020-04-03-basic-slack-clone-react-hooks.mdx
deleted file mode 100644
index 3768ca6b965..00000000000
--- a/web/blog/DRAFT-2020-04-03-basic-slack-clone-react-hooks.mdx
+++ /dev/null
@@ -1,68 +0,0 @@
----
-title: Building a basic Slack clone with Postgres and React Hooks
-description: Building a basic Slack clone with Postgres and React Hooks
-author: Paul Copplestone
-author_title: Supabase
-author_url: https://github.com/kiwicopple
-author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
-authorURL: https://github.com/kiwicopple
-draft: true
----
-
-import Figure from '../src/components/Figure'
-import Mermaid from '../src/components/Mermaid'
-import CustomCodeBlock from '../src/components/CustomCodeBlock'
-import * as Snippets from '../support/blogBasicSlackClone'
-
-
-This is the first of a multi-part series that will show you how to build a simple Slack clone.
-
-[Full code](https://github.com/supabase/supabase/blob/master/examples/slack-clone-basic/README.md) |
-[Subscribe](http://eepurl.com/gPWkwn)
-
-<Figure
- src="https://media.giphy.com/media/J07U8iblJhlKDqZOxV/source.gif"
- alt="Slack Clone"
- caption="A simple Next.js app that reacts to changes in your Postgres database."
-/>
-
-<!--truncate-->
-
-
-- [Building a basic Slack clone with Postgres and React Hooks](/blog/2020/04/03/basic-slack-clone-react-hooks)
-- Building a Slack backend [COMING SOON]
-- Building a Slack frontend [COMING SOON]
-- Adding realtime functionality [COMING SOON]
-
-
-Throughout the series you'll learn how to use four amazing technologies that scale up to production-ready realtime applications:
-
-- [PostgreSQL](https://www.postgresql.org) - an extremely scalable relational database
-- [Supabase](https://supabase.io) - a JS wrapper for Postgres for instant realtime and RESTful APIs
-- [Next.js](https://nextjs.org/) - a JS framework for building server-rendered React apps
-- [Tailwind](https://tailwindcss.com/) - a CSS framework for quickly styling our frontend app
-
-<Mermaid
-caption="Supabase listens to Postgres and sends all changes to Next.js. Tailwind makes our apps look great."
-graph={`graph LR
-Supabase(Supabase)
-Postgres(PostgreSQL)
-NextJs(Next.js)
-Tailwind(Tailwind)
-Supabase-->NextJs-->Supabase
-Postgres-->Supabase-->Postgres
-NextJs-.-Tailwind
-subgraph Frontend
-NextJs
-Tailwind
-end
-subgraph Backend
-Postgres
-Supabase
-end
-`}
-/>
-
-## Subscribe to this series
-
-Make sure you [subscribe to our newsletter](http://eepurl.com/gPWkwn) if you want to get notified when we release the next post in this series.
\ No newline at end of file