Skip to content

Set a schedule from a Telegram WebApp for @OfficeGymBot

License

Notifications You must be signed in to change notification settings

Rusteam/ogb_schedule_webapp

Repository files navigation

📆 Telegram Scheduler WebApp

Set a fitness schedule from a Telegram WebApp for @OfficeGymBot.

* * *


📱 Features

  • set training days of week and time 💪
  • auto timezone detection 🗺️
  • dark and light modes 🚥
  • python bot to test the integration 🤖
  • automated S3 deployment 🚀
dark theme light theme

⌨️ Usage

Prereqs

  • [build] npm
  • [test] ngrok, python3.9
  • [deployment] aws cli and credentials

Install and run

make dev
make run

Review the app on localhost. Try to set a schedule and check the logs in the console. Selected days and time will be sent to a webhook upon clicking the "SAVE" button. When using from Telegram, clicking on the "SAVE" button also closes the window.

Telegram bot

In order to test the app from Telegram, you need to run a bot locally and expose the app to the Internet.

  1. Install and activate python3.9 environment (conda or other).
  2. Install dependencies: pip install -r requirements.txt
  3. Create a telegram bot from BotFather and get a token.
  4. Start the app locally make run and launch ngrok to expose the app on https: make ngrok.
  5. Run a test bot: make bot and enter required credentials and links.

Build dist

Build a static website for distribution: make build.

The app contents will be saved to the ./dist folder and can be uploaded to any static file server.

Deploy to S3

  1. Create .env file with AWS_* credentials as in .env.example.
  2. Upload dist files to S3: make s3