divyenduz / languagelearners

LingoParrot - LanguageLearners.club
1 stars 0 forks source link

It was great to work and make this project, Tuti is now deprecated https://divyendusingh.com/farewell-tuti

Note: this was a private project, this is made public. Some CI/CD scripts might be outdated. This is only for reference and might not be deployable as is.

Setup

Built with telegraf, Telegram Bot API, AWS and ❤️

docker build . -t lingoparrot
docker tag lingoparrot:latest <docker remote>
docker run -p 3000:3000 --env-file ./.env.local.docker lingoparrot:latest
docker push <docker remote>

Setup for Content Website

cd carrd-language-learners-20220623
npx serve

Development/Production Workflow

We use a specific dev/production setup. For all the relevant commands, yarn scripts have two variants like:

  1. yarn run set-webhook
  2. yarn run set-webhook-production

The 1st one uses .env and the 2nd one uses .env.production. With sensible defaults, I believe that this setup is most convenient for bot development and yields least mistakes. Open to feedback.


Development Setup

Copy .env_sample file to .env (and .env.production for a production setup - details later) and fill the required values.

Run the following commands to start receiving @<bot-name> requests on your local machine.

  1. yarn dev
  1. yarn run watch - to watch and compile TS to JS.

Generally, I have two versions of the bot i.e. development and production. I point my dev bot to my local setup using the above steps.


Deploy Development

yarn run deploy - deploys to Lambda using parameters from .env


Deploy Production

yarn run deploy-production - deploys to Lambda using parameters from .env.production


Resources