A modern full-stack web application for real-time chat with live sentiment analysis, built using React, TypeScript, Tailwind CSS, Socket.IO, and Node.js.
- 💬 Real-Time Messaging: Instant chat powered by Socket.IO.
- 😊 Sentiment Analysis: Each message is analyzed for positive, negative, or neutral sentiment.
- 📊 Live Mood Visualization: Interactive charts show sentiment distribution.
- 🖥️ Responsive UI: Beautiful, mobile-friendly design using Tailwind CSS.
- 🔒 Type Safety: Built with TypeScript on both client and server.
- ⚡ Fast & Modern Stack: Vite for frontend, Node.js for backend.
- Frontend: React, TypeScript, Tailwind CSS, Chart.js, Socket.IO-client
- Backend: Node.js, TypeScript, Socket.IO
- Visualization: Chart.js (Pie chart for sentiment)
- Styling: Tailwind CSS
real-time-chat/
├── client/ # React frontend
│ ├── src/
│ │ ├── Components/
│ │ ├── context/
│ │ ├── types/
│ │ └── index.css
│ ├── public/
│ └── ...
├── server/ # Node.js backend
│ ├── index.ts
│ ├── types/
│ └── ...
└── Readme.md
git clone https://github.com/devwithmohit/Real-time-Chat-Sentiment-Analysis.git
cd real-time-chatcd server
npm installcd ../client
npm installCreate a .env file in the client folder:
VITE_BACKEND_URL=http://localhost:3000
cd server
npm run devcd ../client
npm run devOpen http://localhost:5173 in your browser.
- Type messages in the chat box.
- See live sentiment analysis for each message.
- View mood distribution in the chart sidebar.
- client/src/Components/: UI components (Chatwindow, MessageInput, MoodPieChart)
- client/src/context/: React context for Socket.IO
- client/src/types/: TypeScript types
- server/: Node.js backend, Socket.IO server, sentiment analysis logic
- Change colors and fonts in
client/src/index.cssand Tailwind config. - Update sentiment analysis logic in
server/index.ts.
MIT
Mohit Singh Rawat