Coder Social home page Coder Social logo

vds13 / socketgram-support-chat Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 1.09 MB

Simple chat by using Node.js, Socket.IO and node-telegram-bot-api

License: MIT License

CSS 11.09% PHP 40.55% JavaScript 45.30% HTML 3.06%
chat nodejs socket-io support support-chat telegram-bot telegram-bot-api

socketgram-support-chat's Introduction

logo

Socketgram - Support Chat

Simple project that combines database, Express, Socket.io and Telegram Bot API written in Node.js

Bot API Version Project Version

Introduction

The project is a technical support chat, with the ability to send messages both from the site page and from Telegram through a chat bot.

Libraries used

Node.js

PHP

  • LDAP
  • MySQL

Project composition

  1. Principle of operation
  2. Chat server
  3. Admin panel in PHP
  4. Client block

Principle of operation

There are two roles: admin and user. The admin has access to all rooms, the user - only to the one in which he is. Rooms are formed by hashing a string like: id + <ClientID> + Secret key. For example: md5("id123qwerty"). The connection of the admin to the server is determined by sending a request (query) when connecting (an example of the parameters is below in the configuration file):

io(DOMEN_SERVER, { transports : ['websocket', 'polling', 'flashsocket'], query : {[SERVER_KEY]: SERVER_PSWD} })

Let's consider two examples: when the user is authorized in the telegram bot and when the user is not authorized.

User 1: not logged in

The user sends a message from the site, the message arrives at the server via WebSockets, is written to the database and sent to the admin:

The response from the admin to the user follows the same principle:

User 2: logged in

The user sends a message from the site or Telegram, the message arrives at the server via WebSockets, is written to the database and sent to the admin:

The response from the admin to the user is sent through the admini panel via WebSockets, comes to the server, is recorded in the database and sent to the user's personal account and to Telegram via the Telegram bot:

License

The MIT License (MIT)

Copyright © 2022-2024 Dmitry Vyazin

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.