A full-stack real-time chat application where users can create and join anonymous chat rooms without any signup or login required. Features include voice chat, room management, admin controls, and a distinctive red theme.
- Anonymous Chat: No signup/login required - automatic
anonymousNnaming - Real-time Messaging: Instant messaging powered by Socket.IO
- Voice Chat: WebRTC peer-to-peer voice communication
- Room Management: Create, join, and manage chat rooms
- Admin Controls: Room owners can kick/ban users
- Tag System: Categorize and filter rooms by tags
- Password Protection: Optional room locking with passwords
- Responsive Design: Works on desktop and mobile devices
- Red Theme: Distinctive full-red background design
- Server:
backend/server.js- Main Express server with Socket.IO - Room Management:
backend/rooms.js- In-memory room storage and user management - Socket Handlers:
backend/socketHandlers.js- Real-time event handling - Storage: In-memory (with Redis adapter comments for scaling)
- App:
frontend/src/App.jsx- Main application component - Components: Modular React components for different features
- Contexts: Socket, Room, and Voice context providers
- Styling: Tailwind CSS with custom red theme
- Node.js 18+
- Express.js
- Socket.IO
- CORS
- bcryptjs (password hashing)
- express-rate-limit
- React 18
- Vite
- Socket.IO Client
- Tailwind CSS
- Lucide React (icons)
- WebRTC (voice chat)
- Node.js 18 or higher
- npm or yarn
- Clone and install dependencies:
git clone <repository-url>
cd chatrix
npm run install-all- Start both backend and frontend:
npm run devThis will start:
- Backend server on
http://localhost:3000 - Frontend development server on
http://localhost:3001
cd backend
npm install
npm run devcd frontend
npm install
npm run devCreate a .env file in the backend directory:
PORT=3000
RATE_LIMIT=100
# REDIS_URL=redis://localhost:6379
NODE_ENV=development- Click "Create Room" on the main page
- Enter room name (required)
- Add tags (optional) - helps others find your room
- Optionally lock the room with a password
- Click "Create Room" to create and join
- Browse available rooms on the main page
- Use search and filters to find specific rooms
- Click "Join Room" to join
- Enter password if the room is locked
- Messaging: Type and send messages in real-time
- Voice Chat: Click the microphone button to enable voice
- User List: View all users in the room
- Admin Controls: Room owners can kick/ban users
- Transcript: Download chat history as JSON
- Kick User: Temporarily remove user (1 minute cooldown)
- Ban User: Permanently remove user from room
- User Management: View and manage all room members
| Event | Payload | Description |
|---|---|---|
create_room |
{ name, tags[], locked, password? } |
Create a new room |
get_rooms |
{ search?, tags? } |
Get filtered list of rooms |
join_room |
{ roomId, password? } |
Join a room |
leave_room |
{} |
Leave current room |
message |
{ roomId, text } |
Send message to room |
webrtc-signal |
{ roomId, signal, targetSocketId } |
WebRTC signaling |
kick_user |
{ roomId, targetSocketId } |
Kick user (admin only) |
ban_user |
{ roomId, targetSocketId } |
Ban user (admin only) |
| Event | Payload | Description |
|---|---|---|
room_update |
{ type, room } |
Room created/updated |
user_joined |
{ roomId, user, users[] } |
User joined room |
user_left |
{ roomId, user } |
User left room |
message |
{ roomId, message } |
New message in room |
kicked |
{ roomId, reason } |
You were kicked |
banned |
{ roomId, reason } |
You were banned |
GET /api/health- Health checkGET /api/rooms?search=&tags=- Get rooms (REST API)GET /api/tags- Get all tags
The app uses a distinctive red theme with the following color palette:
--chatrix-bg: #ff0000; /* Pure red background */
--chatrix-dark: #c10a0a; /* Darker red for cards */
--chatrix-darker: #8b0000; /* Darkest red for messages */
--chatrix-light: #ff4444; /* Light red for accents */
--chatrix-text: #ffffff; /* White text */
--chatrix-border: #ff6666; /* Red borders */To customize colors, modify the CSS variables in frontend/src/index.css and the Tailwind config in frontend/tailwind.config.js.
- Rate Limiting: 100 messages per minute per user
- XSS Protection: HTML escaping in messages
- Password Hashing: SHA-256 for room passwords
- Input Validation: Server-side validation for all inputs
- CORS Protection: Configured for production domains
- Memory Usage: ~1MB per 1000 active users
- Message Throughput: ~10,000 messages/second
- Concurrent Rooms: Limited by available memory
- Redis Adapter: Uncomment Redis sections in
rooms.js - Database: Add MongoDB/PostgreSQL for persistent storage
- Load Balancing: Use Redis for shared state across instances
- CDN: Serve static assets from CDN
- Open multiple browser tabs/windows
- Create a room in one tab
- Join the room from another tab
- Test real-time messaging
- Test voice chat (requires microphone permission)
- Test admin controls (kick/ban users)
- Chrome/Chromium (recommended for WebRTC)
- Firefox
- Safari
- Edge
# Build frontend
cd frontend
npm run build
# Start backend in production
cd backend
NODE_ENV=production npm startPORT=3000
NODE_ENV=production
RATE_LIMIT=100
# REDIS_URL=redis://your-redis-instance:6379# Backend Dockerfile
FROM node:18-alpine
WORKDIR /app
COPY backend/package*.json ./
RUN npm install
COPY backend/ .
EXPOSE 3000
CMD ["npm", "start"]- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
Voice chat not working:
- Ensure microphone permissions are granted
- Check browser WebRTC support
- Try refreshing the page
Connection issues:
- Check if backend server is running
- Verify CORS settings
- Check firewall/network settings
Room not appearing:
- Refresh the page
- Check if room was created successfully
- Verify search filters
Set NODE_ENV=development to enable detailed logging.
For issues and questions:
- Check the troubleshooting section
- Review the demo instructions in
demo.md - Check browser console for errors
- Verify all dependencies are installed
Chatrix - Real-time anonymous chatrooms. No signup required. Just chat! ๐ฌ