A real-time multi-room chat application built with React, Socket.IO, and Express. Users can join different chat rooms and send messages instantly, with chat history maintained per room.
- Multiple chat rooms (e.g., general, tech, sports)
- Real-time messaging powered by WebSockets (Socket.IO)
- Chat history for each room
- Room selection UI similar to Slack
- Frontend hosted on GitHub Pages
- Backend API deployed on Render
Frontend: React, TypeScript, Vite, Socket.IO-client
Backend: Node.js, Express, Socket.IO
Frontend: GitHub Pages (Live Demo)
Backend: Render (https://realtimechatbot.onrender.com)
Node.js (v16+ recommended)
npm or yarnClone the repository:
git clone https://github.com/laurenncasey/RealTimeChatBot.git
cd RealTimeChatBotBackend
cd chat-backend
npm install
npm run devThe backend will start on http://localhost:5713
Frontend
In a separate terminal:
cd chat-frontend
npm install
npm run devThe frontend will start on http://localhost:5173
Frontend (GitHub Pages)
Build and deploy the frontend:
npm run deploy --prefix chat-frontendThis publishes the static files to the gh-pages branch.
Backend (Render)
The backend is deployed on Render. To deploy, push your code to your Render-linked repo and configure start command as:
npm startOpen the frontend in a browser: https://laurenncasey.github.io/RealTimeChatBox/
Select a chat room on the left sidebar
Type messages and hit enter or click send
Messages appear in real time for all users in the room
Make sure the frontend connects to the correct backend URL (Render URL) in production.
Environment variables or conditional logic are used to switch backend URLs between local dev and production.