cli_chat_app

module
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2025 License: Apache-2.0

README

CLI Chat App

Introduction

Welcome to the CLI Chat App, a end-to-end encrypted chat application that runs on your terminal!

It is designed to be lightweight, fast, and easy to use, making it perfect for developers and tech enthusiasts who prefer working in a terminal environment.

Features

  • Secure Messaging: Utilizes end-to-end encryption (The Signal Protocol) to ensure that your messages remain private and secure. This means chat history is stored locally on your device and is not accessible by the server or any third parties.
  • User Authentication: Register and log in with a username and password. JWTs are used to keep you signed in between sessions.
  • Friend Management: Send and receive friend requests, and manage your friend list.
  • Real-time Communication: Chat with your friends in real-time using a simple and intuitive interface.
  • Multi-media support: Send and receive images, videos, and files.
  • Cross-Platform: Available on Linux, macOS (Intel and ARM), and Windows.

Getting Started

Installation
Client Installation
  1. Install the binary: Download the binary from the releases page for your operating system.

  2. Configure the binary: If on Linux or MacOS, you can run chmod +x cli_chat_app to make the binary executable. If on MacOS, you may need to run xattr -cr cli_chat_app to remove the quarantine attribute.

  3. Run the binary: Run the binary by typing ./cli_chat_app in your terminal.

  4. Add server address: Add the following line to your .env file in the same path as the binary:

    SERVER_ADDRESS=clichatapp.click:50051
    

    Alternatively, you can set the SERVER_ADDRESS environment variable by running export SERVER_ADDRESS=clichatapp.click:50051 in your terminal.

  5. Add an Alias (Optional): Add an alias to your .bashrc or .zshrc file to easily access the binary. For example, alias cli_chat="~/path/to/cli_chat_app".

Examples

Run the app using an alias
Example of running the app with an alias
Friend requests between two users
Example of sending friend requests between two users
Sending text messages between two users
Example of sending text messages between two users
Sending files between two users
Example of sending files between two users

Usage

  • Register: Create a new account by selecting the "Register" option.
  • Login: Log in with your credentials to access the chat features.
  • Send Friend Requests: Add friends by sending them a request.
  • Chat: Start a conversation with your friends.

Testing

Testing is done using gotestsum. Tests set up and teardown a single server, a specified number of clients, and the necessary (local client and server) databases.

To run the tests, set the following environment variables:

CLI_CHAT_APP_JWT_SECRET_KEY=your-generated-key
TEST_DATABASE_URL="root@tcp(127.0.0.1:3306)/

Optionally, you can set the TEST_LOG_DIR environment variable to specify the directory for the test logs. If not set, the logs will be stored in the app directory. (See GetAppDirPath() in client/app/utils.go)

The jwt key is a random 32-byte key encoded in Base64. You can generate one using the following command:

openssl rand -base64 32

Then run the following command:

gotestsum --format=short-verbose ./test/...

Tests are also ran in github actions.

Contributing

We welcome contributions! Please fork the repository and submit a pull request with your changes. Ensure that your code follows the project's coding standards and includes appropriate tests.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Acknowledgments

  • Thanks to the contributors and the open-source community for their support and contributions.

Note: This README is a work in progress. More detailed instructions, including GIFs and images, will be added soon.

Directories

Path Synopsis
client
app
lib
ui
ui/pages
filemenu.go
filemenu.go
cmd
client command
server command
genproto
server
app
setup
test/setup/bufconn_setup.go
test/setup/bufconn_setup.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL