{"id":15764869,"url":"https://github.com/thorwebdev/supabase-slack-clone","last_synced_at":"2025-10-04T20:18:24.148Z","repository":{"id":77094469,"uuid":"285798588","full_name":"thorwebdev/supabase-slack-clone","owner":"thorwebdev","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-09T09:08:49.000Z","size":1640,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T03:48:05.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://supabase-slack-clone-green.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thorwebdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-07T10:08:31.000Z","updated_at":"2020-08-09T09:08:48.000Z","dependencies_parsed_at":"2023-09-04T18:45:56.815Z","dependency_job_id":null,"html_url":"https://github.com/thorwebdev/supabase-slack-clone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thorwebdev/supabase-slack-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorwebdev%2Fsupabase-slack-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorwebdev%2Fsupabase-slack-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorwebdev%2Fsupabase-slack-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorwebdev%2Fsupabase-slack-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thorwebdev","download_url":"https://codeload.github.com/thorwebdev/supabase-slack-clone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorwebdev%2Fsupabase-slack-clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278366707,"owners_count":25975104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T12:22:05.459Z","updated_at":"2025-10-04T20:18:24.087Z","avatar_url":"https://github.com/thorwebdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Realtime chat example using Supabase\n\nThis is a full-stack Slack clone example using:\n\n- Frontend:\n  - Next.js.\n  - [Supabase.js](https://supabase.io/docs/library/getting-started) for user management and realtime data syncing.\n- Backend:\n  - [app.supabase.io/](https://app.supabase.io/): hosted Postgres database with restful API for usage with Supabase.js.\n\n## Demo\n\n- Live demo: http://supabase-slack-clone.supabase.vercel.app/\n- CodeSandbox: https://codesandbox.io/s/github/supabase/supabase/tree/master/examples/slack-clone\n- Video tutorial: https://www.loom.com/share/31eec9b656e44b8d87c88bde8a465676\n\n![Demo animation gif](./public/slack-clone-demo.gif)\n\n## Deploy your own\n\n### 1. Create new project\n\nSign up to Supabase - [https://app.supabase.io](https://app.supabase.io) and create a new project. Wait for your database to start.\n\n### 2. Run \"Slack Clone\" Quickstart\n\nOnce your database has started, run the \"Slack Clone\" quickstart.\n\n![Slack Clone Quick Start](https://user-images.githubusercontent.com/10214025/88916135-1b1d7a00-d298-11ea-82e7-e2c18314e805.png)\n\n### 3. Get the URL and Key\n\nGo to the Project Settings (the cog icon), open the API tab, and find your API URL and `anon` key, you'll need these in the next step.\n\nThe `anon` key is your client-side API key. It allows \"anonymous access\" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. This enables row level security for your data. Read more about this [below](#postgres-row-level-security).\n\n![image](https://user-images.githubusercontent.com/10214025/88916245-528c2680-d298-11ea-8a71-708f93e1ce4f.png)\n\n**_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser.\n\n### 4. Deploy the Next.js client\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https%3A%2F%2Fgithub.com%2Fsupabase%2Fsupabase%2Ftree%2Fmaster%2Fexamples%2Fslack-clone\u0026env=NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_KEY\u0026envDescription=Find%20the%20Supabase%20URL%20and%20key%20in%20the%20your%20auto-generated%20docs%20at%20app.supabase.io\u0026project-name=supabase-slack-clone\u0026repo-name=supabase-slack-clone)\n\nYou will be asked for a `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_KEY`. Use the API URL and `anon` key from [step 3](#3.-get-the-url-and-key).\n\n## How to use\n\n### Using `create-next-app`\n\nExecute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example locally:\n\n```bash\nnpx create-next-app --example with-supabase-auth-realtime-db realtime-chat-app\n# or\nyarn create next-app --example with-supabase-auth-realtime-db realtime-chat-app\n```\n\n### Download manually\n\nDownload the example:\n\n```bash\ncurl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-supabase-auth-realtime-db\ncd with-supabase-auth-realtime-db\n```\n\n### Required configuration\n\nCopy the `.env.local.example` file into a file named `.env.local` in the root directory of the example:\n\n```bash\ncp .env.local.example .env.local\n```\n\nSet your Supabase details from from [step 3](#3.-get-the-url-and-key) above:\n\n```bash\nNEXT_PUBLIC_SUPABASE_URL=\u003creplace-with-your-API-url\u003e\nNEXT_PUBLIC_SUPABASE_KEY=\u003creplace-with-your-anon-key\u003e\n```\n\n### Run the development server\n\nNow install the dependencies and start the development server.\n\n```bash\nnpm install\nnpm run dev\n# or\nyarn\nyarn dev\n```\n\nVisit http://localhost:3000 and start chatting! Open a channel across two browser tabs to see everything getting updated in realtime 🥳\n\n## Supabase details\n\n### Postgres Row level security\n\nThis project uses very high-level Authorization using Postgres' Role Level Security.\nWhen you start a Postgres database on Supabase, we populate it with an `auth` schema, and some helper functions.\nWhen a user logs in, they are issued a JWT with the role `authenticated` and thier UUID.\nWe can use these details to provide fine-grained control over what each user can and cannot do.\n\nThis is a trimmed-down schema, with the policies:\n\n```sql\n-- USER PROFILES\nCREATE TYPE public.user_status AS ENUM ('ONLINE', 'OFFLINE');\nCREATE TABLE public.users (\n  id uuid NOT NULL PRIMARY KEY, -- UUID from auth.users (Supabase)\n  username text,\n  status user_status DEFAULT 'OFFLINE'::public.user_status\n);\nALTER TABLE public.users ENABLE ROW LEVEL SECURITY;\nCREATE POLICY \"Allow logged-in read access\" on public.users FOR SELECT USING ( auth.role() = 'authenticated' );\nCREATE POLICY \"Allow individual insert access\" on public.users FOR INSERT WITH CHECK ( auth.uid() = id );\nCREATE POLICY \"Allow individual update access\" on public.users FOR UPDATE USING ( auth.uid() = id );\n\n-- CHANNELS\nCREATE TABLE public.channels (\n  id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,\n  inserted_at timestamp with time zone DEFAULT timezone('utc'::text, now()) NOT NULL,\n  slug text NOT NULL UNIQUE\n);\nALTER TABLE public.channels ENABLE ROW LEVEL SECURITY;\nCREATE POLICY \"Allow logged-in full access\" on public.channels FOR ALL USING ( auth.role() = 'authenticated' );\n\n-- MESSAGES\nCREATE TABLE public.messages (\n  id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,\n  inserted_at timestamp with time zone DEFAULT timezone('utc'::text, now()) NOT NULL,\n  message text,\n  user_id uuid REFERENCES public.users NOT NULL,\n  channel_id bigint REFERENCES public.channels NOT NULL\n);\nALTER TABLE public.messages ENABLE ROW LEVEL SECURITY;\nCREATE POLICY \"Allow logged-in read access\" on public.messages USING ( auth.role() = 'authenticated' );\nCREATE POLICY \"Allow individual insert access\" on public.messages FOR INSERT WITH CHECK ( auth.uid() = user_id );\nCREATE POLICY \"Allow individual update access\" on public.messages FOR UPDATE USING ( auth.uid() = user_id );\n```\n\n## Authors\n\n- [Supabase](https://supabase.io)\n\nSupabase is open source, we'd love for you to follow along and get involved at https://github.com/supabase/supabase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorwebdev%2Fsupabase-slack-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthorwebdev%2Fsupabase-slack-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorwebdev%2Fsupabase-slack-clone/lists"}