gavinblair / Quartz

An extensible console chat.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quartz

Quartz is an extensible tcp chat. It provides a server and a simple client with more than enough flexibity to suit your use case. It can be deployed in a local network or in the internet with ease due to nix integration. To create a Quartz based chat, one can fork this repo and make little changes as described in the Configuration section.

Alt text

πŸ“– About

🎯 Design Goals

  • An easily and completely extensible tcp chat in python
  • An easy, fast and integrated deployment using nix
  • Console-based but web extensible as well

πŸš€ Features

  • Tcp basic console chat
  • Plugin system
  • Commands interface
  • User selected names and colors

πŸ“¦ Dependencies

Obligatory Dependencies

  • Python for everything
  • dnspython for domain resolving

Optional Dependencies

  • nix for installation and deployment
  • docker for nix produced docker use

⬇️ Installing Client

This repo has a Quartz package available inside the flake and also can be installed via pipx.

Pipx installation:

pipx install .

Nix run:

nix run github:OWNER/CHAT_REPO

This command will "install" everything and run the client automatically.

In a Nixos flake system:

In flake.nix:

{
  # create an input with the name of the chat, and set its url to this repository
  inputs.CHATNAME.url = github:OWNER/CHATREPO;
}

In configuration.nix:

{
environment.systemPackages = [inputs.CHATNAME.packages.YOUR_SYSTEM.default];
}

βš™οΈ Configuration

If you want to add plugins to a Quartz based client:

Plugins for client can be inserted in ~/.config/chatname/plugins/.

This folder is automatically created on first client execution.

If you want to configure a Quartz based chat, you can follow these steps:

  1. Step Zero: Fork it, if you are going to make a Quartz based chat please do not send any configuration commit to this repo.

  2. Firstly: You can find and replace Quartz for whatever name you want inside flake.nix and change the name and console_scripts name inside setup.cfg. Please dont replace the name inside Src!!! (It can break!)

  3. Secondly: You can enter your information in src/Quartz/init.py, such as chat's name, domain, ip, iptype(IPV6 or IPV4) and version. Here, if given IP it will be used, if not, the domain will be converted as IP and if no domain nor IP is given, the host will be localhost.

  4. Thirdly: You can put every plugin you want inside their respective directories. For Client PLugins: src/Quartz/Clientlib/ClientPlugins. For Server Plugins: src/Quartz/ServerLib/ServerPlugins. Every plugin inserted will be automatically capted by client and Server.

  5. Deploy it with your desired method and publish the client!

🚚 Deploy

The server can be deployed in various ways:

  • Nix run
nix run .#Server

This command will install all dependencies and run the server.

  • Docker

The flake inside this repo makes a docker image available so one can enter:

nix build .#Docker

In the working directory a result docker image with all dependencies will be created. Inside it the CHATNAME-Server command can be used to start the server.

  • Directly

if one wants, they can just run:

python src/Quartz/server.py

Everything should be up and running if all obligatory dependencies are met.

🎨 Plugin Creation

See plugins instructions.

🀝 Contributing

Visit contributing instruction.

Credits

Ranger file manager's README was a heavy inspiration for this file and I am very thankful.

About

An extensible console chat.

License:MIT License


Languages

Language:Python 93.0%Language:Nix 7.0%