Git Product home page Git Product logo

blak's Introduction

Blak

The Remarkable Place to Prattle, Ever

Blak is a cross-platform, FastAPI-powered, Websocket based Chat Application, made for Python-Discord's Summer Code Jam 9.

Features

  • Blak is for people who need to chat in private.
  • Blak has no word wrap. So even if someone sends humongous text messages, It won't be visible. So, users can have a meaningful talk within a few messages.
  • Users can see each others typing-in messages in real-time.

Tech

Blak uses a number of open source projects to work properly:

  • Kivy - Amazing open source UI framework written in Python
  • FastAPI - Awesome web framework for buildingAPIs with Python
  • Websockets - Library for building WebSocket servers and clients in Python.
  • Poetry - Great pacakage manager for Python

And of course Blak itself is open source with a public repository on GitHub.

Installation:

Blak requires Python 3.10 to run.

Clone the repo, install the requirements using Poetry for the client and start the app (server has been already implemented and running, so we can skip to the following part)

git clone https://github.com/Gorgeous-Ghouls/Blak.git
cd client
poetry install
poetry run blak

Run with your own server:

Install requirements, and start the server

cd server
poetry install
poetry run blak-server

And in the client/.env file, change and replace url:port to server's running url:port

WEBSOCKET_HOST=<ip or url:port>

Docker

Run the server with docker

docker run -p 8001:8000 -d ghcr.io/gorgeous-ghouls/blak/blak-server

License

MIT

blak's People

Contributors

noahlias avatar p0lygun avatar stonesteel27 avatar

Stargazers

 avatar  avatar  avatar  avatar

blak's Issues

"Features" to add to chat

Features to-do

  • #48
  • #51
  • Try adding common errors into code, like integer overflow if no. of messages exceed 128
  • #49
  • Use shift + c to copy instead of ctrl (or maybe ctrl+v to copy and ctrl +c to paste)
  • Must search every user, only one user visible at a time
  • To add a user, we must answer some questions set by them
  • #52

Create message manager

A core component of the backend that handles distribution and routing of incoming messages.

Introduce User Class

This Class, handles all the work for a particular connected client. More usabililty, flexibilty than mesage manager. Also keeps the code clean

Use Poetry as the Project manager

Poetry is a project manager for python, it makes separating dependencies very easy (dev and prod)

How to install Poetry

How to use Poetry

  • Make sure that you are in the same directory as the project
  • Run command poetry install (this will make a virtual environment and install all packages in pyproject.toml)
  • To run commands like python -m ... or python command use
    • poetry run <same command>
    • so as we have to install pre-commit hooks we can use the command poetry run pre-commit install
    • you can also use poetry shell to activate the venv

How to install a new module

  • poetry add <module name>

Show other users online (backend)

Request to be sent:

{
    "type":"user.online",
    "user_id":"user_id"
}

Response:

{
    "type":"user.online",
    "status":true
    "user_id":"user_id"
}

Add colums where chats are show

Make use of Screen in KivyMD, Each chat is a separate screen

The column on the left lists all the chats available
Each entry acts as button to switch to a new screen in "chat area"
Image for reference

Image

"the Chats" are actually just a screen and we them switch them via the listings on the left

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.