Git Product home page Git Product logo

pikachat's Introduction

PikaChat

A simple chat for CloudAMQP made with Pika

Message JSON

It sends and receives the following JSON and it won't show the message if it's missing any of the keys.

{
  user: "Andriy";
  timestamp: "2021-10-26T10:57:12";
  message: "Hello world!";
  source: "group" or "user"
}

Screenshots

Info screen

Info screen

That's the input screen for the CloudAMQP URL, username and group name to join.

  • You can manually input the URL or insert a .txt file with it inside
  • The username acts as the consumer's queue name
  • The group name acts as the consumer's exchange name

It'll also throw a popup error if it fails to connect to the provided URL, or if any of the boxes are empty.

Chat box

Chat box

That's what the chat box looks like, it'll load the chat log on start and you send messages by typing at the bottom and pressing Enter.

It uses the source key in the JSON to paint the messages.

  • Group messages are painted black
  • Private messages are painted purple.

Private box

If you'd like to send a private message, you can switch to the private chat option and set the user (queue) you'd like to send the message to.

It'll pop an error if you try to send a message without having set the user first.

It works by setting the exchange as "" while publishing the message to a routing key, that's why having to set a user first is mandatory.

Message log

The message log will be named as username_exchangename.log and it'll look something like the following:

[
    {
        "user": "Andriy",
        "timestamp": "2021-11-07T16:25:51",
        "message": "Test message",
        "source": "group"
    },
    {
        "user": "Andriy",
        "timestamp": "2021-11-07T16:35:09",
        "message": "Private message",
        "source": "private"
    }
]

Currently it only saves received messages, so it won't log private messages you've sent, only ones that you've received.

Since it doesn't takes the CloudAMQP URL in consideration, it could end up saving chats from exchanges with the same name in the same log archive.

pikachat's People

Contributors

andriyfujii avatar

Watchers

 avatar

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.