Skip to content

A scalable real-time chat application built with React, Socket.IO, Redis, PostgreSQL, and Docker. It features user authentication, storage/retrieval of message from database, live messaging, and online/offline status tracking. Designed for responsiveness and ease of deployment, it is an ideal solution for real-time communication needs.

Notifications You must be signed in to change notification settings

inferio-2004/real-time-chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Chat Application

📝 Overview

A scalable real-time chat application built with modern technologies to provide live messaging, user authentication, and online/offline status tracking. Designed with a responsive UI and containerized for easy deployment.

🛠️ Features

  • Real-Time Messaging: Instant communication using WebSockets via Socket.IO.
  • User Authentication: Secure login and registration system.
  • Online Status Updates: Tracks user availability with Redis.
  • Persistent Chat History: Stores messages and conversation data in PostgreSQL.
  • Scalable and Portable: Dockerized for seamless deployment and scaling.
  • Enhanced User Experience: Includes chat search, unread message indicators, and a responsive interface.

📖 Tech Stack

  • Frontend: React, Chat UI Kit
  • Backend: Node.js, Express.js
  • Real-Time Communication: Socket.IO
  • Database: PostgreSQL
  • Caching and Status Management: Redis
  • Containerization: Docker

🚀 Getting Started

Prerequisites

  • Ensure you have the following installed:
    • Node.js
    • Docker
    • React

Installation

  1. Clone the Repository:
    git clone https://github.com/yourusername/real-time-chat-app.git
    cd real-time-chat-app
  2. Run the Docker:
    docker-compose up
  3. Start Backend:
    cd backend
    npm install
    npm start
  4. Start Frontend:
    cd frontend
    npm install
    npm start

📂 Project Structure

 root/
    ├── backend/
    │   ├── msg_db.js          # Database queries for messages
    │   ├── SocketServer.js    # Socket.IO server logic
    │   ├── server.js          # Express server setup
    │   ├── search.js          # Search functionality
    │   ├── login_register.js  # User login and registration
    │   ├── init.sql           # SQL file for database initialization
    │   ├── docker-compose.yaml # Docker Compose configuration
    ├── frontend/
    │   ├── src/
    │   │   ├── App.css        # Stylesheets
    │   │   ├── login.jsx      # Login page
    │   │   ├── home.jsx       # Home page contains the main app

⚙️ Endpoints

Api Routes

  • /api/login: logs in the user
  • /api/register: registers an user
  • /api/store: Store chat messages.
  • /api/retrieve: Retrieve chat history.
  • /api/prevchats: Fetch user’s recent chats.
  • /api/search: search an user

📸 Screenshots

Screenshot 2025-01-17 102949 Screenshot 2025-01-17 103001 Screenshot 2025-01-17 103247 Screenshot 2025-01-17 103304 Screenshot 2025-01-17 103346 Screenshot 2025-01-17 103359 Screenshot 2025-01-17 103417

🛠️ Future Improvements

  • Group chats and file sharing.
  • adding encryption for messages to improve security
  • Deployment on cloud platforms like AWS/GCP.

About

A scalable real-time chat application built with React, Socket.IO, Redis, PostgreSQL, and Docker. It features user authentication, storage/retrieval of message from database, live messaging, and online/offline status tracking. Designed for responsiveness and ease of deployment, it is an ideal solution for real-time communication needs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published