Giter VIP home page Giter VIP logo

chatroom's Introduction

Flask Chat Application

This is a simple chat application built with Flask and Flask-SocketIO. The application allows users to join a chat room by creating a new one or entering an existing one. Users can send messages to the chat room and view messages from other users in real-time.

Prerequisites

Before running this application, you will need to have the following installed on your machine:

  • Python 3
  • Flask
  • Flask-SocketIO

Running the Application

To run the application, execute the following command in your terminal:

python main.py

The application will then be available at http://localhost:5000.

Features

  • User can create a new chat room with a randomly generated code or join an existing one.
  • User can send messages to the chat room, which will be displayed in real-time to all users in the room.
  • User can view messages that have been sent in the chat room.

Code Structure

The application is built with Flask and Flask-SocketIO. The main code is contained in app.py. The generatecode function is used to generate a random code for a new chat room. The home function is used to handle requests to the home page, where users can enter their name and select whether to create a new chat room or join an existing one. The room function is used to handle requests to the chat room page, where users can view messages and send new messages.

The application uses Flask-SocketIO to handle WebSocket connections for real-time communication between clients. The connect and disconnect functions are used to handle socket connections and disconnections. The message function is used to handle incoming messages from clients, which are then broadcasted to all clients in the room.

Contributing

If you find a bug or would like to contribute to this application, feel free to submit an issue or pull request on GitHub.

chatroom's People

Contributors

om-alve avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.