Git Product home page Git Product logo

trade-union-telegram-bot's Introduction

trade-union-telegram-bot

Telegram bot with state management and localization. Work example - https://imgur.com/0V3fsdD

You can use this as a template for your projects.

Using: Go, Mongodb, Elasticsearch, Kibana, VictoriaMetrics, Grafana, Docker, Docker Compose

Usage

1. Create .env file

cp .env.example .env

For example:

ENV=prod

# Telegram bot
TELEGRAM_BOT_TOKEN=example-telegram-token

# Rest api for administrator
ADMIN_API_TOKEN=example-token

# Mongodb
MONGO_USERNAME=admin
MONGO_PASSWORD=<your_mongo_admin_password>
MONGO_DATABASE=tradeUnion

2. Create config

cp ./configs/local.yaml ./configs/prod.yaml

3. Fill the new config with current data for your environment

For example use nano editor:

nano ./configs/prod.yaml

4. Run with docker-compose

Initialize environment:

source .env

Run with docker-compose:

docker-compose up --build -d

Or run for local development and debug

docker-compose --file ./docker-compose.mongo.yml up --build -d
go run ./cmd/trade-union/main.go

5. Run with metrics

Edit your config:

victoria_metrics:
  metrics_enabled: true

Run victoria metrics + grafana

docker-compose --file ./docker-compose.vm.yml up --build -d

Open Grafana on http://localhost:3000/ and sign in with default credentials admin:admin and change password

6. Run with elasticsearch and kibana

Edit your config:

logger:
  elastic:
    enable: true

Set environment variables

nano .env

For example

ELASTIC_USERNAME=elastic
ELASTIC_PASSWORD=<your_elastic_password>

KIBANA_USERNAME=kibana_system
KIBANA_PASSWORD=<your_kibana_system_password>

Run elasticsearch + kibana

docker-compose --file ./docker-compose.elk.yml up --build -d

Open kibana on http://localhost:5601/ and sign in with your credentials from environment

trade-union-telegram-bot's People

Contributors

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