A modern, real-time chat application built with Flask and Socket.IO, featuring a sleek dark-themed interface.
- Real-time Messaging: Instant message delivery using Socket.IO
- User Authentication: Secure login and registration system
- Message Types: Support for text, images, and voice messages
- Message Management: Delete messages with confirmation dialog
- Read Receipts: See when messages have been read
- User Status: Track when users were last active
- Responsive Design: Works on desktop and mobile devices
- Dark Theme: Easy on the eyes with a modern dark interface
- Backend: Flask (Python)
- Real-time Communication: Socket.IO
- Database: MySQL
- Frontend: HTML, CSS, JavaScript
- UI Components: Font Awesome icons
- Python 3.7+
- MySQL
-
Clone the repository:
git clone https://github.com/yourusername/chat-application.git cd chat-application -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database:
mysql -u root -p < database/schema.sql -
Create a
.envfile based on.env-example:cp .env-example .env
Then edit the
.envfile with your database credentials and application settings. -
Run the application:
python app.py
-
Access the application at
http://localhost:5000
chat-application/
├── app.py # Main application file
├── config/ # Configuration files
│ └── config.py # Application configuration
├── database/ # Database related files
│ └── schema.sql # Database schema
├── models/ # Data models
│ ├── message.py # Message model
│ └── user.py # User model
├── static/ # Static files
│ ├── css/ # CSS files
│ │ └── chat.css # Main stylesheet
│ ├── js/ # JavaScript files
│ │ └── chat.js # Client-side logic
│ └── uploads/ # User uploaded files
├── templates/ # HTML templates
│ ├── chat.html # Main chat interface
│ ├── login.html # Login page
│ └── register.html # Registration page
├── .env # Environment variables
├── .env-example # Example environment file
├── .gitignore # Git ignore file
└── requirements.txt # Python dependencies
- Register a new account or log in with existing credentials
- Select a user from the list to start chatting
- Type messages in the input field and press Enter or click the send button
- Use the attachment button to send images
- Use the microphone button to record and send voice messages
- Hover over your messages to see the delete option
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.