An open API service indexing awesome lists of open source software.

https://github.com/yashksaini-coder/sample-relay-chat

Simple repo for the dev container development for the relay-chat repo
https://github.com/yashksaini-coder/sample-relay-chat

daytona typescript vite websocket

Last synced: 4 months ago
JSON representation

Simple repo for the dev container development for the relay-chat repo

Awesome Lists containing this project

README

        

# ๐Ÿ’ฌ 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

### Open Using Daytona

1. **Install Daytona**: Follow the [Daytona installation guide](https://www.daytona.io/docs/installation/installation/).

2. **Create the Workspace**:
```bash
daytona create https://github.com/yashksaini-coder/relay-chat-daytona
```

3. **Next start the application**:
```
npm run dev
```

4. **Click on the local deployment URL of the Application**:
```bash
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](https://skillicons.dev/icons?i=react) | ![TypeScript](https://skillicons.dev/icons?i=ts) | ![Tailwind CSS](https://skillicons.dev/icons?i=tailwind) | ![Vite](https://skillicons.dev/icons?i=vite) | ![React Toastify](https://skillicons.dev/icons?i=react) | ![Lucide React](https://github.com/user-attachments/assets/f4ad1606-9ad2-4726-910d-7843e45e8f9f) |

## ๐Ÿ—๏ธ 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
```json
{
"type": "join",
"payload": {
"roomid": "ROOM_ID"
}
}
```

#### ๐Ÿ’ฌ Chat Message
```json
{
"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