Skip to content

PHP Social Messenger is a real-time chat application using PHP, MySQL, and AJAX. It supports instant messaging, profile management, contact search, user blocking, and a RESTful API for easy integration.

Notifications You must be signed in to change notification settings

Iqbolshoh/php-social-messenger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Social Messenger

PHP Social Messenger is a real-time messaging application that allows users to chat with each other, edit their profiles, and manage contacts. It provides an easy-to-use interface for sending and receiving messages, managing user profiles, and handling blocked users. The app is built using PHP, MySQL, and JavaScript (AJAX), with a focus on real-time interactions. This application also includes a RESTful API for seamless integration with other services.

Features

1. Real-Time Messaging

  • Instant message updates: Messages are instantly displayed when received. The chat automatically refreshes every few seconds.
  • Message status: Shows which user sent the last message and the number of unread messages.
  • Delete or copy own messages: Users can edit, delete, or copy their own messages, but they cannot edit messages from other users.

Real-Time Messaging

2. Profile Management

  • Profile Editing: Users can update their profile picture, full name, and password directly from the user interface.
  • View Profile: Clicking on the "View Profile" option lets users see the profile information of the person they are chatting with.

Profile Management

3. Contact Search

  • Search Contacts: Users can search for contacts using the search bar on the homepage (index.php). It dynamically filters the contacts list based on the search term.
  • Manage Contacts: The app displays all the contacts on the main page, including unread messages, allowing users to stay updated.

Contact Search

4. Block Users

  • Block Functionality: Users can block others from sending messages. If you block someone, they will not be able to send you messages anymore, and you will not be able to message them.
  • Blocked Notifications: If a user tries to message someone who has blocked them, they will be notified that they are blocked.
  • Block Menu: The block option is easily accessible via the action menu in the chat interface.

Block Users

5. Chat Interface

  • Message History: When entering a chat (chat.php), the complete message history with the other user is shown.
  • Message Actions: Users can delete or copy their own messages, while messages from others cannot be edited.
  • Real-Time Syncing: The chat updates in real-time, ensuring the user always sees the most recent messages.

Chat Interface

6. Menu Options

  • View Profile: View the profile of the person you’re chatting with.
  • Clear Chat: Clear the entire chat history with a specific user.
  • Block User: Block the user to prevent them from sending you any more messages.

Menu Options


API

The application also exposes a RESTful API for integrating the messaging functionality into other systems. The API includes endpoints for:

  • Fetching profiles
  • Fetching messages
  • Fetching contacts
  • Sending messages
  • Editing messages
  • Deleting users
  • Managing user accounts

API documentation is available in the docs/ directory. It provides all the necessary details for interacting with the APIs and using them in your own applications.

Technologies Used

HTML CSS Bootstrap JavaScript jQuery PHP MySQL

Installation

To get started with the PHP-MySQL Marketplace, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/Iqbolshoh/php-social-messenger.git
  2. Navigate to the Project Directory:

    cd php-social-messenger
  3. Set Up the Database:

    • Create a new MySQL database:

      CREATE DATABASE social_messenger;
    • Import the database.sql file located in the db directory:

      mysql -u yourusername -p social_messenger < db/database.sql
  4. Configure Database Connection:

    • Open the config.php file in the root directory.
    • Update the database credentials:
      define("DB_SERVER", "localhost");
      define("DB_USERNAME", "root");
      define("DB_PASSWORD", "");
      define("DB_NAME", "social_messenger");
  5. Run the Application:

    • Deploy the application on a PHP-compatible server (e.g., Apache or Nginx).
    • Access the application through your browser at http://localhost/php-social-messenger.

Contributing

Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.

Connect with Me

I love connecting with new people and exploring new opportunities. Feel free to reach out to me through any of the platforms below:

GitHub Telegram LinkedIn instagram WhatsApp Twitter Email

Releases

No releases published

Packages

No packages published