Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 2 KB

learn.md

File metadata and controls

64 lines (44 loc) · 2 KB

Local development:


Fork the repo:

To contribute to this Discord-Clone, you must first fork the Discord-Clone repo.

Clone the repo:

  1. Clone your GitHub forked repo:

    git clone https://github.com/<github_username>/Discord-Clone
  2. Go to the Discord-Clone directory:

    cd discord-clone
  3. To install the dependencies, run:

    npm install
  4. 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.

Setup environment variables


1. Supabase setup:

  1. Go to Supabase Dashboard (create your account if you have not).

  2. Create a new project.
    Screenshot 2024-05-12 122005

  3. 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.

  4. 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
  5. 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.