RapidChat is a real-time chat application. It allows users to join chat rooms, send messages, and interact with other users in real-time. The application is built using React for the frontend and Go for the backend.
RapidChat leverages WebSocket technology for real-time communication between the client and server. WebSocket is a communication protocol that provides full-duplex communication channels over a single TCP connection. It enables interactive communication between a client and a server, allowing messages to be sent and received in real-time.
The frontend of RapidChat is built using React. The frontend communicates with the backend server using WebSocket to send and receive messages. The ChatSocket.js
file handles WebSocket communication with the server, allowing users to join chat rooms, send messages, and receive updates in real-time.
The backend of RapidChat is built using Go, a statically typed, compiled programming language. The backend server implements WebSocket functionality using the github.com/gorilla/websocket
package. It manages WebSocket connections, maintains chat rooms, and facilitates communication between clients.
-
WebSocket Server: The backend server establishes a WebSocket server using the
github.com/gorilla/websocket
package. It listens for incoming WebSocket connections from clients and manages these connections using a connection pool. -
Connection Pool: The backend maintains a connection pool to manage WebSocket connections from multiple clients. When a client connects to the server, its WebSocket connection is added to the connection pool. The server broadcasts messages to all clients in the pool, allowing real-time communication between users.
-
Message Handling: The backend server handles incoming messages from clients and broadcasts them to other clients in the same chat room. It also sends notifications to clients when users join or leave the chat room.
To run the RapidChat application locally, follow these steps:
- Clone the repository.
- Navigate to the
frontend
directory and runnpm install
to install dependencies. - Run
npm start
to start the frontend server. - Navigate to the
go-backend
directory and rungo run main.go
to start the backend server.
- Frontend: React, JavaScript, WebSocket
- Backend: Go, WebSocket
- Package Manager: npm/yarn (for frontend), Go modules (for backend)