Skip to content

acheung-94/dischord

Repository files navigation

splash

Welcome to Dischord.

(no, that's not a typo, this is just the Discord you have at home™)

What is Dischord?

Dischord is a clone of the beloved web-based messaging application Discord.

  • 🔑 Seamless Sign-in: Sign in to Dischord to access all features! There are demo users available for instant access.
  • 📣 Real-time Communication: Send memes, GIFs, and messages to other group members in real-time with Action Cable / Websockets support and AWS integration for image attachments..
  • 🏰 Server Flexibility: Own and manage multiple servers, join others as members, and create chat channels within each server. Give your server some flair by uploading an icon!
  • 👩🏼‍🤝‍🧑 User Interaction: Connect with other users by adding them as friends or adding them to your servers. layoutdischord

Tech Stack

Frontend

  • react redux js css css

Backend

  • ror PSQL

Cloud

  • aws

Highlights

Detailed cloning

  • Every visual and functional detail in this project has been lovingly recreated from the beloved gaming-turned-community-building chat app.
  • The server list, to me, is one of the most iconic and recognizable parts of this application, so great care was taken to ensure icons behaved and appeared very similar to the real Discord's.
  • icons

Live Messaging

  • Nobody wants to have to reload the page to view the cat GIFs their friends are sending them.
  • Through Action Cable, the current Dischord server channel on the frontend establishes a stateful, persistent WebSockets connection with the Rails server and receives broadcasted updates whenever a message is created, updated, or destroyed. Those changes are transmitted to Redux and the content renders live, allowing instant messaging and meme-sharing.
    useEffect(() => {
        if (type === 'channel') {

            dispatch(getChannelMessages(channelId))
            const sub = consumer.subscriptions.create( {
                channel: 'ChannelsChannel',
                channelId
            }, {
                received(message){
                    if (message.type === 'delete'){
                        dispatch(deleteMessage(message.messageId))
                    }else{
                        dispatch(addMessage(message))
                    }
                }
            })
            return () => consumer.subscriptions.remove(sub)
        }
    }, [channelId])

chat attach crop

User Search

  • Making friends can be hard. Leveraging Rails associations and scopes makes it easier! Users are able to find potential friends based on specific criteria.
    • Efficient Filtering: Users can search for other users based on various criteria without causing database conflicts.
    • Friendship Management: Users can send friend requests to new users not already on their friends list, restore previously rejected users to their friends list, or unblock users for future interactions.
    def self.filtered_user_results(username, current_user)
        friend_ids = current_user.friends.pluck(:id) #can't search friends
        enemy_ids = current_user.enemies.pluck(:id) #can't search enemies
        pending_ids = current_user.pending #can't search pending
        bad_ids = [current_user.id] + friend_ids + enemy_ids + pending_ids #can't search themselves
        self.where("username LIKE ?", "%#{username}%")
            .where.not(id: bad_ids ) 
    end

What's next?

Direct messaging (DMs)

  • Enhance user experience by implementing direct messaging functionality. Currently, the channels schema is set up to accommodate belonging to a user. Memberships can be altered to include a channel_id. When a channel belongs to a user, and a user belongs to a channel owned by another user, they can message each other directly through that channel.

Extend Websockets to friend and server invites, user login status, and implement live notifications.

  • Currently, only messaging gets live broadcasts from the server. Adding this functionality to the rest of the features would enhance the overall experience.

Add user customization features!

  • Give users more creative power over their online appearance. Upload custom banners, user icons, and custom status messages, both during the account creation process and any time afterwards.

Add rich text & emojis to messaging

fun

About

A clone of the beloved web-based messaging application Discord.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published