Chatterly is a scalable, real-time chat application built with modern technologies including Socket.io, Kafka, Redis, Postgres, and Next.js. This project demonstrates a robust architecture for handling multiple users with efficient message brokering and data storage.
- Real-time messaging with Socket.io
- Scalable message brokering using Kafka
- Efficient caching with Redis
- Persistent message storage in Postgres
- Frontend built with Next.js and TypeScript
- Node.js (v22 or higher)
- PostgreSQL
- Redis
- Kafka
- Yarn or npm
-
Clone the repository:
git clone https://github.com/shivamxverma/chatterly.git cd chatterly -
Install dependencies:
yarn install # or npm install -
Set up environment variables: Create a
.env.localfile in the root directory and add the following:DATABASE_URL=postgresql://user:password@localhost:5432/chatterly REDIS_URL=redis://localhost:6379 KAFKA_BROKERS=localhost:9092 NEXT_PUBLIC_SOCKET_IO_URL=http://localhost:3000
-
Set up the database:
npx prisma migrate dev --name init
-
Start the Kafka server and ensure Redis and Postgres are running.
-
Start the development server:
yarn dev # or npm run dev -
Open your browser and navigate to
http://localhost:3000.
- Next.js: React framework for server-side rendering and static site generation
- TypeScript: Type-safe JavaScript
- Socket.io: Real-time bidirectional communication
- Kafka: Distributed message brokering
- Redis: In-memory caching
- Postgres: Relational database for persistent storage
- Prisma: ORM for database management
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m "Add your feature"). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Inspired by modern chat applications
- Built with guidance from web development tutorials and best practices