All Projects → ivan909020 → shop-telegram-bot

ivan909020 / shop-telegram-bot

Licence: GPL-3.0 license
Java shop chatbot for Telegram

Programming Languages

java
68154 projects - #9 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to shop-telegram-bot

theimagebot
Blog.TheOstrich.Eu.Org
Stars: ✭ 15 (-78.87%)
Mutual labels:  telegram-bots
telresender
A Telegram bot, which resend your message to another account
Stars: ✭ 22 (-69.01%)
Mutual labels:  telegram-bots
forwardscoverbot
telegram bot that echoes any message you send it or modify to anonymize messages
Stars: ✭ 150 (+111.27%)
Mutual labels:  telegram-bots
ez-sticker-bot
Telegram sticker formatting bot
Stars: ✭ 44 (-38.03%)
Mutual labels:  telegram-bots
AbilityBots
The AbilityBots abstraction and API for building expressive Java Telegram Bots
Stars: ✭ 12 (-83.1%)
Mutual labels:  telegram-bots
SophiaBot
Hi There ✋ I'M Sophia 3.0 ❤️ NEW VERSION OF SOPHIA.. Source Code of @SophiaSLBot.
Stars: ✭ 44 (-38.03%)
Mutual labels:  telegram-bots
Telegraf
Modern Telegram Bot Framework for Node.js
Stars: ✭ 5,178 (+7192.96%)
Mutual labels:  telegram-bots
TelegramBotsList
A list of all Telegram bots source hosted on github.
Stars: ✭ 277 (+290.14%)
Mutual labels:  telegram-bots
Txt2SpeechBot
The only Text to Speech Telegram Inline Bot
Stars: ✭ 26 (-63.38%)
Mutual labels:  telegram-bots
tdlight-java
Complete Bot and Userbot Telegram library based on TDLib
Stars: ✭ 128 (+80.28%)
Mutual labels:  telegram-bots
gotgbot
Autogenerated Go wrapper for the telegram API. Inspired by the python-telegram-bot library.
Stars: ✭ 178 (+150.7%)
Mutual labels:  telegram-bots
pmChatBot
A simple feed-back bot written in PHP. Like Livegram. Heroku Support
Stars: ✭ 31 (-56.34%)
Mutual labels:  telegram-bots
telegram-bot-sdk
🤖 Telegram Bot API PHP SDK. Create Telegram Bots with PHP Easily! [WIP - DO NOT USE IN PRODUCTION YET]
Stars: ✭ 64 (-9.86%)
Mutual labels:  telegram-bots
wptelegram
Integrate your WordPress site perfectly with Telegram with full control.
Stars: ✭ 31 (-56.34%)
Mutual labels:  telegram-bots
RPi-TELEBOT
Python based Telegram bot to monitor and control the raspberry pi
Stars: ✭ 19 (-73.24%)
Mutual labels:  telegram-bots
google-it-telegram-bot
🤖 @Google_itBot 🔎 Search and share LINKS/IMAGES/VIDEOS in inline mode
Stars: ✭ 40 (-43.66%)
Mutual labels:  telegram-bots
Nutgram
The Telegram bot framework that doesn't drive you nuts.
Stars: ✭ 206 (+190.14%)
Mutual labels:  telegram-bots
TelegramScraper
Using this tool you can easily add so many members from any group to your group. Less than 2 minutes. Super easy. Time saver. But this tool is only for educational purpose. You could be banned from Telegram. So be careful. Recommanded to use this tool only on Termux.
Stars: ✭ 234 (+229.58%)
Mutual labels:  telegram-bots
joinhider bot
Telegram bot to delete user joined messages
Stars: ✭ 20 (-71.83%)
Mutual labels:  telegram-bots
github client
Open source bot telegram menggunakan bahasa code dart
Stars: ✭ 24 (-66.2%)
Mutual labels:  telegram-bots

shop-telegram-bot

Shop in telegram with admin panel

Technology stack

Java 8, Maven, Spring Boot, Spring MVC, Spring Data, Spring Security, Hibernate, Postgresql, Freemarker, HTML, Telegram Bots

Demo

Notes before deploy

  • Telegram bot sends images as a link, if they are uploaded from the localhost, the bot will not be able to send them
  • Telegram bot does not support raw ip address for sending images, you should use domain instead

How to deploy with docker

mvn -f shop-telegram-bot/admin-panel/ package
mvn -f shop-telegram-bot/telegram-bot/ package

docker build -t shop-admin-panel shop-telegram-bot/admin-panel/
docker build -t shop-telegram-bot shop-telegram-bot/telegram-bot/

docker-compose -f shop-telegram-bot/docker-compose.yml up -d postgresql

docker exec -i shop-postgresql psql -U postgres -c "CREATE DATABASE shop_telegram_bot"
docker exec -i shop-postgresql psql -U postgres shop_telegram_bot < shop-telegram-bot/resources/db_schema.sql
docker exec -i shop-postgresql psql -U postgres shop_telegram_bot < shop-telegram-bot/resources/db_data.sql

docker-compose -f shop-telegram-bot/docker-compose.yml up -d admin-panel telegram-bot

How to deploy manually

  1. Install software
  • Update and upgrade sudo apt-get update && sudo apt-get upgrade
  • Install git apt-get install git
  • Install maven apt-get install maven
  • Install jdk 8 apt-get install openjdk-8-jdk
  • Install postgres apt-get install postgresql postgresql-contrib
  • Install nginx apt-get install nginx
  • Clone repository git clone https://github.com/ivan909020/shop-telegram-bot.git
  • Package admin panel mvn -f shop-telegram-bot/admin-panel/ package
  • Package telegram bot mvn -f shop-telegram-bot/telegram-bot/ package
  1. Set environment variables

Add database environment variables.

  • DATABASE_URL (jdbc:postgresql://localhost:5432/shop_telegram_bot)
  • DATABASE_USERNAME (postgres)
  • DATABASE_PASSWORD (postgres)

Or you can manually change configuration in properties telegram-bot/src/main/resources/hibernate.cfg.xml and admin-panel/src/main/resources/application.properties

  1. Create telegram bot
  • Create a telegram bot here and enable inline mode in settings
  • Add telegram bot username and token to properties telegram-bot/src/main/resources/application.properties
  • To receive notifications about new orders you need specify your chat id in properties
  1. Set up database

Replace your-directory with directory where the cloned repository is located

  • Login postgres user sudo -i -u postgres
  • Connect postgres database psql
  • Change password \password
  • Create database create database shop_telegram_bot;
  • Exit from postgres database \q
  • Import database schema psql -d shop_telegram_bot < /your-directory/shop-telegram-bot/resources/db_schema.sql
  • Import database data psql -d shop_telegram_bot < /your-directory/shop-telegram-bot/resources/db_data.sql
  • Exit from postgres user exit
  1. Set up admin panel
Create systemd unit

Replace your-directory with directory where the cloned repository is located

nano /etc/systemd/system/shop-admin-panel.service

[Unit]
Description=shop-admin-panel
After=syslog.target

[Service]
WorkingDirectory=/your-directory/shop-telegram-bot/
ExecStart=/usr/bin/java -jar /your-directory/shop-telegram-bot/admin-panel/target/admin-panel-1.0.0.jar
StandardOutput=journal
StandardError=journal
SyslogIdentifier=shop-admin-panel
SuccessExitStatus=143
Type=simple
Restart=always

[Install]
WantedBy=multi-user.target reboot.target default.target poweroff.target

systemctl daemon-reload

systemctl enable shop-admin-panel.service

systemctl start shop-admin-panel.service

Nginx configuration

Replace your-domain.com with your domain (domain is needed for correct sending of product photos)

nano /etc/nginx/conf.d/your-domain.com.conf

server {

    listen 80;

    server_name your-domain.com;


    index index.html;

    include conf.d/shop-admin-panel.include;

}

nano /etc/nginx/conf.d/shop-admin-panel.include

location /admin {

    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size 1024m;

}

systemctl restart nginx

Web UI is accessible on http://localhost:8080/admin, default credentials - admin:admin

  1. Set up telegram bot
Create systemd unit

Replace your-directory with directory where the cloned repository is located

nano /etc/systemd/system/shop-telegram-bot.service

[Unit]
Description=shop-telegram-bot
After=syslog.target

[Service]
WorkingDirectory=/your-directory/shop-telegram-bot/
ExecStart=/usr/bin/java -jar /your-directory/shop-telegram-bot/telegram-bot/target/telegram-bot-1.0.0-jar-with-dependencies.jar
StandardOutput=journal
StandardError=journal
SyslogIdentifier=shop-telegram-bot
SuccessExitStatus=143
Type=simple
Restart=always

[Install]
WantedBy=multi-user.target reboot.target default.target poweroff.target

systemctl daemon-reload

systemctl enable shop-telegram-bot.service

systemctl start shop-telegram-bot.service

Screenshots

Chatbot

Admin panel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].