Skip to content

Harkit2004/chatapp-men-ejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatApp

A real-time chat application with video calling functionality built using Node.js, Socket.IO, MongoDB, and Agora RTC. This application allows users to create individual and group chats, send messages in real-time, and make video calls.

Features

  • User Authentication: Simple email-based login and signup system
  • Real-time Messaging: Instant message delivery using Socket.IO
  • Individual & Group Chats: Create private conversations or group chats with multiple users
  • Video Calling: Integrated video calling functionality using Agora RTC
  • Responsive Design: Modern UI built with Tailwind CSS and DaisyUI
  • Message History: Persistent message storage and retrieval
  • Session Management: Secure session handling with client-sessions

Tech Stack

Backend

  • Node.js - Server runtime
  • Express.js - Web framework
  • Socket.IO - Real-time bidirectional communication
  • MongoDB - Database for storing users, messages, and rooms
  • Mongoose - MongoDB object modeling
  • client-sessions - Session management

Frontend

  • EJS - Template engine
  • Tailwind CSS - Utility-first CSS framework
  • DaisyUI - Tailwind CSS component library
  • Socket.IO Client - Real-time communication
  • Agora RTC SDK - Video calling functionality

Installation

  1. Clone the repository

    git clone https://github.com/Harkit2004/chatapp-men-ejs.git
    cd chatapp-mem-ejs
  2. Install dependencies

    npm install
  3. Environment Configuration Create a .env file in the root directory:

    PORT=8080
    URI=mongodb://localhost:27017/chatapp
    SECRET=your-session-secret-key-here
  4. Start the application

    npm start
  5. Access the application Open your browser and navigate to http://localhost:8080

API Routes

Authentication Routes

  • GET / - Homepage
  • GET /login - Login page
  • POST /login - Process login
  • GET /signup - Signup page
  • POST /signup - Process signup
  • GET /logout - Logout user

User Routes (Protected)

  • GET /user - User dashboard with chat rooms
  • GET /user/chatRoom/:roomId - Individual chat room
  • GET /user/addContacts - Add contacts page
  • POST /user/addContacts - Create new room/group

Error Handling

  • GET /error - Error page with status and message

Socket.IO Events

Client to Server

  • chat-message - Send a new message
  • disconnect - User disconnects from chat

Server to Client

  • message-received - Receive new message
  • error - Error notification

Video Calling

The application integrates Agora RTC for video calling functionality. Features include:

  • Join/leave video calls
  • Toggle microphone on/off
  • Toggle camera on/off
  • Multiple participants support
  • Real-time video streaming

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published