Code Monkey home page Code Monkey logo

discord-clone's Introduction

Discord Clone

A full-stack clone web application of Discord, created with Express.js, Typescript and React.

Check out the live demo here! ๐Ÿ‘ˆ

Packages and Features

  • Socket.io - Real-time messaging, user updates and messaging notifications
  • Livekit WebRTC - 1:1 and 1:N voice, video and screen-share and live call updates with webhooks
  • EmojiMart - Twemojis and custom emojis
  • Cloudinary - Upload message attachments, profile pictures and custom emojis
  • Tenor GIF API - Send GIF messages
  • Slate React - Rich-text editor to automatically parse emojis from shortcodes and URL links
  • RTK Query - Data fetching, state-management and client-side caching
  • Axios - Data fetching with request/response interceptors
  • Redis - Server-side caching
  • SCSS modules - UI/UX, layout and responsiveness
  • MongoDB with Mongoose - Database
  • JWT and bcrypt - Authentication, including auto-refreshing access tokens
  • Nodemailer - Password reset and verification emails

  • Servers - Join servers with communities of like-minded individuals, or create and customize your own
  • Channels - Text and voice/video channels and categories to organize server topics
  • Invite Links - Invite others to join servers with unique links
  • Roles - Manage and customize server member permissions
  • Reactions - Express your feelings with message reactions
  • DMs - Create group chats for up to 10 friends
  • Profiles - Individually customizable user and server profiles
  • Friending/Blocking - Friend requesting, blocking and mutual friends/servers
  • Infinite scroll and offset pagination - Loading messages and public servers

Installation

1. Clone the repository

git clone https://github.com/xinweny/discord-clone.git
cd discord-clone

2. Back-end setup

# Move into front-end folder
cd backend

# Install dependencies
npm install

# Copy the example .env file and fill it out
cp .env.example .env

# Run Express and Livekit servers
npm run dev

NOTE: You will also need a secure tunneling service such as ngrok to allow Livekit to access the webhook endpoint - detailed instructions here.

3. Front-end setup

# Move into front-end folder
cd frontend

# Install dependencies
npm install

# Copy the example .env file and fill it out
cp .env.example .env

# Run Vite front-end
npm run dev

# Open in your browser
open http://localhost:5173

Disclaimer

This is a project inspired by Discord and created solely for personal educational purposes. This project is NOT used for the purpose of monetary gain. This project has no affiliation with Discord Inc. or any parties related or associated with Discord Inc.

discord-clone's People

Contributors

xinweny avatar

Watchers

 avatar

discord-clone's Issues

Cloudinary not uploading images

Whenever I upload an image to the discord clone and have setup cloudinary correctly I get this
image

And if I click it I get this
image

If I look on the Cloudinary dashboard I can acctualy see that it records the 404 errors meaning that it is set up correctly in the .env.
image

Can you please fix this?

(Also same happens when uploading custom profile pictures).

Unable to create channel, category, roles or host on my ip network.

Whenever I try to add a channel, role or category, I get an issue similar to this

[0] CustomError: Unauthorized
[0]     at authorizeMiddleware (file:///D:/discord-clone/backend/src/middleware/authorize.ts:1:1007)
[0]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0]     at async file:///D:/discord-clone/backend/src/helpers/tryCatch.ts:1:199 {
[0]   statusCode: 403,
[0]   error: null
[0] }

Any reason as to why?

status icons/dm icons/friend icons

hi i was just wondering if it is possible to get icons when you get dm'ed so it has the number of times you where dmed by that user and if their pfp shows in the side bar (with the numbers like discord does) and if there can be something like this when you get friended so the count shows on the discord logo and on the friends tab. i was also wondering if it is possible to have status icons inside the server list like discord does?

JWT Keys

Just wondering what I need to do here:

# Authentication
JWT_ACCESS_SECRET=
JWT_REFRESH_SECRET=
JWT_RESET_SECRET=

JWT_ACCESS_EXPIRE= # e.g. 300s, 15m, 1h 
JWT_REFRESH_EXPIRE=# e.g. 60d

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.