Chatties is a scalable and feature-rich real-time chat application built with PERN Stack (PostgreSQL, Express, React, Node.js) and Drizzle ORM. It leverages Redis Pub/Sub and Kafka to ensure smooth and efficient real-time messaging across multiple instances. The app includes essential chat functionalities such as online status, message alerts, group chats, file uploads, and a fully responsive UI with light/dark mode.
- Instant messaging using WebSockets (Socket.io)
- Read receipts and delivery statuses
- Typing indicators
- One-on-one private chats
- Group conversations with role-based permissions
- Pinned messages and chat muting
- Redis Pub/Sub for multi-instance synchronization
- Kafka Integration for high-throughput message processing
- Drizzle ORM for efficient database handling
- Optimized queries for high-speed data retrieval
- Live user status (Online/Offline)
- Real-time notifications for messages
- Image, video, and document uploads
- Drag & drop support for easy file sharing
- Fully responsive and mobile-friendly design
- Light/Dark mode with theme persistence
- Keyboard accessibility for improved usability
- JWT-based authentication for secure login
- OAuth support (Google, GitHub, etc.)
- End-to-end encryption for private messages (future feature)
- React (Vite/Next.js optional)
- Tailwind CSS for styling
- Redux Toolkit for state management
- Node.js + Express.js
- PostgreSQL (Drizzle ORM for database management)
- Redis for caching and Pub/Sub messaging
- Kafka for message queue management
- Socket.io for real-time communication
- Vercel for frontend hosting
- NeonDB for database hosting
- CI/CD integration with GitHub Actions -render for backend
Chatties now utilizes a single Kafka consumer that subscribes to both chat-messages
and group-messages
topics, ensuring efficient processing without redundant subscriptions. The consumer:
- Listens to messages from both chat and group topics.
- Processes messages and updates the database accordingly.
- Publishes updates to Redis for real-time UI updates.
- Efficiently increments unread message count for other users.
- Scalability: Handles large volumes of messages seamlessly.
- Fault Tolerance: Ensures messages are processed even if an instance fails.
- Decoupled Architecture: Allows independent scaling of consumers and producers.
- Optimized Database Writes: Reduces redundant queries, improving performance.
-
Clone the repository:
git clone https://github.com/your-username/chatties.git cd chatties
-
Install dependencies:
npm install # or yarn install
-
Set up environment variables: (Create a
.env
file and configure your variables)DATABASE_URL=your_postgresql_url REDIS_URL=your_redis_url KAFKA_BROKER=your_kafka_broker_url JWT_SECRET=your_jwt_secret
-
Run the backend server:
cd server npm run dev
-
Start the Kafka consumer:
npm run consume
-
Start the frontend app:
cd client npm run dev
-
Access the application: Open http://localhost:3000 in your browser.
- End-to-End Encryption for private chats to enhance security.
- Video & Voice Calls using WebRTC for real-time audio/video communication.
- AI-based smart reply suggestions.
- Push Notifications for web & mobile alerts.
- Admin Dashboard for chat moderation and user management.
- Sentiment Analysis for content moderation.
- Message Auditing for compliance and security.
⚡ Happy Chatting with Chatties! 🚀