Giter Site home page Giter Site logo

prakhar-ff13 / discord-clone Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 845 KB

A discord clone built using Golang (backend) and React (frontend)

Go 25.93% HTML 1.41% CSS 0.30% TypeScript 72.36%
backend chatapp chatroom frontend full-stack golang golang-examples jwt-authentication mysql nextjs react video-streaming videocall web-development webrtc typescript typescript-react redux redux-thunk webrtc-mesh

discord-clone's Introduction

Discord Clone:

A chatting and video calling app.

Contents:

  1. TechStack
  2. Image
  3. Requirements
  4. Features
  5. Possible Extensions

Tech Stack:

  1. React with TypeScript for UI.
  2. Redux (Thunk for async dispatches) for state management.
  3. Go backend (Gorilla websockets, chi router).
  4. MySQL Database.
  5. JWT Based authentication.
  6. Material UI for styling.

Image:

Requirements:

  1. .env file in backend folder:
    1. PORT=4000
    2. USER1=your-db-username
    3. DB=your-db-name
    4. KEY=key-for-jwt-signing
  2. Database requirements:
    1. MySQL Database.
    2. Tables:
      1. users - Stores users:
        1. id int AUTO_INCREMENT PRIMARY KEY
        2. email varchar(100) NOT NULL UNIQUE
        3. username, varchar(100) NOT NULL
        4. password varchar(100) NOT NULL
      2. friendinvites - Stores invitations sent to user.
        1. sender varchar(100) NOT NULL
        2. receiver varchar(100) NOT NULL
        3. status varchar(30) NOT NULL
        4. PRIMARY KEY(sender, receiver)
        5. FOREIGN KEY (sender) REFERENCES users(email)
        6. FOREIGN KEY (receiver) REFERENCES users(email)
      3. chatMessages - Stores chat messages sent from one user to another:
        1. roomId varchar(50) NOT NULL
        2. createdBy int NOT NULL
        3. email varchar(100) NOT NULL
        4. username varchar(100) NOT NULL
        5. date varchar(100) NOT NULL
        6. message text
        7. FOREIGN KEY (createdBy) REFERENCES users(id)
      4. videorooms - Stores video groups created by a user:
        1. roomId varchar(100) PRIMARY KEY
        2. createdBy varchar(100)
        3. roomLabel varchar(100)
      5. joinedvideorooms - Stores how many people are eligible to enter a room:
        1. roomId varchar(100)
        2. mail varchar(100)
        3. FOREIGN KEY (roomId) REFERENCES videorooms(roomId)
        4. PRIMARY KEY (roomId, mail)

Features:

  1. Login/Register Functionality.
  2. Friend Requests:
    1. Sending / Receiving them.
    2. Accepting / Rejecting them.
  3. Websocket based functionality:
    1. Updating Friends List.
    2. Updating Friend Requests List.
    3. Updating the indicator whenever a friend comes online or goes offline.
    4. Chatting with friends.
  4. Video calling using WebRTC.
    1. Multi user group video video call.
      1. Mesh architecture is used to setup peer connections hence it is not advised to have more than 4 ppl in a video group.
      2. Another way exists which requires some video processing on the sever side. (Not implemented)
    2. To call a friend first send him the video room id, after joining the room. A friend can enter the room.
    3. Audio and Video can be shut off. It is on by default.
    4. The code does not handle the scenario if a user does not have a camera and only wishes to join with audio. (Not implemented)
    5. Screen Sharing funtionality is there but sharing your camera stream along with screen share is not implemented. Sharing screen shuts off the camera video and vice versa.

Possible Extension:

  1. Add joining via audio only. (for users who do not have a camera)
  2. Replace Mesh architecture for managing multiple users and use server methods - requires video processing on the server.
  3. Option to send and recieve video call messages like on messengers or whatsapp.
  4. Use a TURN server. The project does not use one hence it is possible that when it is deployed video chat might not work due to NATing.

discord-clone's People

Contributors

prakhar-ff13 avatar

Stargazers

Amitanshu Sahu avatar

Watchers

 avatar xiggi avatar

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.