Skip to content

ijo42/ObscureSlangTranslator

Repository files navigation

Obscure Slang Translator

A little educational project. Telegram bot that translate stranger Russian slang to human language

time tracker

Up-to-date information is available in News Public

Stack:

  • Node.JS
  • TypeScript
  • PostgreSQL
  • Docker
  • Node's Telegram Bot API
  • Fuse.JS
  • Prisma

I love java, but sometimes I want some variety... sorry for the bleeding eyes

Image-Variants

Tags Description
latest Using the latest tag will pull the latest release image
master Using the master tag will pull latest master-branch image
sha-([a-z0-9]{7}) Using this tag will push image based on relevant git-commit (sha-155fc99)
#.#.# Using this tag will push relevant Release (1.1.0)

Deployment:

I strongly urge you to use Docker

using docker-compose:

  1. create bot-account via BotFather
  2. create .env file. like this:
PGHOST=obscure_db
PGUSER=root
PGDATABASE=postgres
PGPASSWORD=****
#PGPORT=5432 # Only if need map to global network

DEBUG=false
TELEGRAM_TOKEN=****
  1. create docker-compose.yml file. like this:
version: "2"

services:
 bot:
   image: ijo42/obscureslangtranslator:latest
   restart: always
   depends_on:
     - db
   environment:
     DATABASE_URL: postgresql://${PGUSER}:${PGPASSWORD}@${PGHOST}:5432/${PGDATABASE}?schema=public
     DEBUG: ${DEBUG}
     TELEGRAM_TOKEN: ${TELEGRAM_TOKEN}
 db:
   image: postgres:latest
   container_name: ${PGHOST}
   restart: always
  # ports:             # Only if need map to global network
  #   - ${PGPORT}:5432
   volumes:
     - db_data:/var/lib/postgresql/data
   environment:
     POSTGRES_USER: ${PGUSER}
     POSTGRES_PASSWORD: ${PGPASSWORD}
     POSTGRES_DB: ${PGDATABASE}

volumes:
 db_data:
  1. start via docker-compose up -d
  2. (optional) setup moderator's rights via console-instructions

using heroku:

  1. create bot-account via BotFather
  2. create heroku application (https://dashboard.heroku.com/new-app)
  3. add postgres add-on
  4. clone this repo, link heroku remote (heroku git:remote -a <app-name>)
  5. add next heroku config vars
FIELD VALUE
TELEGRAM_TOKEN
APP_URL https://<app-name>.herokuapp.com:443
NTBA_FIX_319 TRUE
NTBA_FIX_350 TRUE
  1. push to heroku (git push heroku master)
  2. (optional) setup moderator's rights via log-instructions

License

As described in LICENSE, MPL-2.0 used

I also try to stick to Semantic Versioning, Conventional Commits