Skip to content

smhussain5/Flask-SocketIO-Chat-Python

Repository files navigation

FLASKY CHAT

Flasky Chat Python GIF Demonstration

Problem 🤔

Real-time communication is a necessity in a globally connected world. Such can be achieved via Flask, Python, and WebSockets.

Solution 💡

This chat application utilizes simultaneous two-way communication channels over a single TCP connection via WebSockets to provide fast, real-time communication between users. Users must input their name and randomly-generated room code to join a session that is deleted after all users leave. Front-end utilizes Bootstrap and JavaScript to populate the message area with received/sent messages. Back-end utilizes Flask web-framework powered by Python and SocketIO to provide WebSocket capabilities.

Technologies Used ⚙

  • Flask
  • Gunicorn
  • Heroku
  • PyCharm
  • Python
  • SocketIO

Challenges 💢

This application was challenging to say the least! I originally wanted to deploy on PythonAnywhere but realized, after deployment, that it was not functioning as intended. After some research on their forums, I learned that they do NOT yet have support for WebSockets. After some further research, I decided to deploy to Heroku using Gunicorn, which was the exact solution I needed to restore proper functionality for the application!

Insights 💭

This project demonstrated the power of WebSockets as a way to enable simultaneous communication between users. Flask allowed me to develop the back-end with few lines of code. Opportunities to refactor could include database persistence and limiting chat rooms to a specified number of users.

Contact 📲

Static Badge
Static Badge
Static Badge
Static Badge