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
- Host: GitHub
- URL: https://github.com/yashksaini-coder/sample-relay-chat
- Owner: yashksaini-coder
- License: mit
- Created: 2024-12-13T19:10:07.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-18T05:35:03.000Z (6 months ago)
- Last Synced: 2024-12-18T06:35:45.997Z (6 months ago)
- Topics: daytona, typescript, vite, websocket
- Language: TypeScript
- Homepage: https://relay-chat.netlify.app/
- Size: 132 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 |
| :---: | :--------: | :----------: | :--: | :------------: | :----------: |
|  |  |  |  |  |  |## ๐๏ธ 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