To contribute to this Discord-Clone, you must first fork the Discord-Clone repo.
-
Clone your GitHub forked repo:
git clone https://github.com/<github_username>/Discord-Clone
-
Go to the Discord-Clone directory:
cd discord-clone
-
To install the dependencies, run:
npm install
-
To start the development server, run in terminal:
npm run dev
Note : The project's backend is based on nodejs, so make sure you have node version 20 or above installed in your machine, if not refer to this: https://nodejs.org/en/download.
-
Go to Supabase Dashboard (create your account if you have not).
-
Get your project url and anon api key.
Note : You should not reveal this api key as this works as a bridge between your database and project. -
In your forked repo create a
.env.local
file, copy the contents from.env.local.example
and paste the credentials in it:NEXT_PUBLIC_SUPABASE_URL=https(:)//some-string-here.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=anon-api-key-here
-
Connect to your supabase DB.
import { createClient } from '@supabase/supabase-js'; const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL; const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY; const supabase = createClient(supabaseUrl, supabaseKey);
Supabase is an open source firebase alternative, that provides Postgres database, Authentication, instant APIs, Edge Functions, Realtime subscriptions, Storage, and Vector embeddings.
Refer to this Documentation, for more information.