Skip to content

PRASHANTKUMAR-7/PulseTalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

145 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฌ PulseTalk โ€” Real-Time Chat & Video Calling App

๐Ÿš€ Built with the MERN stack โ€” because communication should be real-time, simple, and powerful.

PulseTalk is a full-stack real-time communication platform. Chat instantly, call face-to-face, get friend notifications, and even translate messages into 13+ languages โ€” all in one place.


๐Ÿ“š Table of Contents


โœจ Features

โœ… Already Built

  • ๐Ÿ” Secure signup and login with JWT and bcrypt
  • ๐Ÿ‘ฅ Send, accept, and manage friend requests
  • ๐Ÿ”” Real-time bell icon with unread notification count
  • ๐Ÿ’ฌ Instant 1-on-1 messaging via Stream Chat
  • ๐Ÿ“ž Face-to-face video calling via Stream Video
  • ๐ŸŒ Translate messages into 13+ languages instantly
  • ๐ŸŽจ Multiple UI themes via DaisyUI
  • ๐Ÿ“ฑ Fully responsive on mobile and desktop

โณ Coming Soon

  • ๐Ÿ‘ฅ Group video calls
  • ๐Ÿ“ File and image sharing in chat
  • โœ… Message seen / delivered status
  • ๐Ÿ”’ End-to-end encryption
  • ๐Ÿ›Ž๏ธ Push notifications
  • ๐Ÿณ Dockerized deployment

๐Ÿ› ๏ธ Tech Stack

๐Ÿ’ก New to some of these? Here is what each one does in plain English.

๐Ÿ–ฅ๏ธ Frontend

  • โš›๏ธ React.js โ€” builds all the UI components and pages you see on screen
  • ๐Ÿ”„ TanStack Query โ€” fetches data from backend smartly with caching and auto-refetching
  • ๐ŸŽจ Tailwind CSS + DaisyUI โ€” makes everything look beautiful without writing much CSS
  • ๐Ÿ’ฌ Stream Chat React โ€” ready-made chat UI components like message list and input box
  • ๐Ÿ–ผ๏ธ Lucide React โ€” clean icon library used throughout the app
  • ๐Ÿงญ React Router โ€” handles navigation between pages like Home, Chat, and Notifications

โš™๏ธ Backend

  • ๐ŸŸข Node.js โ€” runs JavaScript on the server
  • ๐Ÿš‚ Express.js โ€” creates all the API routes the frontend talks to
  • ๐Ÿƒ MongoDB + Mongoose โ€” stores all data including users, friend requests, and notifications
  • ๐Ÿ”‘ JWT + bcrypt โ€” keeps accounts secure by handling login tokens and password hashing
  • ๐Ÿ“ก Stream SDK โ€” powers real-time chat and video calling

๐Ÿ“ Project Structure

PulseTalk/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ backend/
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ controller/
โ”‚       โ”‚   โ”œโ”€โ”€ auth.controller.js            # ๐Ÿ” Signup, login, logout logic
โ”‚       โ”‚   โ”œโ”€โ”€ user.controller.js            # ๐Ÿ‘ฅ Friends and friend request logic
โ”‚       โ”‚   โ””โ”€โ”€ notification.controller.js    # ๐Ÿ”” Get, count, and mark notifications
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ models/
โ”‚       โ”‚   โ”œโ”€โ”€ user.js                       # ๐Ÿ‘ค User data shape in MongoDB
โ”‚       โ”‚   โ”œโ”€โ”€ FriendRequest.js              # ๐Ÿค Friend request data shape
โ”‚       โ”‚   โ””โ”€โ”€ Notification.js               # ๐Ÿ”” Notification data shape
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ routes/
โ”‚       โ”‚   โ”œโ”€โ”€ auth.route.js                 # /api/auth/*
โ”‚       โ”‚   โ”œโ”€โ”€ user.route.js                 # /api/users/*
โ”‚       โ”‚   โ”œโ”€โ”€ chat.route.js                 # /api/chat/*
โ”‚       โ”‚   โ””โ”€โ”€ notification.route.js         # /api/notifications/*
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ middleware/
โ”‚       โ”‚   โ””โ”€โ”€ auth.middleware.js            # ๐Ÿ›ก๏ธ Checks if user is logged in
โ”‚       โ”‚
โ”‚       โ””โ”€โ”€ ๐Ÿ“ lib/
โ”‚           โ”œโ”€โ”€ db.js                         # ๐Ÿƒ MongoDB connection setup
โ”‚           โ””โ”€โ”€ stream.js                     # ๐Ÿ“ก Stream Chat client setup
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ frontend/
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ pages/
โ”‚       โ”‚   โ”œโ”€โ”€ HomePage.jsx                  # ๐Ÿ  Friend discovery page
โ”‚       โ”‚   โ”œโ”€โ”€ ChatPage.jsx                  # ๐Ÿ’ฌ Main chat interface
โ”‚       โ”‚   โ”œโ”€โ”€ NotificationPage.jsx          # ๐Ÿ”” Friend requests and alerts
โ”‚       โ”‚   โ”œโ”€โ”€ LoginPage.jsx                 # ๐Ÿ”‘ Login form
โ”‚       โ”‚   โ””โ”€โ”€ SignUpPage.jsx                # ๐Ÿ“ Signup form
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ components/
โ”‚       โ”‚   โ”œโ”€โ”€ Navbar.jsx                    # ๐Ÿ” Top navigation bar with bell icon
โ”‚       โ”‚   โ”œโ”€โ”€ ChatHeader.jsx                # ๐Ÿ’ฌ Chat top bar with home and call buttons
โ”‚       โ”‚   โ”œโ”€โ”€ CustomMessage.jsx             # ๐ŸŒ Message bubble with translation support
โ”‚       โ”‚   โ”œโ”€โ”€ LanguageSelector.jsx          # ๐ŸŒ Floating language picker button
โ”‚       โ”‚   โ”œโ”€โ”€ CallButton.jsx                # ๐Ÿ“ž Video call trigger button
โ”‚       โ”‚   โ””โ”€โ”€ ThemeSelector.jsx             # ๐ŸŽจ UI theme switcher
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ hooks/
โ”‚       โ”‚   โ”œโ”€โ”€ useAuthUser.js                # ๐Ÿ‘ค Gets the current logged in user
โ”‚       โ”‚   โ”œโ”€โ”€ useNotifications.js           # ๐Ÿ”” Handles unread count and mark as read
โ”‚       โ”‚   โ””โ”€โ”€ useTranslation.js             # ๐ŸŒ All translation logic with caching
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ ๐Ÿ“ context/
โ”‚       โ”‚   โ””โ”€โ”€ TranslationContext.jsx        # ๐ŸŒ Shares language preference across app
โ”‚       โ”‚
โ”‚       โ””โ”€โ”€ ๐Ÿ“ lib/
โ”‚           โ”œโ”€โ”€ api.js                        # ๐Ÿ“ก All API call functions in one place
โ”‚           โ””โ”€โ”€ axios.js                      # โš™๏ธ Axios instance with base URL configured
โ”‚
โ””โ”€โ”€ ๐Ÿ“œ README.md

๐Ÿš€ Getting Started

โฑ๏ธ Follow these steps and you will have PulseTalk running in under 10 minutes.

๐Ÿ”ง Prerequisites

Make sure you have these installed on your machine:

๐Ÿ“ฅ Step 1 โ€” Clone the Project

git clone https://github.com/your-username/pulsetalk.git
cd pulsetalk

โš™๏ธ Step 2 โ€” Backend Setup

cd backend
npm install

Create a file named .env inside the backend/ folder and add:

PORT=5001
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET_KEY=any_long_random_string_here
STREAM_API_KEY=your_stream_api_key
STREAM_API_SECRET=your_stream_api_secret
NODE_ENV=development

๐Ÿ’ก Get your free Stream API keys at https://getstream.io โ€” takes 2 minutes to sign up.

Start the backend server:

nodemon server.js

You should see this in the terminal:

๐Ÿš€ Server is running on port 5001
โœ… Good to go! MongoDB connected successfully

๐ŸŽจ Step 3 โ€” Frontend Setup

cd ../frontend
npm install

Create a file named .env inside the frontend/ folder and add:

VITE_STREAM_API_KEY=your_stream_api_key_here

โš ๏ธ Only the API Key goes here. Never put the API Secret in the frontend! The VITE_ prefix is required by Vite to expose the variable to the browser.

Start the frontend:

npm run dev

๐ŸŽ‰ Visit http://localhost:5173 and PulseTalk is live!


๐ŸŒ Translation Feature

PulseTalk has a built-in real-time message translator powered by the free MyMemory API. No API key required โ€” works out of the box!

๐Ÿ“– How to Use

1. ๐Ÿ’ฌ Open any chat conversation
2. ๐ŸŒ Click the floating language button in the bottom right corner
3. ๐Ÿ—‚๏ธ Select your preferred language from the dropdown
4. โœจ All visible messages instantly translate
5. ๐Ÿ“จ New incoming messages auto-translate as well
6. ๐Ÿ‡ฌ๐Ÿ‡ง Select English to turn translation off

โšก Smart Optimizations Built In

  • ๐Ÿ”ญ Lazy loading โ€” only translates messages currently visible on screen
  • ๐Ÿ’พ Caching โ€” never calls the API for the same message twice
  • ๐Ÿ”„ Auto-reset โ€” switching language clears old translations cleanly
  • ๐Ÿ›ก๏ธ Fallback โ€” if translation fails, original message is shown instead
  • โŒ Abort on switch โ€” cancels in-flight API calls when language changes quickly

๐Ÿ—บ๏ธ Supported Languages

๐Ÿ‡ฎ๐Ÿ‡ณ Hindi      ๐Ÿ‡ช๐Ÿ‡ธ Spanish     ๐Ÿ‡ซ๐Ÿ‡ท French      ๐Ÿ‡ฉ๐Ÿ‡ช German
๐Ÿ‡จ๐Ÿ‡ณ Chinese    ๐Ÿ‡ธ๐Ÿ‡ฆ Arabic      ๐Ÿ‡ง๐Ÿ‡ท Portuguese  ๐Ÿ‡ท๐Ÿ‡บ Russian
๐Ÿ‡ฏ๐Ÿ‡ต Japanese   ๐Ÿ‡ฐ๐Ÿ‡ท Korean      ๐Ÿ‡ฎ๐Ÿ‡น Italian     ๐Ÿ‡ง๐Ÿ‡ฉ Bengali
๐Ÿ‡ต๐Ÿ‡ฐ Urdu

๐Ÿ”” Notification System

Here is exactly how the notification system works step by step:

๐Ÿ‘ค User A sends a friend request
        โ†“
๐Ÿ’พ Backend saves a Notification in MongoDB
        โ†“
๐Ÿ”” User B's bell icon polls for unread count every 10 seconds
        โ†“
๐Ÿ”ด Bell badge updates automatically showing the unread count
        โ†“
๐Ÿ‘† User B opens the Notification page
        โ†“
โœ… All notifications marked as read โ€” count resets to zero
        โ†“
๐Ÿ”„ Notifications persist after refresh because they live in the database

๐ŸŒ Deployment

Part Platform Status
๐Ÿ–ฅ๏ธ Frontend Vercel or Netlify โณ Coming Soon
โš™๏ธ Backend Render or Railway โณ Coming Soon
๐Ÿƒ Database MongoDB Atlas โœ… Ready

๐Ÿค Contributing

Contributions are always welcome! Here is how to get started:

# Step 1 โ€” Fork the project on GitHub

# Step 2 โ€” Create your feature branch
git checkout -b feature/your-feature-name

# Step 3 โ€” Make your changes and commit
git commit -m "โœจ Add your feature description here"

# Step 4 โ€” Push to your branch
git push origin feature/your-feature-name

# Step 5 โ€” Open a Pull Request on GitHub

๐Ÿ‘จโ€๐Ÿ’ป Developer

Prashant Kumar
MERN Stack Developer | DSA Enthusiast | Future FAANG Engineer

๐Ÿ“œ License

This project is licensed under the MIT License. See the LICENSE file for full details.


โญ If you found this project helpful, please give it a star on GitHub โ€” it means a lot!

๐Ÿ’ฌ Built with โค๏ธ by Prashant โ€” because communication should be real-time, simple, and powerful.

About

PulseTalk is a real-time chat and video calling app built with the MERN stack. It features instant messaging with Socket.IO, secure auth with JWT, peer-to-peer video calls via WebRTC, and a responsive React UI for seamless, modern communication.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages