This is a real-time web chat application built using Flask, Flask-SocketIO, and MongoDB. The application allows users to send text messages and images, which are stored in a MongoDB database. The frontend is built with HTML, CSS, and JavaScript, and uses Bootstrap for styling.
Clone the repository:
git clone https://github.com/yourusername/web-chat.git
cd web-chat
Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
Install the dependencies:
pip install -r requirements.txt
Set up environment variables:
Create a .env
file in the root directory and add the following variables:
FLASK_DEBUG=False
MONGO_USER=webchat
MONGO_PASSWORD=
MONGO_DB=messages_db
MONGO_COLLECTION=chat-messages
FLASK_HOST=127.0.0.1
FLASK_PORT=5000
MONGO_URI=
Start the Flask application:
python run.py
Open your browser and navigate to:
http://127.0.0.1:5000
Format code:
make format
Lint code:
make lint
Type check:
make type
Run all checks (format, lint, type):
make ci
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the WTFPL License. See the LICENSE file for details.