From cf89120655d3cfe44fc119daf5d8f63b533a13fd Mon Sep 17 00:00:00 2001 From: Paul Copplestone Date: Thu, 30 Jan 2020 19:31:10 +0800 Subject: [PATCH 1/2] Temporarily adding realtime-js to see why the dev image isn't working --- examples/slack-clone/docker-compose.yml | 17 +++++++++-- examples/slack-clone/next.config.js | 1 - examples/slack-clone/package.json | 1 + examples/slack-clone/pages/channels/[id].js | 31 ++++++++++++++++----- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/examples/slack-clone/docker-compose.yml b/examples/slack-clone/docker-compose.yml index a6a7eb8dc7e..5038e253175 100644 --- a/examples/slack-clone/docker-compose.yml +++ b/examples/slack-clone/docker-compose.yml @@ -14,6 +14,20 @@ services: DB_SCHEMA: public depends_on: - db + realtime: + image: supabase/realtime + restart: on-failure + environment: + DB_HOST: db + DB_NAME: postgres + DB_USER: postgres + DB_PASSWORD: postgres + DB_PORT: 5432 + PORT: 4000 + HOSTNAME: localhost + SECRET_KEY_BASE: postgres + ports: + - "4000:4000" db: image: postgres:12 ports: @@ -28,5 +42,4 @@ services: POSTGRES_DB: postgres POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - POSTGRES_PORT: 5432 - + POSTGRES_PORT: 5432 \ No newline at end of file diff --git a/examples/slack-clone/next.config.js b/examples/slack-clone/next.config.js index edd749e2b6d..ad976a480a7 100644 --- a/examples/slack-clone/next.config.js +++ b/examples/slack-clone/next.config.js @@ -13,7 +13,6 @@ const nextConfig = { }, } - // SASS const withSass = require('@zeit/next-sass') const withSassConfig = { diff --git a/examples/slack-clone/package.json b/examples/slack-clone/package.json index 9bd618c7a94..bfa9b9b2bf8 100644 --- a/examples/slack-clone/package.json +++ b/examples/slack-clone/package.json @@ -8,6 +8,7 @@ "start": "next start" }, "dependencies": { + "@supabase/realtime-js": "^0.1.6", "@supabase/supabase-js": "^0.1.16", "@zeit/next-sass": "^1.0.0", "next": "latest", diff --git a/examples/slack-clone/pages/channels/[id].js b/examples/slack-clone/pages/channels/[id].js index faaf25ee6a7..c3f8f7e4c16 100644 --- a/examples/slack-clone/pages/channels/[id].js +++ b/examples/slack-clone/pages/channels/[id].js @@ -9,8 +9,30 @@ import { useState, useEffect } from 'react' import { createClient } from '@supabase/supabase-js' import { useRouter } from 'next/router' -const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY) +/// TEMP +import { Socket } from '@supabase/realtime-js' +const REALTIME_URL = process.env.REALTIME_URL || 'ws://localhost:4000/socket' +var socket = new Socket(REALTIME_URL) +socket.connect() +const topic = socket.channel('realtime:*') +topic.on('*', msg => { + console.log('msg', msg) +}) +topic + .join() + .receive('ok', () => console.log('Connected')) + .receive('error', () => console.log('Failed')) + .receive('timeout', () => console.log('Waiting...')) +/// TEMP +const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_KEY) +// const mySubscription = supabase +// .from('messages') +// .on('*', payload => { +// console.log('Change received!', payload) +// }) +// .subscribe() + const ChannelsPage = props => { const router = useRouter() const { id: channelId } = router.query @@ -21,12 +43,6 @@ const ChannelsPage = props => { useEffect(() => { try { setChannels(props.channels) - const mySubscription = supabase - .from('messages') - .on('*', payload => { - console.log('Change received!', payload) - }) - .subscribe() } catch (error) { console.log('Error: ', error) } @@ -89,6 +105,7 @@ const getMessages = async (channelId, setState) => { .from('messages') .eq('channel_id', channelId) .select(`*, author:user_id(*)`) + .order('inserted_at', true) if (setState) setState(body) return body } catch (error) { From 70874a26ce3c4a81786278fe0dc470a8df734add Mon Sep 17 00:00:00 2001 From: Paul Copplestone Date: Fri, 31 Jan 2020 12:47:05 +0800 Subject: [PATCH 2/2] Adding some more kudos --- Makefile | 13 +++++++------ web/docs/handbook/contributing.mdx | 3 +++ web/src/data/contributors/issues.json | 4 ---- web/src/data/repos/monorepo.json | 16 ++++++++-------- web/src/data/repos/realtime.json | 16 ++++++++-------- web/src/data/stars/stargazers.json | 24 ++++++++++++++++++++++++ web/static/humans.txt | 14 ++++++++------ 7 files changed, 58 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index d84e1c2b613..7e3686f0a43 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,10 @@ REPO_DIR=$(shell pwd) help: @echo "\SCRIPTS\n" - @echo "make github.contributors # pull a list of all contributors" - @echo "make github.issues # pull a list of all issue creators" - @echo "make github.repos # pull a list of our repos" - @echo "make github.traction # get a history of stargazers for our individual repos" + @echo "make github.users # pull a list of all contributors" + @echo "make github.issues # pull a list of all issue creators" + @echo "make github.repos # pull a list of our repos" + @echo "make github.traction # get a history of stargazers for our individual repos" github.users: curl -sS https://api.github.com/repos/supabase/monorepo/contributors \ @@ -31,5 +31,6 @@ github.repos.%: curl -sS https://api.github.com/repos/supabase/$* \ > $(REPO_DIR)/web/src/data/repos/$*.json -github.traction: \ - cd web && npm run traction \ No newline at end of file +github.traction: + cd "$(REPO_DIR)"/web && \ + npm run traction \ No newline at end of file diff --git a/web/docs/handbook/contributing.mdx b/web/docs/handbook/contributing.mdx index a6d2d2bcd66..02f5adf3e71 100644 --- a/web/docs/handbook/contributing.mdx +++ b/web/docs/handbook/contributing.mdx @@ -34,3 +34,6 @@ Please refrain from putting us on any launch lists (like Product Hunt) until we +### Opensource Software + +Supabase would not be possible without the work of some other amazing opensource contributors. [See the full list](/humans.txt). diff --git a/web/src/data/contributors/issues.json b/web/src/data/contributors/issues.json index c92e4706962..76e512498da 100644 --- a/web/src/data/contributors/issues.json +++ b/web/src/data/contributors/issues.json @@ -6,9 +6,5 @@ { "username": "kiwicopple", "avatar_url": "https://avatars0.githubusercontent.com/u/10214025?v=4" - }, - { - "username": "phamhieu", - "avatar_url": "https://avatars2.githubusercontent.com/u/689843?v=4" } ] diff --git a/web/src/data/repos/monorepo.json b/web/src/data/repos/monorepo.json index e59a39ce096..b8a0470d5d9 100644 --- a/web/src/data/repos/monorepo.json +++ b/web/src/data/repos/monorepo.json @@ -65,16 +65,16 @@ "releases_url": "https://api.github.com/repos/supabase/monorepo/releases{/id}", "deployments_url": "https://api.github.com/repos/supabase/monorepo/deployments", "created_at": "2019-10-12T05:56:49Z", - "updated_at": "2020-01-28T02:20:53Z", - "pushed_at": "2020-01-28T02:20:50Z", + "updated_at": "2020-01-30T04:29:14Z", + "pushed_at": "2020-01-30T11:31:20Z", "git_url": "git://github.com/supabase/monorepo.git", "ssh_url": "git@github.com:supabase/monorepo.git", "clone_url": "https://github.com/supabase/monorepo.git", "svn_url": "https://github.com/supabase/monorepo", "homepage": "https://supabase.io", - "size": 3703, - "stargazers_count": 61, - "watchers_count": 61, + "size": 3972, + "stargazers_count": 64, + "watchers_count": 64, "language": "JavaScript", "has_issues": true, "has_projects": true, @@ -85,7 +85,7 @@ "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 6, + "open_issues_count": 7, "license": { "key": "apache-2.0", "name": "Apache License 2.0", @@ -94,8 +94,8 @@ "node_id": "MDc6TGljZW5zZTI=" }, "forks": 1, - "open_issues": 6, - "watchers": 61, + "open_issues": 7, + "watchers": 64, "default_branch": "master", "temp_clone_token": null, "organization": { diff --git a/web/src/data/repos/realtime.json b/web/src/data/repos/realtime.json index c20a777ed8a..b182a51147a 100644 --- a/web/src/data/repos/realtime.json +++ b/web/src/data/repos/realtime.json @@ -65,16 +65,16 @@ "releases_url": "https://api.github.com/repos/supabase/realtime/releases{/id}", "deployments_url": "https://api.github.com/repos/supabase/realtime/deployments", "created_at": "2019-09-23T12:15:45Z", - "updated_at": "2020-01-27T19:27:20Z", - "pushed_at": "2020-01-24T09:33:58Z", + "updated_at": "2020-01-30T20:42:08Z", + "pushed_at": "2020-01-30T06:29:31Z", "git_url": "git://github.com/supabase/realtime.git", "ssh_url": "git@github.com:supabase/realtime.git", "clone_url": "https://github.com/supabase/realtime.git", "svn_url": "https://github.com/supabase/realtime", "homepage": "https://supabase.io", - "size": 2030, - "stargazers_count": 336, - "watchers_count": 336, + "size": 2034, + "stargazers_count": 351, + "watchers_count": 351, "language": "JavaScript", "has_issues": true, "has_projects": true, @@ -85,7 +85,7 @@ "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 2, + "open_issues_count": 4, "license": { "key": "apache-2.0", "name": "Apache License 2.0", @@ -94,8 +94,8 @@ "node_id": "MDc6TGljZW5zZTI=" }, "forks": 5, - "open_issues": 2, - "watchers": 336, + "open_issues": 4, + "watchers": 351, "default_branch": "master", "temp_clone_token": null, "organization": { diff --git a/web/src/data/stars/stargazers.json b/web/src/data/stars/stargazers.json index 40a804b3ee6..e24d562b03c 100644 --- a/web/src/data/stars/stargazers.json +++ b/web/src/data/stars/stargazers.json @@ -226,5 +226,29 @@ "@supabase/monorepo": 60, "@supabase/realtime": 333, "@supabase/schemas": 4 + }, + { + "name": "2020-01-27", + "@supabase/monorepo": 61, + "@supabase/realtime": 336, + "@supabase/schemas": 5 + }, + { + "name": "2020-01-28", + "@supabase/monorepo": 63, + "@supabase/realtime": 339, + "@supabase/schemas": 5 + }, + { + "name": "2020-01-29", + "@supabase/monorepo": 63, + "@supabase/realtime": 347, + "@supabase/schemas": 5 + }, + { + "name": "2020-01-30", + "@supabase/monorepo": 64, + "@supabase/realtime": 351, + "@supabase/schemas": 5 } ] \ No newline at end of file diff --git a/web/static/humans.txt b/web/static/humans.txt index 0a3c6df2221..2868b4defb0 100644 --- a/web/static/humans.txt +++ b/web/static/humans.txt @@ -15,10 +15,12 @@ ___________ TECHNOLOGIES -Just a few of the opensource technologies that make Supabase possible. - -Web - Docusaurus -App - NextJS -Reatime - Phoenix & Elixir -Restful - PostgREST +Supabase would not be possible without the work of some other amazing opensource contributors. +- Postgres - https://www.postgresql.org/docs/devel/git.html +- PostgREST - https://github.com/PostgREST +- Nginx - http://hg.nginx.org/nginx/ +- Kong - https://github.com/kong/ +- NextJS - https://nextjs.org/ +- Phoenix - https://www.phoenixframework.org/ +- Docusaurus - https://v2.docusaurus.io/ \ No newline at end of file