tgo

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2024 License: MIT

README

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 git@github.com: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

Directories

Path Synopsis
cmd
tgo command
internal
app/server/component/layout
templ: version: v0.2.771
templ: version: v0.2.771
app/server/component/page/home
templ: version: v0.2.771
templ: version: v0.2.771
app/server/component/scripts
templ: version: v0.2.771
templ: version: v0.2.771
app/server/component/scripts/fomantic
templ: version: v0.2.771
templ: version: v0.2.771
app/server/component/scripts/jquery
templ: version: v0.2.771
templ: version: v0.2.771
app/server/component/scripts/storage
templ: version: v0.2.771
templ: version: v0.2.771
pkg
scripts
copydeps command
syncenv command
upgrade command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL