Skip to content

bastean/tgo

Repository files navigation

README Logo

Example of interoperability between a Web App, a Telegram Bot and a third-party API.

Important

  • tGO is still in the early stages of development.

License MIT Go Report Card Commitizen friendly Release It!

Upgrade workflow CI workflow Release workflow

Go Reference GitHub Releases

Showcase

CLI

Installation

go install github.com/bastean/tgo/cmd/tgo@latest

Usage

Note

  • We need to create an .env file where we have our own values defined.
    • In the .env.example.cli file, we can see the values that can be used.
      • If we want only certain users to be able to interact with the bot to “test” it, then we must define their respective usernames in the TGO_BOT_TELEGRAM_WHITELIST_USERNAMES variable, otherwise anyone will be able to interact with it.
  • Following these step-by-step guides we will get the required values for third-party services like Telegram and CoinGecko.
tgo -h
_____  ________________
__  /_ __  ____/__  __ \
_  __/ _  / __  _  / / /
/ /_   / /_/ /  / /_/ /
\__/   \____/   \____/

Example of interoperability between a Web App, a Telegram Bot and a third-party API.

Usage: tgo [flags]

  -env string
    	Path to ENV file (required)

Docker

Usage (Demo)

Note

  • We must define our own Telegram and CoinGecko values in the file .env.demo by modifying the variables TGO_BOT_TELEGRAM_* and TGO_API_COINGECKO_*.
    • If we want only certain users to be able to interact with the bot to “test” it, then we must define their respective usernames in the TGO_BOT_TELEGRAM_WHITELIST_USERNAMES variable, otherwise anyone will be able to interact with it.
  • Following these step-by-step guides we will get the required values for third-party services like Telegram and CoinGecko.
make demo

Workflow

Idea

The system allows the user to register a “portfolio” of cryptocurrencies to perform different actions on it, such as consulting the market “prices” of the registered coins.

Functionality

It is a simple monolith where CRUD operations are performed from the Web App and the Telegram Bot to the same database, this allows us to manage users from different applications.

First Steps

Clone

HTTPS

git clone https://github.com/bastean/tgo.git && cd tgo

SSH

git clone [email protected]:bastean/tgo.git && cd tgo

Initialize

Locally

  1. System Requirements

  2. Run

    make init

ZIP

  1. System Requirements

  2. Run

    make genesis

Run

ENVs

Important

Before running it, we must initialize the following environment variable files:

  • .env.example
    • We will have to create a .env.(dev|test|prod) for each runtime environment.
    • In the .env.example.demo file, we can see the values that can be used.

In case we only want to run the Integration or Acceptance tests, in addition to having the .env.test file, we must have the following files created:

Development

make compose-dev

Tests

Unit
make test-unit
Integration
make compose-test-integration
Acceptance
make compose-test-acceptance
Unit / Integration / Acceptance
make compose-tests

Production

make compose-prod

Tech Stack

Base

Please see

Contributing

License