Skip to content

ar-rana/ChatApp-2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChatApp-2.0

ChatApp-2.0 is a real-time chat application built with modern technologies to deliver fast and scalable messaging features. The frontend is built on Next.js (v14) with TypeScript, utilizing OAuth (Google) for authentication, while the backend architecture is powered by TypeScript, Express, Socket.io for real-time WebSocket connections, Redis for PUB-SUB messaging, Kafka for message queuing, and PostgreSQL for data persistence.

Features

  • Real-time messaging: Enables real-time communication using WebSockets.
  • Private rooms: Users can create private rooms, visible only to the creator.
  • Public rooms: Open rooms visible to all users.
  • OAuth (Google) Authentication: Secure login with Google.
  • Scalable architecture: The backend leverages Redis for PUB-SUB communication across WebSocket servers, Kafka for message queuing, and PostgreSQL for database storage.
  • Dockerized Services: Zookeeper, Kafka, and Redis are containerized using Docker.

Technologies Used

Frontend

  • Next.js v14
  • TypeScript
  • OAuth (Google) for Authentication

Backend

  • Socket.io: WebSocket connections for real-time messaging.
  • Redis: PUB-SUB model for communication between WebSocket servers.
  • Kafka: Message queue to manage and offload messages to the database.
  • PostgreSQL: Relational database for message storage.
  • Docker: Containers for Redis, Kafka, and Zookeeper.

Architecture

image

Prerequisites to Run on local Machine

  • Docker: Make sure Docker is installed and running on your machine.
  • Node.js: Ensure Node.js is installed (v16 or higher recommended).
  • PostgreSQL: Running as the main database (via Docker or locally).

Getting Started

1. Clone the repository

git clone https://github.com/ar-rana/ChatApp-2.0.git
cd ChatApp-2.0

2. SetUp Environment Variable

GOOGLECLIENT_ID
GOOGLECLIENT_SECRET

3. Install Dependencies

for server:

cd server
npm install

for client

cd client
npm install

4. Start Docker Containers

docker-compose up

5. Start The Project

for client - (will be running on localhost:3000)

npm run dev

for server - (will be running on localhost:8000)

npm run dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages