Skip to content

A realtime chat application | Alx graduation project

Notifications You must be signed in to change notification settings

AhmadYousif89/linkup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkUp Realtime Chat Application

hero image

LinkUp is a real-time chat application that allows users to create chat rooms and communicate with others in real-time. Users can create accounts, log in, create and join chat groups, and share messages and media. The application is built using MongoDB, Express, React, Node.js, and Socket.io.

Authors

Malik Hussein LinkedIn GitHub

Mohamed Marzouk LinkedIn GitHub

Mahmoud Mohey Eldin LinkedIn GitHub

Ahmad Yousif LinkedIn GitHub

The presentation

LinkUp Presentation

Video Demo

LinkUp Demo

Features

  • User Authentication: Create an account with email/password or social login.
  • Real-time Messaging: Chat with friends in real-time using WebSockets.
  • Chat Groups: Create and join chat rooms to communicate with groups.
  • Responsive Design: Optimized for both desktop and mobile devices.

Installation

Prerequisites

Ensure that you have the following installed on your local machine:

  • Node.js (v12.x or above)
  • MongoDB (set up a local or cloud MongoDB instance)

Steps to Run Locally

  1. Clone the repository:

    git clone https://github.com/AhmadYousif89/linkup.git
    cd linkup
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    Create a .env file in backend directory and add the following variables:

    PORT=5000
    MONGO_URI=mongodb://localhost:27017/linkup
    JWT_SECRET=<your-secret-key>
    

    Create a .env file in client directory and add the following variables:

    VITE_CLERK_PUBLISHABLE_KEY=<your-publishable-key>
    VITE_SERVER_API=http://localhost:5000/api
    
  4. Start the application:

    Start the backend server from backend directory:

    npm start

    Start the frontend server from client directory:

    npm run dev
  5. Navigate to http://localhost:5173 in your browser to start using the application.

Future Features

  • Friend System: Add friends and see their online status.
  • Multi-media Files Sharing: Share images, videos, and other files.
  • Voice Calling: Make voice calls with friends in real-time.
  • Video Calling: Make video calls with friends in real-time.
  • Screen Sharing: Share your screen with friends in real-time.
  • Push Notifications: Get notified when friends send new messages.
  • Dark Mode: Switch to a dark theme for better readability.

Technologies

This project leverages modern technologies to deliver real-time communication:

  • Frontend: React with state management and dynamic UI.
  • Styling: Tailwind CSS for responsive and modern UI design.
  • Backend: Node.js + Express for RESTful APIs and routing.
  • Database: MongoDB for storing user data, chats, and rooms.
  • Real-time Communication: Socket.io for WebSocket-based real-time messaging.
  • Security: JWT + Clerk for secure authentication and authorization.
  • Testing: Postman for API testing

Usage

  1. Sign up/Login: Create an account or log in with existing credentials.
  2. Create/Join Chat Groups: Create a new chat groups or join an existing one.
  3. Send Messages: Chat in real-time with friends or group members. Share images, files, and other media.

API Documentation

  • User Endpoints:

    1. POST /api/user/clerk
      Function: Sign-up or Sign-in a user with clerk.
      Request Body: { id, email, fullName, image }

    2. GET /api/user?search=Joe
      Function: Search for user using query
      Request Query: { query.search }

  • Chat Endpoints:

    1. POST /api/chat/
      Function: Views chat with a certain user, requires userId.
      Request Body: { userId }

    2. GET /api/chat/
      Function: Search for private chats for the user.

    3. GET /api/chat/group
      Function: Search for group chats for the user.

    4. POST /api/chat/group
      Function: Create a new group chat, requires name of the group and user IDs (minimum 3 including the current user).
      Request Body: { users, name }

    5. PUT /api/chat/rename
      Function: Rename group chat, requires chatId and chatName.
      Request Body: { chatId, chatName }

    6. PUT /api/chat/groupadd
      Function: Add a user to the group, requires chatId and userId (must be in the group).
      Request Body: { chatId, userId }

    7. PUT /api/chat/groupremove
      Function: Remove a user from the group, requires chatId, userId, and must be groupAdmin.
      Request Body: { chatId, userId }

    8. DELETE /api/chat/groupdelete
      Function: Delete a group, requires chatId and must be groupAdmin.
      Request Body: { chatId }

    9. PUT /api/chat/groupquit
      Function: Quit a group, requires chatId.
      Request Body: { chatId }

    10. PUT /api/chat/close
      Function: Close a chat for a certain user, requires chatId.
      Request Body: { chatId }

  • Message Endpoints:

    1. POST /api/message/
      Function: Send a message to a user, requires content and chatId.
      Request Body: { content, chatId }

    2. GET /api/message/:chatId
      Function:Get all messages in a chat, requires chatId.
      Request Param: { chatId }

Contributing

Contributions are welcome! Here's how you can get involved:

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

Please make sure your code follows the project's code style guidelines.

License

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

About

A realtime chat application | Alx graduation project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •