Skip to content

MeegadaVamsidhar/Real-Time-Chat-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ChatFlow πŸ’¬

A modern, full-featured real-time chat application built with the MERN stack (MongoDB, Express, React, Node.js). It features secure user authentication, real-time messaging with Socket.io, group chats, and a beautiful UI.

React Node.js Express MongoDB Socket.io TailwindCSS License

✨ Features

πŸ” Authentication & Security

  • JWT Authentication - Secure login and registration
  • Password Hashing - bcrypt for secure password storage
  • Profile Management - Update user details and avatar
  • Secure Cookies - HTTP-only cookies for token storage

πŸ’¬ Real-time Messaging

  • Instant Messaging - Powered by Socket.io
  • Typing Indicators - See when others are typing
  • Online Status - Real-time online/offline status
  • Read Receipts - Know when messages are read
  • One-to-One Chats - Private direct messages
  • Group Chats - Multi-user conversations

🎨 UI/UX

  • Modern Design - Clean interface with TailwindCSS
  • Responsive - Works on mobile, tablet, and desktop
  • Toast Notifications - Real-time alerts for actions
  • Loading States - Smooth skeletons and spinners

πŸš€ Tech Stack

Frontend

Backend

πŸ“‹ Prerequisites

  • Node.js (v14.x or higher)
  • npm or yarn
  • MongoDB (Local or Atlas)

πŸ› οΈ Installation & Setup

🚨 Security Note: This project relies on environment variables for sensitive configuration (Database connections, Secrets). The .env files are ignored by git to protect your security. Never commit your .env files to version control.

1. Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Create .env file
# Copy the example or create new one with:
# PORT=5000
# MONGODB_URI=your_mongodb_connection_string
# JWT_SECRET=your_secret_key
# CLIENT_URL=http://localhost:3000

# Start the server
npm run dev

2. Frontend Setup

# Navigate to Frontend directory
cd Frontend

# Install dependencies
npm install

# Create .env file
# REACT_APP_API_URL=http://localhost:5000/api
# REACT_APP_SOCKET_URL=http://localhost:5000

# Start the application
npm start

Access the application at http://localhost:3000

πŸ“ Project Structure

chat/
β”œβ”€β”€ backend/                # Node.js/Express Backend
β”‚   β”œβ”€β”€ config/            # Database config
β”‚   β”œβ”€β”€ controllers/       # Route controllers
β”‚   β”œβ”€β”€ middleware/        # Auth & Error middleware
β”‚   β”œβ”€β”€ models/            # Mongoose models
β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   β”œβ”€β”€ socket/            # Socket.io logic
β”‚   └── server.js          # Entry point
β”‚
β”œβ”€β”€ Frontend/               # React Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # UI Components
β”‚   β”‚   β”œβ”€β”€ context/       # React Context (Auth)
β”‚   β”‚   β”œβ”€β”€ pages/         # Page Components
β”‚   β”‚   β”œβ”€β”€ services/      # API & Socket services
β”‚   β”‚   β”œβ”€β”€ styles/        # Global styles
β”‚   β”‚   └── utils/         # Helper functions
β”‚   β”œβ”€β”€ public/            # Static assets
β”‚   └── package.json
β”‚
└── README.md

πŸ—ΊοΈ Routes

Route Component Description
/login UserLogin Sign in to account
/register UserRegistration Create new account
/chat-dashboard ChatDashboard Main chat interface
/new-chat NewChatCreation Start new conversation
/settings UserProfileSettings Manage profile

🚦 Available Scripts

Frontend

  • npm start - Runs the app in development mode
  • npm run build - Builds the app for production

Backend

  • npm run dev - Runs server with Nodemon
  • npm start - Runs server in production mode

βœ… Completed Enhancements

  • Backend Integration - Connected to Express/MongoDB
  • Real-time Messaging - Socket.io integration
  • Database - MongoDB integration
  • Authentication - JWT token-based auth
  • State Management - Context API for Auth

🀝 Contributing

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

πŸ“„ License

This project is licensed under the MIT License.

About

A full-stack real-time chat application built using the MERN stack and Socket.io. Supports instant messaging, user authentication, chat history storage, and a clean responsive UI. Implements WebSocket-based communication for fast, seamless, real-time interactions.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors