A Next-Gen Distributed & Real-Time Chat Platform
ChatFlux is a cutting-edge chat application designed for real-time, resilient, and highly scalable messaging. Built with a modern tech stack, it delivers instant communication, high-throughput event streaming, and efficient data persistenceβperfect for small teams or large-scale enterprise platforms.
Layer | Technology |
---|---|
Backend | Express.js, Socket.IO, Redis, Kafka, ZooKeeper, MongoDB |
Frontend | Svelte |
DevOps | Docker, Node.js |
ChatFlux leverages a distributed system architecture:
git clone https://github.com/your-username/ChatFlux.git
cd ChatFlux
npm install
cd public && npm install
docker run -p 27017:27017 mongo
docker run -p 2181:2181 zookeeper
docker run -p 6379:6379 redis/redis-stack-server:latest
docker run -p 9092:9092 \
-e KAFKA_ZOOKEEPER_CONNECT=<YOUR_LOCAL_IP>:2181 \
-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://<YOUR_LOCAL_IP>:9092 \
-e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
confluentinc/cp-kafka
# API Settings
WEB_API_PORT=8000
WEB_API_ALLOWED_ORIGIN=["http://localhost:5173", "http://127.0.0.1:5173"]
# Database
MONGO_CONNECT_STRING="mongodb://127.0.0.1:27017/chatflux-db"
# Socket.IO
SOCKET_ALLOWED_ORIGIN=["http://localhost:5173", "http://127.0.0.1:5173"]
# Redis
REDIS_CHANNEL="redis-message-channel"
# Kafka
KAFKA_GROUP_ID="chatflux-group"
KAFKA_BROKERS="<YOUR_LOCAL_IP>:9092"
PROCESS_KAFKA_MESSAGE_LIMIT=100
KAFKA_TOPIC="chat-updates"
KAFKA_NO_OF_PARTITIONS=1
node ./app/kafka/KafkaAdmin.js
node KafkaConsumerRunner.js
node index.js
node ./app/Jobs/cron.js
cd ./public && npm run dev
ChatFlux/ βββ README.md βββ package.json βββ prisma/ βββ public/ β βββ auth/ β βββ chat/ βββ src/ β βββ config/ β βββ controllers/ β βββ middlewares/ β βββ routes/ β βββ service/ β βββ utils/
We β€οΈ contributions! Follow these steps to get started:
Fork the repository
Click the Fork button at the top-right corner of the repository page.
Create a feature branch
```bash
git checkout -b feature/YourFeature
This project is licensed under the MIT License.
See the LICENSE file for more details.
For any questions, issues, or suggestions, feel free to reach out:
We are happy to help and welcome your feedback!