Skip to content

A real time chat application using WebSocket's, to create & join a room for chat with other users

Notifications You must be signed in to change notification settings

yashksaini-coder/relay-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9121436 Β· Dec 18, 2024

History

25 Commits
Dec 17, 2024
Dec 18, 2024
Dec 17, 2024
Dec 18, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024

Repository files navigation

πŸ’¬ Relay-Chat Typescript/React

RTC Terminal is a modern real-time chat application that enables users to create or join chat rooms and communicate instantly with other participants. The application features a clean, responsive interface and supports real-time message delivery using WebSocket technology.


πŸš€ Getting Started

  1. Cloning the Repository:

    git clone https://github.com/yashksaini-coder/relay-chat
  2. Installing Dependencies:

     npm install
  3. Running the application:

    npm run dev
    
  4. Click on the local deployment URL of the Application:

    https://localhost/5173

✨ Features

🏠 Room Management

  • πŸ†• Create new rooms with auto-generated unique room IDs
  • πŸ”— Join existing rooms using room IDs
  • πŸ“‹ Copy room IDs to clipboard for easy sharing
  • πŸ‘₯ Real-time user connection tracking

πŸ’¬ Chat Features

  • ⚑ Real-time message delivery
  • πŸ–ΌοΈ User-friendly message interface with distinct styling for sent/received messages
  • πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Support for multiple users in the same room
  • πŸ“ Username display for each message
  • ⏎ Enter key support for sending messages

🎨 UI/UX

  • πŸŒ“ Clean, modern interface with dark theme
  • πŸ“± Responsive design that works on mobile and desktop
  • πŸ”” Toast notifications for important actions
  • 🎒 Smooth transitions and hover effects
  • πŸ“œ Scrollable message history

πŸ› οΈ Tech Stack

🌐 Frontend

React TypeScript Tailwind CSS Vite React Toastify Lucide React
React TypeScript Tailwind CSS Vite React Toastify Lucide React

πŸ—οΈ Architecture

🌐 Frontend Architecture

The frontend is built as a single-page application (SPA) with React. Key components include:

  • πŸ”— Connection management with WebSocket
  • πŸ—ƒοΈ State management using React hooks
  • πŸ“ Responsive UI components
  • ⚑ Real-time message handling and display

πŸ–₯️ Backend Architecture

The backend implements a WebSocket server that handles:

  • πŸ‘₯ User connections and disconnections
  • 🏠 Room management
  • πŸ“‘ Message broadcasting to room participants
  • πŸ”’ User count tracking

πŸ“‘ Communication Protocol

The application uses a simple message protocol over WebSocket:

πŸšͺ Join Room Message

{
    "type": "join",
    "payload": {
        "roomid": "ROOM_ID"
    }
}

πŸ’¬ Chat Message

{
    "type": "chat",
    "payload": {
        "name": "USERNAME",
        "message": "MESSAGE_CONTENT"
    }
}

πŸ”’ Security Features

  • πŸ” Secure WebSocket connections (WSS)
  • πŸ›‘οΈ Input validation
  • πŸšͺ Room isolation (messages only broadcast to users in the same room)

🌍 Deployment

  • 🌐 Frontend deployed on Vercel
  • πŸ–₯️ Backend deployed on Render
  • πŸ”§ WebSocket server configured for production use

About

A real time chat application using WebSocket's, to create & join a room for chat with other users

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published