GithubHelp home page GithubHelp logo

andjelx / chat_services Goto Github PK

View Code? Open in Web Editor NEW

This project forked from diemol/chat_services

0.0 2.0 0.0 271 KB

Java 83.29% CSS 1.84% HTML 0.98% JavaScript 8.31% Shell 0.30% Python 1.46% Groovy 3.82%

chat_services's Introduction

What Is In This Repo?

Chat Services

There are 2 chat services built so far, which implement a very basic chat function. One service currently accepts a message, and the other broadcasts it to whatever client is connected.

Chat Service

Very simply, it takes a message from the user via a restful interface, and pushes it onto a message queue. The queue uses MQTT protocol (a lightweight pub-sub queue - like a topic) There are plans later to add a "history" feature to the ChatService so the client can see the chat history, which will require adding a datastore of some description.

Chat Broadcast SSE

This service accepts a connection, via GET, to a particular message queue channel.
This then holds a connection open to a queue on the backend and begins to send server sent events to all connected clients

The Other Parts

There are 2 more modules in the project.

Message Queue

This is a very simple ansible task to install and configure apollo mq to be able to use MQTT (pub/sub-like topics message queue) NOTE: you don't need to use ansible This has simply been chosen to illustrate how the queue is currently configured (it looks dev ready but not production)

To install the message queue locally, you can use: ansible-playbook -i local/hosts.ini install.yml --ask-sudo-pass -vv

Chat Client Demo

To illustrate how the services and queue interacts, we have included a small client example. To be able to see this page, you need to:

cd chat_client_service
./run.sh

This will run a very simple python server to serve the flat content on port 8000

Note, you need both services running and the message queue up for the page to work

To go to a particular channel, open 2 browser windows pointing at the following url:

http://localhost:8000?c=c3743620-cc30-11e6-9d9d-cec0c932ce01
(Any valid UUID will currently create a new message queue in the background)

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.