Code Monkey home page Code Monkey logo

lan_group_chat's Introduction

LAN Chat Application

Introduction

This is a simple LAN chat application that allows users to chat with each other on the same network. To provide real-time communication, the application was built using socket programming in Python. At first prototype, the application had a server and client side, their code can be found in client.py & server.py. This approach had drawbacks, which were solved in the final design using Python Flask and SocketIO.

Technologies

Python, Flask, SocketIO, HTML5, CSS, JavaScript

Initial Design

The initial design was based on a server-client model. Each was a python script that used the socket module to communicate with each other.

Drawbacks:

  • The server & client had to be running on a separate terminal window with no GUI.
  • Each user had to send only one message and wait for a response before sending another message.
  • The server could only handle one client at a time (maximum of 2-person communication).
  • The server had to be restarted to accept a new client.

Final Design

The final design utilized Python Flask for server and SocketIO for the client. The client became a web application that could be accessed using a web browser from any device on the LAN. The server was able to handle multiple clients at the same time and could be accessed from any device on the same network. The server was able to broadcast messages to all connected clients, making it a group chat application for all users on the LAN. All screenshots of the initial & final design can be found in the static folder.

Features:

  • Real-time communication with a group of users.
  • User-friendly interface.
  • No need to restart the server to accept new clients.

How to use

  1. Clone the repository.
  2. Run the server using python app.py.
  3. Open a web browser and go to http://localhost:5000.
  4. Enter your name and start chatting.

Future Improvements

  • Add user authentication & Personal Avatars.
  • Add the ability to send files (picture/voice recordings).
  • Add the ability to create private chat rooms (DMs).
  • Allow Push Notifications for new messages.

Credits

Much appreciation goes to the 3 articles listed below in referances, Chris Brown, Drake, Travis Scott, Fairuz, Islam Kabonga for their contribution to the workin playlist, and the generous Fabio Ottaviani who designed the UI and made it open source. ๐Ÿ˜‚

References

  1. Python Sockets: An Introduction
  2. Building Apps using Flask, SocketIO, and JavaScript Socket.IO - Part 1
  3. How to Build a Simple Real-Time Application using Flask, React, and Socket.IO
  4. UI Design

License

This project is licensed under the MIT License - see the LICENSE file for details.

lan_group_chat's People

Contributors

mogomaa79 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.