Git Product home page Git Product logo

javarushcommunity / javarush-telegrambot Goto Github PK

View Code? Open in Web Editor NEW
117.0 6.0 25.0 179 KB

JavaRush Telegram bot from the community to the community. All the process of software development of this bot is described in series of posts

Home Page: https://t.me/javarush_community_bot

License: Apache License 2.0

Java 99.01% Dockerfile 0.47% Shell 0.52%
telegram-bot javarush springboot mvp flyway

javarush-telegrambot's Introduction

Javarush Telegram Bot

87- Converted

JavaRush Telegram bot from community for community. Written by developers, who learned in Javarush.

Idea

The main idea is to show how to create real application, which can be used by someone else. There are set of posts, which are describing step by step guidelines of how it was created.

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 JavaRush 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}

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 calls

Code of Conduct

Please, follow Code of Conduct page.

License

This project is Apache License 2.0 - see the LICENSE file for details

Contributions

Feel free to suggest new features via github issue. Note, that new features must be approved before start implement it to avoid the situation, when the time was spent, but the changes wouldn't added to the project.

javarush-telegrambot's People

Contributors

romankh3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

javarush-telegrambot's Issues

[FEATURE]

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[BUG]

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

[FEATURE] JRTB-1: Add repository layer

Add repository layer to the project.

Acceptance Criteria:

  • Flyway added
  • Schema for database added
  • Spring Data added
  • Entities added
  • H2 database for testing purposes added
  • integration tests for with h2 added

[FEATURE]

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[FEATURE]

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[BUG] last migration does not work

Describe the bug
The last migration (V00004_change_chat_Id_type_to_Long.sql) does not work.

To Reproduce
Steps to reproduce the behavior:
run migrations locally and check it in flyway schema table.

Expected, that this migration would be executed.

[FEATURE] JRTB-4: As a user, I want to get new articles no later than 20 minutes since the article was created

As a user, I want to get new articles no later than 20 minutes since the article was created.
For it, needs to be implemented Spring Scheduler.

Every 15 minutes the newly created service will :

  • find all active subscriptions(subscription, which linked to the active user)
  • find all new articles for active subscriptions
  • send new articles for users

Acceptance criteria:

  • Spring scheduler added to the project with task every 15 minutes
  • Logic for getting new articles added

The scheduling process for finding new articles for an active subscription must be followed by this workflow:
103340221-62bb5400-4a38-11eb-947f-c28ce8ecad1b

[QUESTION] JavaRushTelegramBotAplicationTests.java

Привет! Подскажи такой момент. Делал все по порядку, как в статьях на JavaRush, но на STEP-5, после заливки на GitHub билд отказывался собираться, проблема была в файле JavaRushTelegramBotAplicationTests.java. Проглядел твой репозиторий и не увидел там его, хотя изначально помню, что мы его пушили. Нужен ли он вообще?

[FEATURE] Implement deployment process

Imlement deployment process with using Docker.

Acceptance criteria:
*docker file added to the project
*deplyment process with providing environment variables is added to the project

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.