Skip to content

IRC like group chat application using Flask and Socket.io.

Notifications You must be signed in to change notification settings

arensonzz/flask-group-chat

Repository files navigation

Flask Group Chat

In messaging applications, sent messages pass through servers that we cannot control. If these servers are not open-sourced, one cannot be sure of their information's privacy. This application addresses aforementioned issue by providing open-source server application that people can host on their machine to communicate with their loved ones. They can choose between hosting to public internet or only to their local network.

Users should create an account to enter the application. Messaging happens in chat rooms. Each user can create unlimited number of rooms or they can join previously created ones. Messages are broadcasted to the room's participants.

User accounts and chat rooms are protected by passwords. These passwords are hashed before storing in databases.

Requirements

  • Python 3
  • Pip 3

Running Server Locally

  1. Install Python dependencies
    pip3 install -r requirements.txt
  2. Initiate the Sqlite3 database with flask CLI command
    flask init-db
  3. [OPTIONAL] Insert mock data to database for test purposes. All mock passwords are 1234.
    flask import-mock-data
  4. Start the Flask server
    python app.py
  5. Access the application from browser
    http://localhost:5000

Routes

Route Description Methods
/auth/register Interface where user creates an account. GET, POST
/auth/login Interface where user enters the application with his account. GET, POST
/auth/logout Logouts from the user's account and clears the session. GET
/create-room Interface where user creates unique chat rooms. GET, POST
/join-room Interface where user joins previously created chat rooms. GET, POST
/live-chat Interface of a chat room. People send messages to other people in the room. GET, POST
/leave-chat User leaves the chat room. User is redirected to index page. GET

Application Interface

  • Create account

    An interface to register to the website.

  • Login

    An interface to login with registered account.

  • Create chat room

    An interface to create unique chat room.

  • Join chat room

    An interface to join previously created rooms.

  • Live chat page

    An interface to message with others in the room.

Technologies