Discord clone built to replicate the functionality of the popular communication platform. This application includes all the main features you'd expect from Discord, including account creation, server and channel management, and real-time communication.
- Account Management: Create and manage user accounts.
- Server Management: Create, join, and leave servers.
- Text Channels: Create and participate in text-based chat channels.
- Voice Channels: Join voice channels to talk with others in real-time.
- Video Channels: Join video meetings for face-to-face communication.
- Roles and Permissions: Manage roles such as Admin, Moderator, and Guest with customizable permissions.
- Real-Time Communication: Seamless text, voice, and video interactions.
- Next.js: React framework for server-side rendering and building the frontend.
- Tailwind CSS: Utility-first CSS framework for styling.
- ShadCN: Component library to enhance UI/UX design.
- GoLang: Backend programming language.
- Gin: Web framework for building REST APIs.
- Gorm: ORM library for Go to interact with the database.
- WebSocket: Real-time, bi-directional communication for text, voice, and video channels.
- WebRTC: Enables real-time peer-to-peer audio, video, and data communication.
- The backend includes a Selective Forwarding Unit (SFU), which optimizes WebRTC communications.
- The SFU allows the server to receive media streams from multiple clients and selectively forward them to other participants based on various conditions, such as the client’s subscription or bandwidth capabilities.
- This architecture is more scalable and efficient than peer-to-peer mesh networks, especially for video channels and large group calls.
- PostgreSQL: Relational database for storing app data.
- Docker Compose: Simplifies deployment and running of multi-container Docker applications.
Check out the live demo of the application here:
Live Demo
-
Clone the repository:
git clone https://github.com/MajorTom3K1M/discord-clone.git cd discord-clone
-
Edit the environment variables in the
docker-compose.yml
file as needed. -
Start the application using Docker Compose:
docker-compose up
-
Clone the repository:
git clone https://github.com/MajorTom3K1M/discord-clone.git cd discord-clone
-
Install PostgreSQL:
- Follow the official PostgreSQL installation guide for your operating system.
- Create a new database and user with the required credentials.
- Update the
.env
file in thebackend
folder with your database credentials.
-
Configure Environment Variables:
- The project uses two
.env
files: one in thebackend
folder and one in thefrontend
folder. - Each folder contains a
.env.example
file that provides basic values for the required variables. Copy and rename it to.env
in each folder:cd backend cp .env.example .env # Edit the .env file with your PostgreSQL credentials and other necessary values cd ../frontend cp .env.example .env # Edit the .env file with your UploadThing credentials and other required values
- The project uses two
-
UploadThing Integration:
- The frontend requires
UPLOADTHING_SECRET
andUPLOADTHING_APP_ID
to use UploadThing services. - Obtain these credentials from your UploadThing dashboard and add them to the
.env
file in thefrontend
folder:UPLOADTHING_SECRET=your-uploadthing-secret UPLOADTHING_APP_ID=your-uploadthing-app-id
- The frontend requires
-
Install the dependencies for both backend and frontend:
From the root of the project:
cd frontend npm install
Then, from the root of the project:
cd backend go mod tidy
-
Run the backend and frontend concurrently:
From the root of the project:
npm install npm run dev
Ensure your PostgreSQL database is running and accessible on the configured host and port.