Overview:
Welcome to the Real-Time Chat Application! This web-based chat platform allows you to create or join chat rooms, send messages in real time, and interact with other users seamlessly.
Features
- Instant messaging – Messages are sent and received in real time.
- Chat rooms – Users can join existing chat rooms using a room code or create their own.
- User-friendly interface – Simple and intuitive chat layout.
- Connection notifications – See when users join or leave a chat room.
- WebSocket communication – Messages are transmitted over a WebSocket connection using Flask-SocketIO.
- Secure and session-based – Users enter a name before joining a chat room.
- Rate limiting – Users can send up to 5 messages within 10 seconds to prevent spam.
Technologies Used
- Flask (Python web framework)
- Flask-SocketIO (for WebSocket-based real-time communication)
- HTML, CSS, JavaScript (for the front-end UI)
- Socket.IO JavaScript Client (for real-time message updates)
Installation Ensure you have Python installed on your system.
- Clone the repository:
git clone https://github.com/lijjinn/CPSC455_Project1.git cd CPSC455_Project1 - Install dependencies:
pip install flask flask-socketio
- Run the server:
python main.py
Getting Started
- Open your browser
- Navigate to:
- HTTP:
http://127.0.0.1:5000 - WebSocket:
ws://127.0.0.1:5000
- HTTP:
- Click "Join a Room".
- Enter the Room Code (provided by another user).
- Click "Join" to enter the chat.
- Enter your name in the input field.
- Click "Create a Room".
- A unique Room Code will be generated.
- Share this code with friends so they can join.
- Start chatting in real time!
- Type your message in the input box at the bottom.
- Click "Send" to send your message.
- Messages appear instantly in the chat window.
To prevent spam, each user can send a maximum of 5 messages within 10 seconds. If the limit is exceeded, a message will appear stating:
Rate limit exceeded. Please wait a moment.
This ensures smooth messaging while preventing excessive spam.
- Ensure you have a stable internet connection.
- Try refreshing the page.
- Check if you've hit the rate limit and wait a few seconds.
This project is licensed under the MIT License.
- used AI for formatting user guide *