Code Monkey home page Code Monkey logo

chatist's Introduction

Chatist

๐Ÿฑ A chat system built with Nest.js

Documentation is still being worked on, if you find any issue or questions you can reach me out at [email protected] ๐Ÿ‘‹

Demo

A working demo can be seen here: https://mipigu.com (click on "Say hello")

Getting Started

To have a completely working project you only need to complete two steps: setup your own Telegram integration and deploy the project.

Disclaimer: Explanation is easy to follow and altough it may seem quite some steps long, I can admit you will learn a lot in the process, because as explained here you are following the exact same steps other developers need to follow to setup their integrations, so you may expect no abstraction at all, but an unique opportunity to learn new things!

Let's start with the Telegram integration by creating our own bot and bootstrap the chat room we'll use later on to connect to Chatist.

Create and setup your bot

  1. Login or create Telegram account, and open Telegram app

  2. Follow this link to add BotFather: https://telegram.me/BotFather

  3. Inside the BotFather conversation, click start

  4. We'll now create a new bot, write /newbot

  5. Write your bot name, this could be whatever you like, for example ChatBot

  6. Write your bot username, this name needs to be available and must end in "bot"

  7. Your bot has been created, BotFather will return you a token, it is very important as we'll need it later on to setup the chatbox.

Create the chat room

  1. Start a conversation with your newly created bot, you can search for it via the username in the global search, or just follow this link t.me/your_bot_username, where you need to replace "your_bot_username" with your actual bot username.

  2. Click start, and write /setup

  3. From your browser, visit this link: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates, you must replace <YOUR_BOT_TOKEN> with your actual bot token from Step 1, an example of how the link should be is lik the following: https://api.telegram.org/bot925151832:AEEFGlaRhlvj2adppRvchbFps4sdQ0NeA_t/getUpdates

  4. You will receive a response like the following, find your chat id and write it down for later use.

{
  "ok":true,
  "result": [
    {
      "update_id": 920130777,
      "message": {
        "message_id": 2,
        "from": {
          "id": 523419118,
          "is_bot": false,
          "first_name": "Sergio",
          "last_name": "M\u00e1rquez",
          "username": "undervane",
          "language_code": "en"
          },
        "chat": {
          "id": 523419118, // <-- We are interested in this number
          "first_name": "Sergio",
          "last_name": "M\u00e1rquez",
          "username": "undervane",
          "type": "private"
          },
        "date": 1568202859,
        "text": "f"
      }
    }
  ]
}

We have now finished with the Telegram setup and we can start setting up the integration with Chatist. Keep your bot token and chat id near you because we'll use them shortly.

Setup your project for deployment

Now it's time to choose an option for deployment, you should consider that you'll need to provide your own SSL certificate because Telegram integration needs a secured endpoint to setup a webhook.

You can use Firecamp (from here: https://firecamp.app/) to simulate a client for your Chatist distribution.

Documentation to simulate with Firecamp and manual deployment is currently in progress

chatist's People

Contributors

undervane avatar

Stargazers

HAKASHUN 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.