Coder Social home page Coder Social logo

zhibirc / ya2ber Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 73 KB

๐Ÿ‘ฅ CLI chat to just chat. No ads, no statistics collection, no special terms, no unknown third-party services, no spies, no tricky interfaces... no bullshit.

JavaScript 94.03% Dockerfile 1.68% Makefile 4.29%
chat chat-application net nodejs shell socket terminal-app terminal-based

ya2ber's Introduction

ya2ber

maintenance node-version npm-version

CLI chat to just chat. No ads, no statistics collection, no special terms, no unknown third-party services, no spies, no tricky interfaces... no bullshit.


Etymology

ya2ber is just derived from yabber, which is the synonym for jabber, which is the synonym for usual talk.

Features

  • Authentication based on login and password.
  • Shows how many visitors are in the chat. Currently, this info is shown in PS1 prompt.
  • Chat members are notified when someone left.
  • There are 3 message categories/types - system (including ones from server), authentication purposed and just chat messages.
  • Client and server use JSON as data format for transmitting data to each other. See how.
  • Entering of password is hidden (like many other CLI applications do, including sudo) and isn't stored in history.
  • Authentication errors are well recognized because of verbose error messages.
  • Client doesn't contain any validation logic for user credentials, this a server's responsibility.
  • Server stores such specific user data: registration date, last activity date and last used IP address.*
  • Server doesn't store any message history. Instead, client could store history locally as an option.
  • Prevention of typosquatting in usernames.
  • Rework UI for using blessed curses-like library
  • libsignal library is used for communication encryption

* actually, server stores last login date rather than last activity date for now

CLI options

JSON message schema

Example of client's message:

{
    "message": "Hello, username!",
    "type": "message",
    "command": "/username"
}

Example of server's message:

{
    "message": "username left the chat",
    "type": "system",
    "online": 5
}

Development

Setup

Installation

git clone [email protected]:zhibirc/ya2ber.git

cd ya2ber

# it'll automatically install dependencies in all nested application folders
npm install

Pre-commit

We use pre-commit for running code checks locally, just before committing, to ensure that all basic code requirements and policies were respected. Installation is pretty simple (one-time action):

# install pre-commit using Python's pip
pip install pre-commit
# OR
# install pre-commit using using Homebrew
brew install pre-commit

# install the Git hook scripts
pre-commit install

Now pre-commit will run automatically on git commit! Configuration for pre-commit hooks is stored in .pre-commit-config.yaml file.

pre-commit notes

  • If you want to skip all the pre-commit checks (not recommended!), you can add the -n parameter as follows:
git commit -m "commit message" -n
  • Alternatively if you only want to skip some specific check, you can use SKIP=<hook_id> before the command:
SKIP=codespell git commit -m "commit message"

Storing secrets

Generally, it may be necessary to use some sensitive data, usually stored in environment variables, in application. For example, AWS keys. If so, it's important to remember that any sensitive data shouldn't be leaked to the public, including GitHub repository.

To accomplish this, create .env.local file (don't use .env file in this case) in the appropriate directory (client/ or server/), and put environment variables intended to be private there. This file is ignored by Git and excluded from Docker context on image build.

Automation scripts

We use GNU Make for automate operations related to source code and application deployment.

Available Make project-level commands

Get help/guide for all available commands.

make
make help

ya2ber's People

Contributors

zhibirc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ya2ber's Issues

Handling of hiding password input

Currently, password input is hidden by using _writeToOutput non-public method of readline.Interface class. Such methods which usually be considered as private by syntax convention are not intended for using from external user code.

So, interceptor implementation based on the method descibed above should be reworked. One possible approach for this is using handling of data or keypress events on process.stdin.

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.