Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mandar1045/videoChat

Repository files navigation

πŸŽ₯ YoChat - Realtime Video Chat App

YoChat Logo

A modern, feature-rich realtime chat application with integrated video calling capabilities. Built with the MERN stack and Socket.io for seamless communication.

Live Demo License

✨ Features

πŸ’¬ Realtime Messaging

  • Instant Messaging: Send and receive messages in real-time
  • Group Chats: Create and manage group conversations
  • Online Status: See who's online and available to chat
  • Message History: Persistent message storage with MongoDB
  • Typing Indicators: Know when someone is typing

πŸ“Ή Video Calling

  • HD Video Calls: Crystal-clear video communication
  • Audio Controls: Mute/unmute microphone and camera
  • Call Management: Initiate, accept, reject, or end calls
  • Peer-to-Peer: Direct connection for better performance

πŸ” Authentication & Security

  • JWT Authentication: Secure token-based authentication
  • Google OAuth: Sign in with Google account
  • Password Encryption: bcrypt hashing for security
  • Protected Routes: Secure API endpoints

🎨 Modern UI/UX

  • Responsive Design: Works perfectly on desktop and mobile
  • Dark/Light Themes: Toggle between themes
  • Beautiful Components: DaisyUI component library
  • Loading States: Skeleton loaders and smooth transitions
  • Error Handling: Comprehensive error management

πŸ‘€ User Management

  • Profile Management: Customize your profile with avatars
  • User Search: Find and connect with other users
  • Avatar Upload: Cloudinary integration for image storage

πŸ› οΈ Tech Stack

Frontend

  • React 18 - Modern React with hooks
  • Vite - Lightning-fast build tool
  • Tailwind CSS - Utility-first CSS framework
  • DaisyUI - Beautiful component library
  • Zustand - Simple state management
  • Socket.io-client - Realtime communication

Backend

  • Node.js - JavaScript runtime
  • Express.js - Robust web framework
  • MongoDB - NoSQL database
  • Socket.io - Bidirectional communication
  • JWT - Secure authentication
  • Cloudinary - Media storage

πŸš€ Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB (local or Atlas)
  • npm or yarn

Installation

  1. Clone the repository

    git clone https://github.com/mandar1045/videoChat.git
    cd yochat
  2. Install dependencies

    npm install
  3. Environment Setup

    Create .env files in both backend/ and frontend/ directories:

    backend/.env

    MONGODB_URI=your_mongodb_connection_string
    PORT=5001
    JWT_SECRET=your_jwt_secret_key
    CLOUDINARY_CLOUD_NAME=your_cloudinary_name
    CLOUDINARY_API_KEY=your_cloudinary_api_key
    CLOUDINARY_API_SECRET=your_cloudinary_secret
    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret
    NODE_ENV=development

    frontend/.env

    VITE_API_URL=http://localhost:5001
    VITE_CLOUDINARY_CLOUD_NAME=your_cloudinary_name
  4. Start the development servers

    Terminal 1 - Backend:

    cd backend
    npm run dev

    Terminal 2 - Frontend:

    cd frontend
    npm run dev
  5. Open your browser

    http://localhost:5173
    

πŸ“ Project Structure

yochat/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/     # API route handlers
β”‚   β”‚   β”œβ”€β”€ lib/            # Database, Socket, Cloudinary utils
β”‚   β”‚   β”œβ”€β”€ middleware/     # Authentication middleware
β”‚   β”‚   β”œβ”€β”€ models/         # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ routes/         # API endpoints
β”‚   β”‚   └── seeds/          # Database seeders
β”‚   └── package.json
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/            # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/         # Application pages
β”‚   β”‚   β”œβ”€β”€ store/         # Zustand state stores
β”‚   β”‚   β”œβ”€β”€ lib/           # Utility functions
β”‚   β”‚   └── constants/     # App constants
β”‚   └── package.json
└── package.json          # Root build scripts

πŸ”§ Build for Production

# Build the entire application
npm run build

# Start production server
npm start

🌐 API Endpoints

Method Endpoint Description
POST /api/auth/signup User registration
POST /api/auth/login User login
GET /api/messages/:userId Get chat messages
POST /api/messages/send/:userId Send message
GET /api/groups Get user groups
POST /api/groups Create group

πŸ“‘ Socket Events

Client β†’ Server

  • sendMessage - Send a message
  • startCall - Initiate video call
  • acceptCall - Accept incoming call
  • endCall - End current call

Server β†’ Client

  • newMessage - Receive new message
  • incomingCall - Incoming call notification
  • callAccepted - Call accepted
  • getOnlineUsers - Online users list

🀝 Contributing

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

πŸ“ License

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

πŸ™ Acknowledgments

πŸ“ž Support

If you have any questions or need help, feel free to open an issue or contact the maintainers.


Made with ❀️ by mandar1045

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published