Skip to content

vmariiechko/python-messenger

Repository files navigation

Python Messenger

python flask sqlite pyqt windows linux license

This is a python single-chat application separated on client-side and server-side. General-purpose of the project is to message between hosts in the local network. Additionally, you can download a desktop application in two versions.

demo-login demo-preferences demo-shortcuts    demo-chat


Table of content


Installation

Clone the project from GitHub, then you'll need Git installed on your computer:

# Clone this repository
$ git clone https://github.com/vmariiechko/python-messenger

Usage

The next steps explain how to use the messenger in your local network.

To run this application, you'll need Python 3.6+ installed on your computer. In your working environment from the command line:

# Go into the repository
$ cd python-messenger

# Install dependencies
$ pip3 install -r requirements.txt

Once you've installed all the dependencies, run the server on your local network in the first command prompt with arguments [username] [password] to create an administrator account:

# Navigate to server-side
$ cd ./messenger/server

# Run server and create [username] with administrator role 
$ python server.py [username] [password]

From that moment, your computer will work as a server (receive requests) in the local network. You can stop the server with Ctrl+C combination pressed twice in the terminal. Next time it's not necessary to run the server with arguments to create an admin account unless you've deleted the database.sqlite3 file.

After running the server, everyone from your network can run a messenger. Go to the root directory of the project and run the messenger client in the second command line prompt:

# Navigate to client-side
$ cd ./messenger/client

# Run client
$ python messenger.py

To connect to the server, everyone from your local network should change the IP address in Preferences to the local IP address with 9000 port (the local IP of the computer which runs the server).

Register an account or log in to the administrator account. Finally, you can use the messenger to communicate in the local network.

P.S. Originally project was developed on Debian family distribution, that's why it causes some UI problems on Windows.


Download

There are two executable desktop versions with the ability to chat in the:

  1. local network
  2. global network

Get them for Windows and Linux from here.

The main difference between versions is that the second one has the deployed server IP address by default without the ability to change the IP address in Preferences.


Features

  • Shortcuts
  • Gradient Design
  • Lots of commands
  • Ability to change a server IP address
  • Ability to check server status in the login form
  • Ability to promote/demote users (for admins)
  • Ability to ban users (for moderators and above)
  • Cross-platform
    • Windows and Linux ready

There are 3 roles in messenger:

  • User: Has standard commands
  • Moderator: The above + permissions to ban/unban users
  • Administrator: All the above + the ability to change the role of the user

Available user commands:

COMMAND VARIABLES DESCRIPTION
/close Closes the messenger
/logout Logs out from the account
/reload Clears commands messages
/help [command] Prints available commands or detailed description about [command] if specified
/myself Prints info about user
/status Prints server status
/online [users] Prints online users or [users] status if specified
/reg Prints registered users

Available moderator commands:

COMMAND VARIABLES DESCRIPTION
/ban [users] Bans [users]
/unban [users] Unbans [users]

Available administrator commands:

COMMAND VARIABLES DESCRIPTION
/role [user] [1-3] Changes [user] role

License

You can check out the full license here.

This project is licensed under the terms of the MIT license.


Gmail vmariiechko@gmail.com  ·  GitHub @vmariiechko  ·  LinkedIn @mariiechko