Code Monkey home page Code Monkey logo

my-telegrambot's Introduction

my-telegrambot

Telegram bot for learning

Idea

The main idea is demonstration how I can create real application, which can be used by someone else.

MVP Scope

As a user, I want to subscribe on group of posts and get notification via telegram-bot every time, when new post, related to group subscriptions, has come.

How it works

Based on MVP Scope, we can specify next behaviours (here and after Telegram User, which is using Telgegram bot will call User):

  • User can subscribe on group of posts
  • User can view list of group subscriptions on which user subscribes
  • User can unsubscribe from group of posts
  • User can set an inactive bot and do not receive notifications
  • User can restart getting notifications

Find new posts workflow

The workflow of finding new posts and send them to subscribers can be viewed here:

Find_New_Posts_WF

Deployment

Deployment process as easy as possible: Required software:

  • terminal for running bash scripts
  • docker
  • docker-compose

to deploy application, switch to needed branch and run bash script:

$ bash start.sh ${bot_username} ${bot_token}

bash start.sh Spencer_My_Telegram_bot 5296153351:AAGFAvT3vYJsggYZ-pzZQ24A1DIVmceBSfU

That's all.

Local development

For local development and testing, use docker-compose-test.yml. Run command:

docker-compose -f docker-compose-test.yml up

Next step, is to run SpringBoot app with configured Edit Configuration in which two env vars are provided:

bot.token=${BOT_TOKEN};bot.username=${BOT_USERNAME}

And add VM Options:

-Dspring.profiles.active=test

With these configurations - run SpringBoot main method.

Technological stack

  • SpringBoot as a skeleton framework
  • Spring Scheduler as a task manager
  • MySQL database as a database for saving user and subscription info
  • Flyway database migration tool
  • Telegram-bot SpringBoot starter
  • Spring Data starter
  • Unirest - lib for working with REST callshow I can create real application, which can be used by someone else.

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.