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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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.
To get started with the PHP-MySQL Marketplace, follow these steps:
-
Clone the Repository:
git clone https://github.com/Iqbolshoh/php-social-messenger.git
-
Navigate to the Project Directory:
cd php-social-messenger
-
Set Up the Database:
-
Create a new MySQL database:
CREATE DATABASE social_messenger;
-
Import the
database.sql
file located in thedb
directory:mysql -u yourusername -p social_messenger < db/database.sql
-
-
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");
- Open the
-
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
.
Contributions are welcome! If you have suggestions or want to enhance the project, feel free to fork the repository and submit a pull request.
I love connecting with new people and exploring new opportunities. Feel free to reach out to me through any of the platforms below: