Skip to content

Latest commit

 

History

History

content-sync

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Content sync

Fetch various content (such as news, videos) and periodically get them through Telegram Bot.

Supported integrations

Architecture diagram

Diagram

Stack

  • ZIO
    • ZIO Temporal (Protobuf transport)
    • ZIO Streams,
    • ZIO Logging
    • ZIO Config
    • ZIO JSON
    • ZIO HTTP
  • Data processing
    • Apache Spark
  • Database layer
    • ZIO Quill
    • Flyway
  • Integrations
    • STTP
    • Official Google API Client
    • Telegramium
  • Testing
    • ZIO Temporal Testkit
    • ZIO Test
    • Mockito

How to read the code

Run examples

(1) Create a secret.env file in the project root. It must contain the following secrets:

  • Telegram (taken from BotFather):
    • TELEGRAM_BOT_TOKEN
    • TELEGRAM_BOT_USERNAME
  • Youtube (taken from google console):
    • OAUTH2_CLIENT_CLIENT_ID
    • OAUTH2_CLIENT_CLIENT_SECRET

Integration Notes:

(2) Start temporal cluster
(either on your own or in Docker from the parent directory)

(3) Download the corresponding Apache Spark artifact (for Scala 2.13) into the ./spark_home directory.

(4a) Run each component locally:

# Initialize database
make start-local-env
# content sync components
make start-puller-local
make start-processor-launcher-local
make start-telegram-bot-local

(4b) Or assemble docker images & run them:

# build docker images
sbt docker:publishLocal

# start dockerized env
make start-dockerized-env

(5) Interact with the Telegram bot!
Bot