Skip to content

krishiv274/Huddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Huddle - Real-Time Chat Application

Huddle Logo

React Node.js Socket.io MongoDB TailwindCSS License


πŸ“‹ Overview

Huddle is a modern, real-time chat application built with the MERN stack (MongoDB, Express.js, React, Node.js) and Socket.io. It offers a sleek, responsive design with real-time messaging, online user tracking, media sharing, and a beautiful glassmorphism UI.

✨ Key Features

  • πŸ” Secure Authentication - JWT-based login/signup system
  • πŸ’¬ Real-Time Messaging - Instant messaging with Socket.io
  • πŸ‘₯ Online Status - See who's online in real-time
  • πŸ“Έ Media Sharing - Share images seamlessly
  • 🎨 Modern UI/UX - Glassmorphism design with smooth animations
  • πŸ“± Fully Responsive - Works perfectly on all devices
  • πŸ”” Message Notifications - Unread message counters
  • πŸ‘€ Profile Management - Update profile pictures and bio
  • πŸ” User Search - Find users quickly with search functionality

πŸ› οΈ Tech Stack

Frontend

  • React 19.0.0 - Modern UI library
  • TailwindCSS 4.1.4 - Utility-first CSS framework
  • Vite - Fast build tool and development server
  • React Router DOM - Client-side routing
  • Socket.io Client - Real-time communication
  • Axios - HTTP client for API calls
  • React Hot Toast - Beautiful notifications

Backend

  • Node.js - JavaScript runtime
  • Express.js 5.1.0 - Web application framework
  • Socket.io 4.8.1 - Real-time bidirectional communication
  • MongoDB - NoSQL database
  • Mongoose - MongoDB object modeling
  • JWT - Secure authentication tokens
  • Bcrypt - Password hashing
  • Cloudinary - Media storage and optimization
  • CORS - Cross-origin resource sharing

πŸš€ Quick Start

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or cloud instance)
  • Cloudinary account (for image uploads)

Installation

  1. Clone the repository

    git clone https://github.com/krishiv274/Huddle.git
    cd Huddle
  2. Install server dependencies

    cd server
    npm install
  3. Install client dependencies

    cd ../client
    npm install
  4. Environment Setup

    Create .env file in the server directory:

    PORT=5002
    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret_key
    CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
    CLOUDINARY_API_KEY=your_cloudinary_api_key
    CLOUDINARY_API_SECRET=your_cloudinary_api_secret

    Create .env file in the client directory:

    VITE_BACKEND_URL=http://localhost:5002
  5. Start the application

    Terminal 1 - Start the server:

    cd server
    npm run server

    Terminal 2 - Start the client:

    cd client
    npm run dev
  6. Open your browser

    http://localhost:5173
    

πŸ“± Features Walkthrough

πŸ”‘ Authentication System

  • Sign Up: Create account with email, full name, and bio
  • Login: Secure login with JWT token authentication
  • Password Security: Bcrypt hashing for password protection

πŸ’¬ Real-Time Chat

  • Instant Messaging: Send and receive messages in real-time
  • Message Status: See if messages are delivered and seen
  • Typing Indicators: Know when someone is typing
  • Message History: Access previous conversations

πŸ‘₯ User Management

  • Online Status: Green indicator for online users
  • User Search: Find users by name with search functionality
  • Profile Pictures: Upload and display custom avatars
  • User Profiles: View user bio and information

πŸ“Έ Media Features

  • Image Sharing: Upload and share images instantly
  • Media Gallery: View all shared media in conversations
  • Image Preview: Click to view images in full size
  • Cloudinary Integration: Optimized image storage and delivery

🎨 UI/UX Features

  • Glassmorphism Design: Modern glass-like interface
  • Smooth Animations: Fluid transitions and hover effects
  • Responsive Layout: Perfect on desktop, tablet, and mobile
  • Dark Theme: Easy on the eyes with dark mode aesthetics
  • Custom Scrollbars: Stylized scroll bars for better UX

πŸ“ Project Structure

Huddle/
β”œβ”€β”€ client/                 # React frontend
β”‚   β”œβ”€β”€ public/            # Static files
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/        # Images and icons
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatContainer.jsx
β”‚   β”‚   β”‚   └── RightSidebar.jsx
β”‚   β”‚   β”œβ”€β”€ context/       # React contexts
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   β”‚   └── ChatContext.jsx
β”‚   β”‚   β”œβ”€β”€ pages/         # Main pages
β”‚   β”‚   β”‚   β”œβ”€β”€ HomePage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginPage.jsx
β”‚   β”‚   β”‚   └── ProfilePage.jsx
β”‚   β”‚   β”œβ”€β”€ lib/           # Utility functions
β”‚   β”‚   └── App.jsx        # Main app component
β”‚   └── package.json
β”œβ”€β”€ server/                # Node.js backend
β”‚   β”œβ”€β”€ controllers/       # Request handlers
β”‚   β”‚   β”œβ”€β”€ userController.js
β”‚   β”‚   └── messageController.js
β”‚   β”œβ”€β”€ middleware/        # Custom middleware
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ models/           # Database models
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   └── Message.js
β”‚   β”œβ”€β”€ routes/           # API routes
β”‚   β”‚   β”œβ”€β”€ userRoutes.js
β”‚   β”‚   └── messageRoutes.js
β”‚   β”œβ”€β”€ lib/              # Utility functions
β”‚   β”‚   β”œβ”€β”€ db.js
β”‚   β”‚   β”œβ”€β”€ utils.js
β”‚   β”‚   └── cloudinary.js
β”‚   β”œβ”€β”€ server.js         # Main server file
β”‚   └── package.json
└── README.md

πŸ”— API Endpoints

Authentication Routes

POST /api/auth/signup     # User registration
POST /api/auth/login      # User login
GET  /api/auth/check      # Check authentication
PUT  /api/auth/update-profile # Update user profile

Message Routes

GET  /api/messages/users         # Get all users for sidebar
GET  /api/messages/:id           # Get messages with specific user
POST /api/messages/send/:id      # Send message to user
PUT  /api/messages/mark/:id      # Mark message as seen

🌟 Screenshots

Login Page

Beautiful animated login interface with glassmorphism design.

Main Chat Interface

Three-panel layout with user list, chat area, and user profile.

Profile Management

Easy profile editing with image upload functionality.


πŸš€ Deployment

Frontend (Vercel)

  1. Connect your GitHub repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Backend (Vercel/Heroku)

  1. Create production environment variables
  2. Update CORS settings for production URL
  3. Deploy using platform-specific instructions

Database (MongoDB Atlas)

  1. Create cluster on MongoDB Atlas
  2. Whitelist IP addresses
  3. Update connection string in environment variables

🀝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add some amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Add comments for complex logic
  • Test your changes thoroughly
  • Update documentation as needed

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘€ Author

Krishiv


πŸ™ Acknowledgments

  • Thanks to the React and Node.js communities
  • Socket.io for real-time communication
  • TailwindCSS for the amazing utility-first approach
  • Cloudinary for image management
  • MongoDB for the flexible database solution

πŸ“§ Support

If you have any questions or need support, please:

  1. Check the Issues page
  2. Create a new issue if your question isn't answered
  3. Contact the author directly

⭐ If you found this project helpful, please give it a star! ⭐

Made with ❀️ by Krishiv

About

A quick chat app "Huddle"

Resources

Stars

Watchers

Forks

Contributors

Languages