fernandostahelin / web-chat

Just a silly app I developed with the help of Cursor. Since developing apps is not what I usually do, I am enjoying the opportunity to learn
Do What The F*ck You Want To Public License
0 stars 0 forks source link

Web Chat Application

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.

Features

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/web-chat.git
    cd web-chat
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. 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=

Running the Application

  1. Start the Flask application:

    python run.py
  2. Open your browser and navigate to:

    http://127.0.0.1:5000

Makefile Commands

Usage

Sending Messages

Sending Images

Viewing Messages

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the WTFPL License. See the LICENSE file for details.