Skip to content

codersandip/talka-tive-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Talk-A-Tive β€” Real-Time Chat Application

A full-stack real-time chat app with a premium modern UI, built with React, Node.js, Socket.io, and MongoDB.


✨ Features

Feature Status
Real-Time Messaging (Socket.io) βœ…
One-to-One Private Chat βœ…
Group Chat (Create / Manage) βœ…
JWT Authentication (Login / Register) βœ…
Online / Offline Presence Indicators βœ…
Typing Indicators βœ…
Read Receipts (Mark as Read) βœ…
Message Reactions (Emoji) βœ…
File Sharing (Image, Video, Audio, Document) βœ…
Drag & Drop File Upload βœ…
Image Lightbox (Zoom, Rotate, Download) βœ…
Message Search within Chat βœ…
Dark / Light Theme Toggle βœ…
Custom Avatar Upload βœ…
User Profile Modal βœ…
Responsive Collapsible Sidebar βœ…
Docker Ready βœ…

πŸ›  Tech Stack

Layer Technology
Frontend React 18 (Vite), React Router v6
Backend Node.js, Express
Real-Time Socket.io
Database MongoDB (Mongoose ODM)
Auth JWT + bcryptjs
File Uploads Multer (local storage, up to 100MB)
Styling Vanilla CSS (Design tokens, glassmorphism)
DevOps Docker + Docker Compose
Scaling Redis + @socket.io/redis-adapter

πŸ“‚ Project Structure

Chat/
β”œβ”€β”€ client/                   # React Frontend
β”‚   └── src/
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ Authentication/  # Login, Signup, ProfileModal
β”‚       β”‚   └── Chat/            # SingleChat, ChatList, SideDrawer
β”‚       β”œβ”€β”€ Context/             # ChatProvider (global state)
β”‚       β”œβ”€β”€ Pages/               # HomePage, ChatPage
β”‚       └── App.css              # Global design system
β”œβ”€β”€ server/                   # Node.js Backend
β”‚   β”œβ”€β”€ config/               # DB + Redis config
β”‚   β”œβ”€β”€ middleware/            # auth.js, upload.js
β”‚   β”œβ”€β”€ models/               # User, Chat, Message
β”‚   β”œβ”€β”€ routes/               # auth, chat, message, user
β”‚   β”œβ”€β”€ socket/               # Socket.io event handlers
β”‚   └── server.js
β”œβ”€β”€ doc/                      # Project documentation
β”œβ”€β”€ docker-compose.yml
└── README.md

🏁 Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB (local or Atlas)
  • Redis (optional for local dev)
  • Docker (optional)

Installation

  1. Clone the repository
  2. Install Server Dependencies
    cd server
    npm install
  3. Install Client Dependencies
    cd client
    npm install

Running Locally

  1. Start the Backend
    cd server
    npm run dev
  2. Start the Frontend
    cd client
    npm run dev
    Frontend runs on: http://localhost:5173
    Backend runs on: http://localhost:5000

Running with Docker

docker-compose up -d --build

πŸ” Environment Variables

Create a .env file in the server directory:

PORT=5000
MONGO_URI=mongodb://localhost:27017/chat_app
JWT_SECRET=your_secret_key_here
REDIS_URL=redis://localhost:6379
CLIENT_URL=http://localhost:5173

πŸ“‘ API Endpoints

Method Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Login and get JWT
GET /api/user Search users
PUT /api/user/profile Update avatar
POST /api/chat Access/create 1-to-1 chat
GET /api/chat Fetch all chats
POST /api/chat/group Create group chat
PUT /api/chat/rename Rename group
PUT /api/chat/groupadd Add user to group
PUT /api/chat/groupremove Remove user from group
GET /api/message/:chatId Fetch messages
POST /api/message Send message (with optional file)
PUT /api/message/:chatId/read Mark messages as read
POST /api/message/reaction Add/remove emoji reaction

πŸ”Œ Socket.io Events

Event Direction Description
setup Client β†’ Server Register user, join personal room
join chat Client β†’ Server Join a chat room
new message Client β†’ Server Broadcast new message
message recieved Server β†’ Client Receive new message
typing Client β†’ Server User is typing
stop typing Client β†’ Server User stopped typing
read_message Client β†’ Server Mark chat as read
message_read_update Server β†’ Client Sync read status
message_reaction Client β†’ Server Send emoji reaction
reaction_update Server β†’ Client Sync reaction changes
user_online Server β†’ Client User came online
user_offline Server β†’ Client User went offline

πŸ”’ Security

  • Password hashing with bcrypt
  • JWT token-based route protection
  • Auth guard β€” unauthenticated users are redirected to login
  • File type validation (MIME type + extension)
  • 100MB file size limit enforced server-side
  • CORS restriction to trusted origin

πŸ‘¨β€πŸ’» Author

Sandip Tawhare β€” Full Stack Developer


⭐ If You Like This Project

Give it a star ⭐ and feel free to fork!

About

πŸ’¬ Real-time chat app built with React, Node.js, Socket.io & MongoDB β€” supports group chats, file sharing, emoji reactions, read receipts, and dark/light theme.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages