Skip to content

elyse502/quick-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

77 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QUICK-CHAT πŸ’¬

Real-Time Messaging, Instant Connections

Last Commit Languages License

Powered by cutting-edge technologies:

Socket.io React Node.js MongoDB Vite JWT

LIVE - DEMO 🌐

Visit the πŸ‘‰ LINK πŸ”—




Table of Contents


Overview

Quick-Chat is a full-stack real-time chat application that enables instant messaging with features like:

  • πŸ” Secure user authentication
  • ⚑ Real-time message delivery
  • πŸ‘₯ User profiles and status
  • πŸ“± Responsive design for all devices
  • πŸ”„ Message history persistence
  • πŸ”Š Notification system

Built with modern web technologies to deliver a seamless chatting experience.


Key Features

Real-Time Communication

  • Instant message delivery with Socket.io
  • Typing indicators
  • Online/offline status
  • Read receipts

User Experience

  • Clean, modern interface
  • Responsive design
  • Dark/light mode
  • Emoji support
  • Message search

Security

  • JWT authentication
  • Password encryption
  • Protected routes
  • Session management

Advanced Functionality

  • Message history
  • User profiles
  • Notification system
  • Image/file sharing (via Cloudinary)

Tech Stack

Frontend

  • React with Vite
  • Socket.io-client for real-time updates
  • Context API for state management
  • Axios for HTTP requests
  • Tailwind CSS for styling
  • React Icons for beautiful icons

Backend

  • Node.js with Express
  • Socket.io for WebSocket communication
  • MongoDB with Mongoose
  • JWT for authentication
  • Bcrypt for password hashing
  • Cloudinary for media storage

DevOps

  • Vercel for frontend hosting
  • Render for backend hosting
  • GitHub Actions for CI/CD

Project Structure

quick-chat/
β”œβ”€β”€ client/                  # Frontend application
β”‚   β”œβ”€β”€ public/             # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/         # Images, icons
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatContainer.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   └── RightSidebar.jsx
β”‚   β”‚   β”œβ”€β”€ context/        # Global state
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   β”‚   └── ChatContext.jsx
β”‚   β”‚   β”œβ”€β”€ lib/            # Utilities
β”‚   β”‚   β”‚   └── utils.js
β”‚   β”‚   β”œβ”€β”€ pages/          # Route pages
β”‚   β”‚   β”‚   β”œβ”€β”€ HomePage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginPage.jsx
β”‚   β”‚   β”‚   └── ProfilePage.jsx
β”‚   β”‚   └── ...             # Other config files
β”‚
β”œβ”€β”€ server/                 # Backend application
β”‚   β”œβ”€β”€ controllers/        # Business logic
β”‚   β”‚   β”œβ”€β”€ messageController.js
β”‚   β”‚   └── userController.js
β”‚   β”œβ”€β”€ lib/                # Utilities
β”‚   β”‚   β”œβ”€β”€ cloudinary.js
β”‚   β”‚   β”œβ”€β”€ db.js
β”‚   β”‚   └── utils.js
β”‚   β”œβ”€β”€ middleware/         # Auth middleware
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ models/             # Database models
β”‚   β”‚   β”œβ”€β”€ Messages.js
β”‚   β”‚   └── User.js
β”‚   β”œβ”€β”€ routes/             # API routes
β”‚   β”‚   β”œβ”€β”€ messageRoutes.js
β”‚   β”‚   └── userRoutes.js
β”‚   └── ...                 # Other server files

Getting Started

Prerequisites

  • Node.js (v18+)
  • npm (v9+)
  • MongoDB Atlas account or local MongoDB
  • Cloudinary account (for media storage)

Installation

  1. Clone the repository:
git clone https://github.com/elyse502/quick-chat.git
cd quick-chat
  1. Install dependencies for both client and server:
# Install client dependencies
cd client && npm install

# Install server dependencies
cd ../server && npm install
  1. Set up environment variables: Create .env files in both client and server directories with required credentials.

Environment Variables

Server (.env)

MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
PORT=5000

Client (.env)

VITE_API_BASE_URL=http://localhost:5000
VITE_SOCKET_URL=http://localhost:5000
  1. Start the development servers:
# In one terminal (server)
cd server && npm run dev

# In another terminal (client)
cd client && npm run dev

Usage

  1. Register/Login: Create an account or log in
  2. Find Contacts: Search for other users
  3. Start Chatting: Select a contact and begin messaging
  4. Real-Time Updates: See messages appear instantly
  5. Profile Management: Update your profile picture and status

API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login user

Users

Method Endpoint Description
GET /api/users Get all users
GET /api/users/:id Get specific user
PUT /api/users/:id Update user

Messages

Method Endpoint Description
GET /api/messages/:chatId Get chat messages
POST /api/messages Send new message

Real-Time Events

Emitted Events

  • new-user - When a user connects
  • send-message - When sending a message
  • typing - When user is typing
  • stop-typing - When user stops typing

Received Events

  • receive-message - When receiving a message
  • user-connected - When another user connects
  • user-typing - When another user is typing

Deployment

Frontend

Deploy with Vercel

Backend

Deploy to Render, Vercel, or other Node.js hosting services with MongoDB connection.


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

Distributed under the MIT License. See LICENSE for more information.


πŸ“ž Contact

For any questions or support, please contact:

LinkedIn @phenrysay pH-7


Quick-Chat - Where conversations happen in real-time! πŸš€βœ¨

Made with ❀️ by Elysée NIYIBIZI

⬆ Back to Top